Data attribute supplementing method, apparatus, device, and medium
By identifying target nodes in graph data and performing path completion and strategy function optimization, the problem of data attribute supplementation in entity parsing is solved, thereby improving the accuracy and robustness of entity recognition.
Patent Information
- Application Number
- CN202411093545.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-09
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.
The target node is identified from the graph data, the path is supplemented using the initial policy function, the target feature path is constructed, and the final feature path is obtained through entity recognition model training and policy function optimization to supplement attributes.
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 CN118964345B_ABST
Abstract
Description
Technical Field
[0001] The present application is applicable to the field of big data technology, and in particular relates to a data attribute supplementation method, device, equipment and medium. Background Art
[0002] Entity resolution refers to the process of identifying all references that correspond to the same entity in the real world, given one or more reference sets that describe the real world. For example, given a dataset, entity resolution is the process of identifying all data in the dataset that points to the same real entity. During the entity resolution process of a dataset, if the existing data information such as attributes and attribute values in the dataset is not sufficient to uniquely identify or distinguish different entities during the entity resolution process, the data in the dataset needs to be supplemented and enriched based on data from external data sources. If all the data in the external data source is used to enrich the dataset, the accuracy of entity resolution may be affected due to problems such as data redundancy, noise interference, and data inconsistency. For example, information in the external data source that is irrelevant to the current dataset, erroneous, outdated, or null values may have a negative impact on the results of entity resolution. Therefore, how to supplement data attributes to improve the accuracy of entity resolution has become an urgent problem to be solved. Summary of the Invention
[0003] In view of this, embodiments of the present application provide a data attribute supplementation method, apparatus, device, and medium to solve the problem of how to supplement data attributes to improve the accuracy of entity resolution.
[0004] In a first aspect, an embodiment of the present application provides a method for supplementing data attributes, the method comprising:
[0005] Determine a target node from the graph data that matches the entity corresponding to the target tuple data;
[0006] Using an initial strategy function, supplementing the characteristic path of the target node in the graph data to obtain a target characteristic path;
[0007] Determine from the graph data the characteristic value corresponding to the target characteristic path as attribute supplementary data of the target tuple data;
[0008] Training an entity recognition model according to the attribute supplementary data to obtain a trained entity recognition model, and obtaining a performance recognition result of the trained entity recognition model;
[0009] 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 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.
[0010] In a second aspect, an embodiment of the present application provides a data attribute supplement device, which comprises:
[0011] a heterogeneous entity analysis module, configured to determine a target node matched with an entity corresponding to target tuple data from graph data;
[0012] 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;
[0013] a determination module, 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;
[0014] an evaluation module, configured to train an entity recognition model according to the attribute supplement data to obtain a trained entity recognition model, and obtain a performance identification result of the trained entity recognition model;
[0015] an optimization module, configured to optimize the initial strategy function according to the performance identification 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 an attribute supplement result of the target tuple data.
[0016] 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.
[0017] 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.
[0018] Compared with the prior art, the embodiment of the present application has the beneficial effects that: the present application determines the target node matched with the target tuple data corresponding to the entity from the graph data, uses the initial strategy function, supplements 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 the 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 the 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, supplements the path according to the target strategy function to obtain a final feature path, and determines the feature value corresponding to the final feature path as the attribute supplement result of the target tuple data. Wherein, by jointly training 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 faster, 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 the entity recognition model, the accuracy of entity analysis of the entity recognition model is improved, and the robustness of the entity recognition model to data distribution changes is also improved in the joint training process. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1 is an application environment schematic diagram of a data attribute supplement method provided by an embodiment of the present application;
[0021] Figure 2 is a flow schematic diagram of a data attribute supplement method provided by an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of graph data provided by an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of target tuple data provided by an embodiment of the present application;
[0024] Figure 5 is a flow schematic diagram of a data attribute supplement method provided by an embodiment of the present application;
[0025] Figure 6 is a flowchart of a data attribute supplementing method provided by Embodiment Four of the present application;
[0026] Figure 7 is a flowchart of a data attribute supplementing method provided by Embodiment Five of the present application;
[0027] Figure 8 is a flowchart of a data attribute supplementing method provided by Embodiment Six of the present application;
[0028] Figure 9 is a flowchart of a data attribute supplementing method provided by Embodiment Seven of the present application;
[0029] Figure 10 is a flowchart of a data attribute supplementing method provided by Embodiment Eight of the present application;
[0030] Figure 11 is a structural diagram of a data attribute supplementing apparatus provided by Embodiment Nine of the present application;
[0031] Figure 12 is a structural diagram of a computer device provided by Embodiment Ten of the present application. DETAILED DESCRIPTION
[0032] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the present embodiments. However, it will be apparent to those skilled in the art that the present embodiments can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, and circuits are omitted so as not to obscure the description of the present embodiments.
[0033] It is to be understood that the terminology "includes", "has", "holds", "contains" and / or "comprising", "comprised of", "comprising", "comprises" when used in the present specification and in the accompanying claims, specifies the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0034] It is also to be understood that the terminology "and / or" when used in the present specification and in the accompanying claims, refers to at least one of the items, or any combination of one or more of the items, associated with the "and / or" term.
[0035] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [the described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0036] In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0037] In the present application, the reference "one embodiment" or "some embodiments" and the like means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.
[0038] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence is to use digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0039] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0040] It should be understood that the size of the serial number of each step in the following embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0041] In order to illustrate the technical solutions of the present application, the following will be described by specific embodiments.
[0042] The data attribute supplement method provided in the embodiment one of the present application can be applied in an application environment as shown in Figure 1 . The server and the client communicate with each other, the server provides a data attribute supplement service, and the client triggers a data attribute supplement task to the server. The client includes, but is not limited to, a palm 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.
[0043] Referring to Figure 2 , it is a flowchart of a data attribute supplement method provided in the embodiment two of the present application. The data attribute supplement method is applied to a server in Figure 1 . The server is connected to a client to obtain graph data and target tuple data sent by the client. As shown in Figure 2 , the data attribute supplement method can include the following steps.
[0044] In step S201, a target node matched with an entity corresponding to the target tuple data is determined from the graph data.
[0045] In the embodiment of the present application, the graph data can be a knowledge graph of a graph structure composed of nodes, edges, features of the nodes, and relationship types of the edges. The node can represent an entity or a feature value of the entity in the knowledge graph. The edge can represent a relationship between the nodes and a relationship between the nodes and the features. The feature of the node can be data associated with the node (entity) and used to represent a feature or a state of the node. The feature value of the node is a specific numerical value of the corresponding node feature. The target tuple data can be a row of data in a table structure data set. Each target tuple data is composed of an attribute and a corresponding attribute value. The attribute can be a variable or a field describing a feature of the target tuple data. The attribute value can be a specific numerical value of the corresponding attribute. The target node can be a node in the graph data representing the same real entity as the target tuple data.
[0046] For example, as shown in Figure 3 , it is a schematic diagram of graph data provided in the embodiment two of the present application. 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 including a name, a gender, an age, a spouse, an occupation, and a telephone are included. The corresponding feature values are “A1, male, 38, v2, writer, 190****6666” in sequence.
[0047] For example, as shown in Figure 4 Figure 1 is a schematic diagram of a target tuple data provided by an embodiment of the present application. The target tuple data is a row of data in a data table, including four attributes of name, gender, age and occupation, and the attribute values corresponding to the attributes are A1, male, 38 and writer respectively.
[0048] Specifically, the heterogeneous entity resolution algorithm can be used to perform heterogeneous entity resolution on the target tuple data and the graph data, and determine a target node from the graph data that represents the same real entity as the target tuple data.
[0049] In step S202, an initial strategy function is used to supplement a feature path of the target node in the graph data to obtain a target feature path.
[0050] In step S203, a feature value corresponding to the target feature path is determined from the graph data as attribute supplement data of the target tuple data.
[0051] In an embodiment of the present application, the feature path can refer to a path composed of nodes, features of the nodes and corresponding feature values in the graph data. For example, as shown in Figure 3 For node v2, a feature path of node v2 can refer to a feature path composed of node v2, the feature of the node "name" and the corresponding feature value "A2", which can be denoted as p = (v2, v8). The strategy function can be represented as a probability density function, 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 strategy function can select actions such as acceleration, deceleration or maintaining the current speed with a certain probability according to the current speed and road conditions. The strategy function can be denoted as p e, where e is a set of parameters that defines the probability distribution of selecting the feature path, and the initial strategy function can refer to the strategy function of parameter initialization. The target feature path can refer to the feature path of the target node after the path supplement using the initial strategy function. The attribute supplement data can refer to the features and corresponding feature values in the target feature path.
[0052] Specifically, the initial strategy function can be used to supplement the feature path of the target node in the graph data according to the attributes and attribute values of the target tuple data to obtain the target feature path, and the features and corresponding feature values in the target feature path can be determined as the attribute supplement data of the target tuple data.
[0053] 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.
[0054] 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 the result of index evaluation on the trained entity recognition model. For example, the gender recognition result can be the F1 score, recall rate and accuracy of the model, etc.
[0055] Specifically, for any target tuple data in the data set, the attribute and attribute value of the target tuple data can be supplemented using the attribute supplemented data. After the attribute supplementation of all target tuple data in the data set is completed, the attribute supplemented data set is obtained. The trained entity recognition model is obtained by using the attribute supplemented data set as the training set to train the entity recognition model. The performance evaluation of the trained entity recognition model is performed using the verification set, and the F1 score and recall rate of the trained entity recognition model are obtained as the performance recognition result.
[0056] 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 the attribute supplemented result of the target tuple data is determined as the feature and feature value corresponding to the final feature path.
[0057] In the embodiments of the present application, the target strategy function can refer to the strategy function after the optimization of the initial strategy function, the final feature path can refer to the feature path after the path supplementation of the feature path of the target node using the target strategy function, and the attribute supplemented result can refer to the feature and feature value in the final feature path.
[0058] 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, and the entity recognition model is used to train the target tuple data enriched with the feature and feature value of the target feature path. The initial strategy function is optimized according to the performance recognition result of the trained entity recognition model until the termination condition of the joint training is reached to obtain the target strategy function. The path of the feature path of the target node is supplemented using the target strategy function to obtain the final feature path. The feature and feature value of the final feature path are determined as the attribute supplemented result of the target tuple data, and the attribute supplemented result is used to supplement the attribute of the target tuple data.
[0059] In the embodiment of the present application, the policy function and the entity recognition model are jointly trained, so that the policy function and the entity recognition model interact and influence each other during the training process. The performance recognition result of the entity recognition model is used to optimize the policy function, so that the policy function can learn effective strategies faster, improve the convergence speed of the policy function, and improve the accuracy of attribute supplement. The target tuple data obtained by supplementing the attribute based on the feature path constructed based on the policy 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, during the joint training process, the robustness of the entity recognition model to data distribution changes is also improved.
[0060] Referring to Figure 5 FIG. 1 is a flowchart of a data attribute supplement method according to an embodiment of the present application. As shown in FIG. 1, the data attribute supplement method according to the embodiment of the present application can include the following steps S201-S204. Figure 5 The step S201 of determining the target node matched with the entity of the target tuple data from the graph data can include the following steps.
[0061] In step S501, the feature values of each node in the graph data are determined, and the attribute values of the target tuple data are determined.
[0062] In step S502, all attribute values in the target tuple data are formed into an attribute value set. For any node in the graph data, a first subgraph data corresponding to the node is determined, and the feature values of all nodes in the first subgraph data are formed into a feature value set.
[0063] In step S503, 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. 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 values of all nodes in the graph data and a preset threshold, candidate nodes matched with the entity of the target tuple data are determined.
[0064] In step S504, the candidate nodes are screened according to the feature vectors of the candidate nodes and the attribute vectors of the target tuple data, and the target node is obtained.
[0065] In the embodiment of the present application, the attribute value set can be a set of attribute values of all attributes in the target tuple data, the first subgraph data can be graph data including any node and all neighbors of the node, the feature value set can be a set of feature values of all nodes in the first subgraph data, the first similarity value can be a score value representing the syntactic similarity between the node in the graph data and the target tuple data, and the preset threshold can be a value that the first similarity value corresponding to the node needs to satisfy when the node is determined as a candidate node.
[0066] Specifically, the first similarity value between each node in the graph data and the target tuple data can be calculated based on the Jaccard similarity coefficient. First, determine the attribute values corresponding to all attributes in the target tuple data to form an attribute value set, recorded as Set(t). For any node in the graph data, determine the first subgraph data corresponding to the node, determine the eigenvalues of all nodes in the first subgraph data, and form a eigenvalue set of all nodes in the first subgraph data, recorded as Set(v). The first similarity value is recorded as Jacc(t,v). Then, the first similarity value between the node and the target tuple data is calculated based on the Jaccard similarity coefficient, which can be expressed as Finally, according to the preset threshold and the first similarity value, the first similarity values of all nodes in the graph data are screened, and the nodes whose first similarity values are higher than the preset threshold are determined as candidate nodes. According to the feature vector of the candidate node and the attribute vector of the target tuple data, the candidate nodes are screened to obtain the target node.
[0067] In an embodiment of the present application, a first similarity value of a set of attribute values corresponding to target tuple data and a set of feature values corresponding to any node in graph data is calculated based on the Jaccard similarity coefficient, and candidate nodes are obtained based on the first similarity value. Candidate nodes with higher syntactic similarity to the graph data are screened, and the candidate nodes are screened to obtain target nodes, thereby improving the accuracy of the target nodes obtained by screening.
[0068] See also Figure 6 , is a flow chart of a data attribute supplement method provided in Example 4 of this application. Figure 6 As shown, in the above step S304, the candidate nodes are screened according to the feature vectors of the candidate nodes and the attribute vectors of the target tuple data to obtain the target node, which may include the following steps:
[0069] Step S601: vectorize all attribute values in the target tuple data to obtain an attribute vector. For any candidate node, determine the second subgraph data corresponding to the candidate node, and vectorize the feature values of all nodes in the second subgraph data to obtain a feature vector.
[0070] Step S602 : Calculate the second similarity value between the feature vector and the attribute vector, sort the second similarity values corresponding to all candidate nodes, and obtain the target node.
[0071] In the embodiments of the present application, the attribute vector can refer to the vector form of all attribute values in the target tuple data, the second subgraph data can refer to the graph data of any candidate node, including the candidate node and all neighbors of the candidate node, the feature vector can refer to the vector form of the feature values of all nodes in the second subgraph data, and the second similarity value can refer to a score value representing the semantic similarity between the candidate node in the graph data and the target tuple data.
[0072] Specifically, the second similarity value of any candidate node and the target tuple data can be calculated according to the cosine similarity. First, the attribute values corresponding to all attributes in the target tuple data are vectorized to obtain an attribute vector, denoted as e t For any candidate node, the 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) = max cos(e w , e t ), and 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.
[0073] In the embodiments of the present application, the second similarity value of the attribute vector corresponding to the target tuple data and the feature vector corresponding to any candidate node is calculated according to the cosine similarity, and the optimal target node is obtained according to the second similarity value. On the basis of syntactic similarity, semantic similarity is screened, and on the basis of improving the speed and flexibility of screening the target node, the accuracy of the screened target node is also improved.
[0074] Referring to Figure 7 , FIG. 5 is a flowchart of a data attribute supplementing method according to an embodiment of the present application, and as shown in FIG. 5, the data attribute supplementing method can include the following steps: Figure 7
[0075] In step S701, the attributes and attribute values of the target tuple data are determined, and an initial feature path starting from the target node is determined according to the attributes and attribute values.
[0076] In step S702, the initial feature path is input into an initial policy function to obtain an action probability distribution in the state of the initial feature path.
[0077] 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.
[0078] Step S704, taking the updated feature path as the initial feature path, returns 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 the preset first value, and obtains the target feature path.
[0079] In the embodiments of the present application, the initial feature path can refer to a path determined in the graph data and starting from the target node and composed of the attributes and attribute values of the target tuple data. The action probability distribution can refer to the probability distribution of taking each action output by the initial strategy function in the current state of the input 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 refer to the feature path after path supplementing the feature path of the target node in the graph data according to the action probability distribution, and the preset first value can refer to a value that the number of feature values of the updated feature path should meet when determining the target feature path.
[0080] Specifically, according to the attributes and attribute values of the target tuple data, the 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 backtracking the feature path, and the probability of maintaining 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 the updated feature path. Taking the updated feature path as the initial feature path, the step of inputting the initial feature path into the initial strategy function is executed again until the number of feature values in the updated feature path meets the preset first value, and then the updated feature path meeting the first value is determined as the target feature path.
[0081] For example, for the target tuple data shown in Figure 4 , if the target node matching the entity corresponding to the target tuple data in Figure 3 is v1, then according to the attributes and attribute values of the target tuple data, the initial feature path starting from the target node is determined in Figure 2There are 4 initial feature paths starting from the target node v1, namely ρ1=(v1,v6), ρ2=(v1,v4), ρ3=(v1,v7) and ρ4=(v1,v3). Input ρ1, ρ2, ρ3 and ρ4 into the initial policy function. If the action probability distribution output by the initial policy function is: the probability of adding a new feature path is 0.5, the probability of retracting the feature path is 0.3, and the probability of keeping the current feature path is 0.2, then the action with the highest probability is to add a new feature path. The action of adding a new feature path is executed. An edge ρ5 = (v1, v2) is randomly added to the feature path, and the updated feature paths are ρ1 = (v1, v6), ρ2 = (v1, v4), ρ3 = (v1, v7), ρ4 = (v1, v3), and ρ5 = (v1, v2). The updated feature path includes five features: name, gender, age, occupation, and spouse. The corresponding five feature values are "A1, male, 38, writer, v2" in sequence. 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.
[0082] In the embodiment of the present application, for any target tuple data, in the process of gradually and dynamically constructing the target feature path based on the corresponding target nodes and attribute values, 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 in the target tuple data, which shows that the data attribute supplementation problem is solvable in polynomial time. 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.
[0083] See also Figure 8 , is a flow chart of a data attribute supplement method provided in Example 6 of this application. Figure 8 As shown, in the above step S205, optimizing the initial policy function according to the performance identification result to obtain the target policy function may include the following steps:
[0084] Step S801 : Optimize the initial policy function according to the performance identification result to obtain an updated policy function.
[0085] Step S802: Using the updated policy function as the initial policy function, returning to the step of using the initial policy function, and executing until the updated policy function meets a preset termination condition, thereby obtaining a target policy function.
[0086] In the embodiments of the present application, the preset termination condition can be a termination condition for joint training of the preset policy function and the entity recognition model, for example, the preset termination condition can be that the performance indicator (such as accuracy, loss value, etc.) of the entity recognition model reaches the training target, reaches the maximum number of training times, and resource exhaustion, etc.
[0087] Specifically, according to the performance identification result, the parameters of the initial policy function are updated to obtain an updated policy function, and the updated policy function is used as the initial policy function to return to the step of jointly training the policy function and the entity recognition model in steps S202 to S204 until the joint training meets the preset termination condition, and the policy function and the entity recognition model converge to an optimal state to obtain a target policy function.
[0088] In the embodiments of the present application, the policy function and the entity recognition model are jointly trained, so that the policy function and the entity recognition model interact and influence each other during training, the policy function is optimized based on the performance identification result of the entity recognition model, the policy function can learn effective strategies more quickly, the convergence speed of the policy function and the accuracy of attribute supplement are improved, the target tuple data obtained by supplementing attributes based on the feature path constructed based on the policy function is used to train the entity recognition model, the accuracy of entity analysis of the entity recognition model is improved, and the robustness of the entity recognition model to data distribution changes is also improved during joint training.
[0089] Referring to Figure 9 FIG. 1 is a flowchart of a data attribute supplement method according to an embodiment of the present application. As shown in Figure 9 The step of optimizing the initial policy function according to the performance identification result in step S801 can include the following steps:
[0090] In step S901, if the performance identification result is greater than a preset second value, a positive reward is given to the initial policy function.
[0091] In step S902, the initial policy function is optimized according to the positive reward and a reinforcement learning algorithm to obtain an updated policy function.
[0092] In the embodiments of the present application, the positive reward can be positive feedback given to the initial policy function, the preset second value can be a value that the performance identification result needs to meet when the positive reward is given, and the reinforcement learning algorithm can be a proximal policy optimization (PPO) algorithm.
[0093] Specifically, after the target feature path is constructed according to the initial strategy function, the attribute and attribute value of the target tuple data in the data set are supplemented to obtain the attribute supplemented data set, and if the performance recognition result (such as F1 score, recall rate and accuracy, etc.) of the entity recognition model after training with the attribute supplemented data set as the training set is greater than a preset second value, it indicates that the attribute supplemented data set by the initial strategy function improves the recognition performance of the entity recognition model, and the initial strategy function is given a positive reward through the reward function, and the initial strategy function is optimized based on the feedback positive reward through the reinforcement learning algorithm to obtain an updated strategy function.
[0094] 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 comprehensively considered to determine whether to give the initial strategy function a positive reward or a negative reward.
[0095] The diversity evaluation can be an evaluation of the difference between 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 (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.
[0096] The integrity evaluation can be an evaluation of how many effective feature values the target feature path can provide for the target tuple data, that is, an 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 returned 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.
[0097] In the embodiment of the application, if the performance of the entity recognition model during the joint training process is greater than the preset second value, the initial strategy function is given a positive reward, which explicitly tells the initial strategy function which behaviors are conducive 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 effective strategies more quickly, improving the convergence speed of the entire learning process. And through the reinforcement learning algorithm, the initial strategy function is updated based on the positive reward, the variance of the strategy function update is reduced through clipping reward, thereby improving the stability and efficiency of the training process.
[0098] Referring to Figure 10 A flowchart of a data attribute supplement method provided by the eighth embodiment of the application is shown in FIG. 8. As shown in FIG. 8, the method includes the following steps. Figure 10As shown, the step S801, according to the performance identification result, the initial strategy function is optimized to obtain an updated strategy function, which can include the following steps:
[0099] Step S1001, if the performance identification result is less than the preset second value, the initial strategy function is given a negative reward.
[0100] Step S1002, according to the negative reward and the reinforcement learning algorithm, the initial strategy function is optimized to obtain an updated strategy function.
[0101] In the embodiment of the application, the negative reward can be a negative feedback given to the initial function.
[0102] Specifically, after the target feature path is constructed according to the initial strategy function, the attribute and attribute value of the target tuple data in the data set are supplemented to obtain the attribute supplemented data set, and if the performance identification result (such as F1 score, recall rate and accuracy, etc.) of the entity recognition model after training with the attribute supplemented data set as the training set is less than the preset second value, it indicates that the attribute supplemented data set by the initial strategy function makes the recognition performance of the entity recognition model decrease, then the initial strategy function is given a negative reward 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.
[0103] 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 identification 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.
[0104] In the embodiment of the application, if the performance of the entity recognition model in the joint training process is less than the preset second value, the initial strategy function is given a negative reward, which explicitly tells the initial strategy function which behaviors are not conducive to achieving the goal, so as to avoid the initial strategy function 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 using 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 the strategy function update through the clipping reward, thereby improving the stability and efficiency of the training process.
[0105] corresponding to the data attribute supplement method of the above embodiment, Figure 11A structural block diagram of a data attribute supplementing apparatus provided by Embodiment Nine of the present application is shown. The data attribute supplementing apparatus is applied to a server in Figure 1 The server is connected with a client to obtain graph data and target tuple data sent by the client. For ease of illustration, only parts related to the embodiments of the present application are shown.
[0106] Referring to Figure 11 The data attribute supplementing apparatus comprises:
[0107] A heterogeneous entity analyzing module 1101 is configured to determine a target node matching an entity corresponding to target tuple data from graph data;
[0108] A constructing module 1102 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;
[0109] A determining module 1103 is configured to determine a feature value corresponding to the target feature path from the graph data as attribute supplementing data of the target tuple data;
[0110] An evaluating module 1104 is configured to train an entity recognition model according to the attribute supplementing data to obtain a trained entity recognition model and obtain a performance recognition result of the trained entity recognition model;
[0111] An optimizing module 1105 is configured to optimize the initial strategy function according to the performance recognition 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 a feature value corresponding to the final feature path as attribute supplementing result of the target tuple data.
[0112] Optionally, the heterogeneous entity analyzing module 1101 comprises:
[0113] A first determining unit is configured to determine feature values of each node in the graph data and determine attribute values of the target tuple data;
[0114] A first forming unit is configured to form all attribute values in the target tuple data into an attribute value set, determine a first sub-graph data corresponding to any node in the graph data, and form feature values of all nodes in the first sub-graph data into a feature value set;
[0115] The first calculation unit is configured to calculate an intersection of the set of feature values and the set of attribute values, and calculate a union of the set of feature values and the set of attribute values, take a ratio of the intersection to the union as a first similarity value of the node and the target tuple data, and determine a candidate node matched with the target tuple data entity according to the first similarity value of all nodes in the graph data and a preset threshold value.
[0116] The second determination unit is configured to filter the candidate nodes according to the feature vector of the candidate node and the attribute vector of the target tuple data, and obtain the target node.
[0117] Optionally, the second determination unit comprises:
[0118] The vectorization subunit is configured to vectorize all attribute values in the target tuple data to obtain an attribute vector, determine, for any candidate node, a 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 determine, for any candidate node, a second subgraph data corresponding to the candidate node.
[0119] The third determination subunit is configured to calculate a second similarity value of the feature vector and the attribute vector, sort second similarity values corresponding to all candidate nodes to obtain the target node.
[0120] Optionally, the construction module 1102 comprises:
[0121] The fourth determination unit is configured to determine an attribute and an 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.
[0122] 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.
[0123] 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 to obtain an updated feature path.
[0124] The first loop unit is configured to take the updated feature path as the initial feature path, return to perform the step of inputting the initial feature path into the initial policy function until a quantity of feature values corresponding to the updated feature path satisfies a preset first value, and obtain the target feature path.
[0125] Optionally, the optimization module 1105 comprises:
[0126] The first update unit is configured to optimize the initial policy function according to the performance identification result to obtain an updated policy function.
[0127] a second loop unit, configured to return to performing the step of using the initial policy function until the updated policy function meets a preset termination condition, to obtain the target policy function, with the updated policy function as the initial policy function.
[0128] Optionally, the first updating unit comprises:
[0129] a positive reward sub-unit, configured to give the initial policy function a positive reward if the performance identification result is greater than a preset second value;
[0130] a second updating sub-unit, configured to optimize the initial policy function according to the positive reward and a reinforcement learning algorithm, to obtain the updated policy function.
[0131] Optionally, the first updating unit comprises:
[0132] a negative reward sub-unit, configured to give the initial policy function a negative reward if the performance identification result is less than a preset second value;
[0133] a third updating sub-unit, configured to optimize the initial policy function according to the negative reward and a reinforcement learning algorithm, to obtain the updated policy function.
[0134] It should be noted that the information interaction between the above modules, the execution process and the like, since based on the same concept as the method embodiments of the present application, the specific functions and the technical effects brought by them can be referred to the method embodiments part, and will not be repeated here.
[0135] Figure 12 A structural schematic diagram of a computer device is provided for the tenth embodiment of the present application. As shown in the figure, Figure 12 the computer device of this embodiment comprises at least one processor (only one is shown in the figure), a memory, and a computer program stored in the memory and executable on the at least one processor, and the processor executes the computer program to implement the steps in any of the above data attribute supplement method embodiments. Figure 12
[0136] The computer device can include, but is not limited to, a processor and a memory. Those skilled in the art can understand, Figure 12 is merely an example of the computer device and does not constitute a limitation on the computer device. The computer device can include more or fewer components than those shown, or combine certain components, or include different components, for example, it can also include a network interface, a display screen, and an input device, etc.
[0137] The processor can be a CPU, and can also be other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0138] The memory includes a readable storage medium, an internal memory, etc., where the internal memory can be a memory of the computer device, and the internal memory provides an environment for running the operating system and the computer-readable instructions in the readable storage medium. The readable storage medium can be a hard disk of the computer device, and in other embodiments, can also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory can include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a BootLoader, data, and other programs, such as program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.
[0139] 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. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here. If the integrated unit is realized in the form of software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of the above method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device that can carry computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer readable medium cannot be electrical carrier signal and telecommunication signal.
[0140] The above embodiment methods can also be completed by a computer program product, which can be run on a computer device to make the computer device execute the steps of the above method embodiments.
[0141] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.
[0142] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0143] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.
[0144] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0145] The above embodiments are only used to illustrate the technical solutions of the present application, but not limit it; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make 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 supplementation method, characterized in that: The data attribute supplementation method includes: Determine a target node from the graph data that matches the entity corresponding to the target tuple data; Using an initial strategy function, supplementing the characteristic path of the target node in the graph data to obtain a target characteristic path; Determine from the graph data the characteristic value corresponding to the target characteristic path as attribute supplementary data of the target tuple data; Training an entity recognition model according to the attribute supplementary data to obtain a trained entity recognition model, and obtaining a performance recognition result of the trained entity recognition model; According to the performance identification result, the initial strategy function is optimized to obtain a target strategy function, the target strategy function is used to perform path supplementation on the characteristic path of the target node to obtain a final characteristic path, and the characteristic value corresponding to the final characteristic path is determined to be the attribute supplementation result of the target tuple data; Optimizing the initial strategy function according to the performance identification result to obtain a target strategy function includes: Optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function; Using the updated policy function as the initial policy function, returning to the step of using the initial policy function until the updated policy function satisfies a preset termination condition, thereby obtaining the target policy function; Optimizing the initial strategy function according to the performance identification result to obtain an updated strategy function includes: If the performance identification result is greater than a preset second value, a positive reward is given to the initial strategy function; Optimizing the initial policy function according to the positive reward and reinforcement learning algorithm to obtain the updated policy function; The step of optimizing the initial policy function according to the performance identification result to obtain an updated policy function further includes: If the performance identification result is less than a preset second value, a negative reward is given to the initial strategy function; Optimizing the initial policy function according to the negative reward and reinforcement learning algorithm to obtain the updated policy function; The step of determining a target node that matches an entity corresponding to the target tuple data from the graph data includes: Determining a characteristic value of each node in the graph data, and determining an 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, first subgraph data corresponding to the node is determined, and feature values of all nodes in the first subgraph data are formed into a feature value set; Calculating the intersection of the feature value set and the attribute value set, and calculating the union of the feature value set and the attribute value set, taking the ratio of the intersection to the union as the first similarity value between the node and the target tuple data, and determining a candidate node that matches the target tuple data entity based on the first similarity values of all nodes in the graph data and a preset threshold; Screening the candidate nodes according to the feature vectors of the candidate nodes and the attribute vectors of the target tuple data to obtain the target node; The step of screening the candidate nodes according to the feature vectors of the candidate nodes and the attribute vectors of the target tuple data to obtain the target node includes: Vectorizing all attribute values in the target tuple data to obtain an attribute vector, determining, for any candidate node, second subgraph data corresponding to the candidate node, and vectorizing the feature values of all nodes in the second subgraph data to obtain a feature vector; A second similarity value between the feature vector and the attribute vector is calculated, and the second similarity values corresponding to all candidate nodes are sorted to obtain the target node.
2. The data attribute supplementation method according to claim 1, characterized in that: The using of the initial strategy function to supplement the characteristic path of the target node in the graph data to obtain the target characteristic path includes: Determining attributes and attribute values of the target tuple data, and determining an initial feature path with the target node as a starting point based on the attributes and the attribute values; Inputting the initial characteristic path into the initial strategy function to obtain an action probability distribution under the initial characteristic path state; According to the action probability distribution, the characteristic path of the target node in the graph data is supplemented to obtain an updated characteristic path; Taking the updated feature path as the initial feature path, return to 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 the preset first value, thereby obtaining the target feature path.
3. A data attribute supplement device, characterized in that: The data attribute supplementing device includes: Heterogeneous entity resolution module, used to determine the target node that matches the entity corresponding to the target tuple data from the graph data; A construction module is used to use an initial strategy function to supplement the characteristic path of the target node in the graph data to obtain a target characteristic path; A determination module, configured to determine, from the graph data, a feature value corresponding to the target feature path as attribute supplementary data of the target tuple data; An evaluation module is used to train the entity recognition model based on the attribute supplementary data to obtain a trained entity recognition model and acquire a performance recognition result of the trained entity recognition model; An optimization module is configured to optimize the initial strategy function according to the performance identification result to obtain a target strategy function, use the target strategy function to perform path supplementation on the characteristic path of the target node to obtain a final characteristic path, and determine that the characteristic value corresponding to the final characteristic path is an attribute supplementation result of the target tuple data; The optimization module includes: a first updating unit, configured to optimize the initial policy function according to the performance identification result to obtain an updated policy function; a second loop unit, configured to use the updated policy function as the initial policy function, return to the step of using the initial policy function, and obtain the target policy function by satisfying a preset termination condition; The first updating unit includes: a positive reward subunit, configured to give a positive reward to the initial strategy function if the performance recognition result is greater than a preset second value; A second updating subunit, configured to optimize the initial policy function according to the positive reward and reinforcement learning algorithm to obtain the updated policy function; The first updating unit further includes: a negative reward subunit, configured to give a negative reward to the initial strategy function if the performance recognition result is less than a preset second value; A third updating subunit is configured to optimize the initial policy function according to the negative reward and reinforcement learning algorithm to obtain the updated policy function; The heterogeneous entity resolution module includes: a first determining unit, configured to determine a feature value of each node in the graph data, and determine an attribute value of the target tuple data; a first forming unit, configured to form an attribute value set from all attribute values in the target tuple data, determine, for any node in the graph data, first subgraph data corresponding to the node, and form a feature value set from the feature values of all nodes in the first subgraph data; a first calculation unit, configured to calculate an intersection of the feature value set and the attribute value set, and calculate a union of the feature value set and the attribute value set, use a ratio of the intersection to the union as a first similarity value between the node and the target tuple data, and determine a candidate node that matches the target tuple data entity based on the first similarity values of all nodes in the graph data and a preset threshold; a second determining unit, configured to screen the candidate nodes according to the feature vectors of the candidate nodes and the attribute vectors of the target tuple data to obtain the target node; The second determining unit includes: a vectorization subunit, configured to 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, and vectorize the feature values of all nodes in the second subgraph data to obtain a feature vector; The third determining subunit is configured to calculate a second similarity value between the feature vector and the attribute vector, and sort the second similarity values corresponding to all candidate nodes to obtain the target node.
4. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the data attribute supplementation method according to any one of claims 1 to 2 is implemented.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data attribute supplement method according to any one of claims 1 to 2 is implemented.