Network search data query method and system
By incorporating a fusion offset control module based on multi-angle representation learning and reinforcement learning, the problem of not distinguishing between known and unknown fusionable entity neighbor information in existing technologies is solved, thereby improving the accuracy of knowledge graph fusion and the effectiveness of network search, while reducing labor costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU KANGSHENG HEALTH CONSULTING CO LTD
- Filing Date
- 2023-06-27
- Publication Date
- 2026-04-21
AI Technical Summary
Existing knowledge graph fusion methods based on representation learning treat all nodes "equally" when representing the knowledge graph, without considering the distinction between known and unknown entities that can be fused, resulting in poor fusion performance and reduced accuracy of web search results.
By merging existing knowledge graphs into a larger knowledge graph, a multi-angle representation learning method is adopted to distinguish between known and unknown fusionable entity neighbor information. A gating mechanism and a reinforcement learning fusion offset control module are used to filter credible fusion entity pairs until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated.
It improves the accuracy of web search, reduces the need for manual annotation, lowers the cost of building target knowledge graphs, and alleviates the fusion offset problem.
Smart Images

Figure CN116701743B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data mining technology, specifically to a method and system for querying web search data. Background Technology
[0002] A search engine is a system that uses specific computer programs and strategies to collect information from the internet, organizes and processes the information, and then provides users with retrieval services, displaying the retrieved information to them. A knowledge graph, composed of triples in the form of <head entity, relation, tail entity>, can organize knowledge from massive amounts of data in a graph-like manner, providing data support for search engines. Merging knowledge graphs from two different data sources to form a larger knowledge graph can accelerate the knowledge graph construction process.
[0003] Early knowledge graph fusion methods primarily used crowdsourcing to manually label pairs of entities with the same meaning (fusionable entity pairs) within the knowledge graph. As the scale of knowledge graphs continues to expand, manual labeling becomes both time-consuming and labor-intensive. Automatically mining equivalent entity pairs from knowledge graphs has become a crucial step in constructing fused knowledge graphs. However, existing representation learning-based knowledge fusion methods treat all nodes "equally" when representing the knowledge graph, failing to consider the distinction between known and unknown fusionable entities. This results in poor fusion performance and reduced accuracy of web search results. Summary of the Invention
[0004] This invention proposes a method and system for querying web search data, which solves the problem of poor accuracy of web search results in related technologies.
[0005] The technical solution of the present invention is as follows:
[0006] Firstly, methods for querying data via web search include:
[0007] Obtain the search keywords entered by the user;
[0008] Based on the search keywords, retrieve information and data from the target knowledge graph and return the query results;
[0009] The target knowledge graph is obtained by fusing two existing knowledge graphs; the fusion process includes:
[0010] Obtain the set of known fusionable entity pairs;
[0011] Using the known set of fusionable entity pairs as the seed set, a multi-angle representation step is performed, representing the knowledge graph from three perspectives. Any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and ;
[0012] The implicit vector representation of any entity i is obtained using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation ;
[0013] According to the first of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are used as candidate fusion entity pairs, and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module.
[0014] The reinforcement learning agent selects trustworthy fusion entity pairs from candidate fusion entity pairs and adds them to the seed set;
[0015] Repeat the multi-angle representation steps until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated;
[0016] Wherein, any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and Specifically, it includes:
[0017]
[0018] in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization;
[0019]
[0020] in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0021]
[0022]
[0023] in, , Let be the weight matrix, and ;
[0024]
[0025] in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0026]
[0027]
[0028] Secondly, the online search data query system includes:
[0029] The acquisition unit is used to obtain the search keywords entered by the user;
[0030] The search unit is used to query information data from the target knowledge graph based on search keywords and return the query results;
[0031] An iterative fusion entity pair filtering module is used for:
[0032] Obtain the set of known fusionable entity pairs;
[0033] Using the known set of fusionable entity pairs as the seed set, a multi-angle representation step is performed, representing the knowledge graph from three perspectives. Any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and ;
[0034] The implicit vector representation of any entity i is obtained using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation ;
[0035] According to the first of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are used as candidate fusion entity pairs, and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module.
[0036] After the reinforcement learning agent selects credible fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set, the multi-angle representation step is re-executed until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated.
[0037] Wherein, any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and Specifically, it includes:
[0038]
[0039] in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization;
[0040]
[0041] in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0042]
[0043]
[0044] in, , Let be the weight matrix, and ;
[0045]
[0046] in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0047]
[0048]
[0049] The working principle and beneficial effects of this invention are as follows:
[0050] This invention merges existing knowledge graphs into a larger knowledge graph, using the merged graph as the target knowledge graph. This merged graph contains more and richer data, providing more accurate data support for web search. Furthermore, when merging existing knowledge graphs, it considers that new merging entities are more likely to appear around known merging entities. That is, for an entity, its known merging neighbors have a more significant impact on the merging process. Therefore, its neighbors are treated differently based on whether they are known to be merging, in order to better design the graph representation method for the merging task.
[0051] Specifically, the known set of fusionable entity pairs is first used as a seed set. Then, knowledge graph representation is performed from three perspectives: first, a graph representation based on graph neural networks to capture the overall topological information of the knowledge graph; second, a graph representation based on an attention mechanism to capture the topological information of the known fusionable entity neighbors; and third, a graph representation also based on an attention mechanism to capture the topological information of the unknown fusionable entity neighbors. Finally, a gating mechanism is used to integrate the representations from these three perspectives to obtain the final knowledge graph representation. Then, candidate fusion entity pairs are selected by calculating the similarity (distance) of the entity representations in the knowledge graph, with those having a similarity higher than a threshold being selected. The entity pairs are selected as candidate fusion entity pairs and passed as state to the reinforcement learning-based fusion offset control module. The reinforcement learning agent selects credible fusion entity pairs from the candidates and adds them to the seed set for the next round of iteration, until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated.
[0052] This invention eliminates the need for large amounts of manually annotated corpora and mitigates the fusion offset problem during iterative fusion, enabling the construction of target knowledge graphs with lower human costs. Furthermore, the accuracy of web searches based on this target knowledge graph is significantly improved. Attached Figure Description
[0053] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0054] Figure 1 This is a block diagram illustrating the principle of the iterative fusion entity pair filtering module in this invention. Detailed Implementation
[0055] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0056] Example 1
[0057] This embodiment proposes a method for querying network search data, including:
[0058] S100: Obtain the search keywords entered by the user;
[0059] S200: Based on the search keywords, retrieve information data from the target knowledge graph and return the query results;
[0060] The target knowledge graph is obtained by fusing two existing knowledge graphs. The existing knowledge graph is constructed in advance based on information related to the network search scenario in this embodiment. For example, for a medical network search scenario, a knowledge graph can be constructed based on information in the medical field. This is common knowledge in the field and will not be elaborated here.
[0061] The knowledge graph fusion process includes:
[0062] S210: Obtain the set of known fusionable entity pairs.
[0063] In this embodiment, a small number of fusionable entity pairs can be manually labeled as a known set of fusionable entity pairs.
[0064] S220: Using the known set of fusionable entity pairs as the seed set, perform the multi-angle representation step, representing the knowledge graph from three angles respectively, and representing any entity i as the first entity obtained by integrating its neighbor information. Hidden vectors , and .
[0065] Knowledge graph representation is performed from three perspectives: first, graph representation based on graph neural networks, used to capture the overall topological information of the knowledge graph; second, graph representation based on attention mechanisms, used to capture the topological information of known fusionable entity neighbors; and third, graph representation also based on attention mechanisms, used to capture the topological information of unknown fusionable entity neighbors. Finally, a gating mechanism is used to integrate the representations from these three perspectives to obtain the final knowledge graph representation. The representation process is as follows:
[0066] S221: Topological information representation of the entire graph
[0067]
[0068] in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization;
[0069] S222: Topological information of entities whose neighbors can be merged is known.
[0070]
[0071] in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0072]
[0073]
[0074] in, , Let be the weight matrix, and ;
[0075] S223: Topological information of unknown fusionable entity neighbors
[0076]
[0077] in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0078]
[0079]
[0080] S230: Use a gating mechanism to represent the implicit vector of any entity i. , and Integrate to obtain the entity The Hidden Vector Representation .
[0081] S240: Based on the first... of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are selected as candidate fusion entity pairs, and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module.
[0082] This embodiment takes into account that new fusionable entities are more likely to appear around known fusionable entities. That is, for an entity, its known fusionable neighbors will have a more significant impact on its fusion process. Therefore, its neighbors are treated differently based on whether they are known to be fusionable, so as to better design a graph representation method for the fusion task.
[0083] Because the fusion process suffers from the "fusion drift" problem, where the candidate fusion entity pairs found during the fusion process deviate from the direction of the initially given seed, this embodiment models the seed expansion problem as a sequence decision problem, thereby introducing reinforcement learning to alleviate the problem.
[0084] S250: The reinforcement learning agent selects trustworthy fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set;
[0085] S260: Re-execute the multi-angle representation steps until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated.
[0086] This embodiment does not require a large amount of manually annotated corpus and alleviates the fusion offset problem in the iterative fusion process, enabling the construction of target knowledge graphs with less manpower.
[0087] Furthermore, the implicit vector representation of any entity i is obtained by using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation Specifically, it includes:
[0088]
[0089]
[0090]
[0091]
[0092] in, and It acts as a gating mechanism to control the integration of the three representations. It is a weight matrix. It is the bias vector.
[0093] This embodiment ultimately calculates the loss function Loss by minimizing the representation distance of fusionable entities and maximizing the representation distance of non-fusionable entities, thus performing knowledge graph representation.
[0094]
[0095]
[0096] in, Represents the seed set, This represents the set of negative samples formed by randomly replacing one of the entities in the seed set. express Vector normalization, For use as a weighted hyperparameter; This indicates that the formula for calculating the loss function (Loss) mentioned above is being used. The second term of the loss function is required to be no less than 0 to avoid focusing the entire loss function on incompatible entity pairs. The key is to ensure that incompatible entity pairs represent the same thing.
[0097] S270: Perform knowledge graph fusion based on the fusion entity pairs in the seed set.
[0098] Furthermore, the first [unclear] based on any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, specifically including:
[0099]
[0100] in, express Vector normalization.
[0101] Furthermore, in reinforcement learning, policy-based agents learn to select promising new seeds by interacting with an iterative fusion process. This interaction between the agent and the iterative fusion process is modeled as a Markov Decision Process (MDP). A Markov Decision Process is represented by a quintuple. ,in It is a continuous state space. It is the set of all possible actions. It is the transition probability matrix. It is each The correct reward function.
[0102] In this embodiment, the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module. The reinforcement learning agent selects trustworthy fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set. Specifically, this includes:
[0103] (1) State
[0104] Obtain the similarity of the candidate fusion entity pairs to form a state vector. ;in, The maximum length is set. Indicates the first The similarity of candidate fusion entity pairs, if the total number of matched candidate fusion entity pairs in the current round exceeds Then, extract the parts with the highest similarity. If there are insufficient candidate fusion entity pairs If the similarity is 0, then the corresponding similarity is 0.
[0105] (2) Actions
[0106] Given all candidate instances for the current round, the AI will select candidate instances to add to the seed set based on its current state. The size of the operation space is the maximum number of candidate instances. Each dimension has a value of 1 or 0. 1 indicates that the candidate instance corresponding to that dimension position has been selected and added to the seed set, while 0 indicates that the candidate instance corresponding to that dimension position has not been selected and added to the seed set.
[0107] More specifically, the reinforcement learning agent, based on the current state vector Make an action:
[0108]
[0109] in Indicates the first Whether to add each candidate fusion entity pair to the seed set, if Then add the first Each candidate fusion entity pair is added to the seed set as a new seed for the next iteration. Then do not add the first Each candidate fusion entity pair is added to the seed set as a new seed.
[0110] (3) Rewards
[0111] The reward function encourages reinforcement learning agents to select more reliable, more numerous, and more diverse candidate instances. The reward function formula is as follows:
[0112]
[0113]
[0114]
[0115]
[0116] in, The agent determines the set of fused entity pairs to add to the seed set. The number of fused entity pairs in this set. It is the set of all candidate fusion entity pairs found in the current round. It is the number of candidate fusion entity pairs in this set. For entities With entity The distance between them is calculated using cosine distance;
[0117] (4) Policy Network
[0118] This embodiment utilizes a fully connected neural network to integrate the policy function. Parameterization, the state vector Mapped to the probability distribution of all possible actions. These are the action and state vectors obtained during this iteration. The neural network consists of two hidden layers, each followed by a non-linear activation function (ReLU), and the output layer is normalized using the softmax function.
[0119] During the training phase, given a seed set One fusion process constitutes one parameter optimization cycle. In each iteration, the candidate instances obtained form the current state. The agent selects a new seed from these candidate instances according to a random strategy. The seed set is expanded to begin the next iteration until no new seeds need to be added. To improve training efficiency, this embodiment sets a maximum number of iterations, denoted as . Using Monte Carlo policy gradients (REINFORCEMENT) to adjust parameters To maximize the expected cumulative return, an update is performed. The approximate gradient used to update the policy network is shown below:
[0120]
[0121] in, For the final reward value, the parameter Use the Adam optimizer for optimization.
[0122] By comparing existing methods that have achieved advanced results, such as four tuple-based methods (MTransE, AlignE, BootE, and SEA), two path-based methods (IPTransE and RSN4EA), and four neighbor-based methods (GCNAlign, AliNet, HyperKA, and KE-GCN), it can be determined that the network search data query method in our embodiment has advantages in knowledge graph construction with low human cost.
[0123] We use the benchmark dataset released by the OpenEA library for evaluation. This dataset tracks the distribution of real-world knowledge graph data and includes two cross-lingual settings (English-French and English-German) and two monolingual settings (DBpedia-Wikidata and DBpedia-YAGO). Each setting has two sizes, with 15K and 100K pairs of reference fusion entities, respectively. Furthermore, this experiment follows OpenEA's dataset splitting method, using 20% of the reference fusion entities for training, 10% for validation, and 70% for testing.
[0124] Next, this embodiment selects three mainstream knowledge fusion algorithms as the baseline algorithms for comparison. An overview of each baseline algorithm is as follows:
[0125] (1) Tuple-based algorithms: This type of algorithm captures the local semantic information of relation triples based on the TansE model. Specific algorithms include MTransE, AlignE, BootEA and SEA.
[0126] (2) Path-based algorithms: These algorithms explore long-distance relational dependencies through relational paths. Specific algorithms include IPTransE and RSN4EA.
[0127] (3) Neighbor-based algorithms: This type of algorithm uses graph neural networks to explore subgraph structure information. Specific algorithms include GCNAlign, AliNet, HyperKA and KE-GCN.
[0128] Similar to other recent related works, we use Hit@k and MRR as evaluation metrics. Hit@k measures the proportion of entity pairs that can actually be fused among the top k candidate fusion entity pairs, and MRR is the average reciprocal ranking. Higher Hit@5 and Hit@1 as well as higher MRR indicate better knowledge fusion results.
[0129] The following analysis compares the Hit@k and MRR experimental results of the NETTING method in this embodiment with those of existing state-of-the-art methods to illustrate the effectiveness and performance of the NETTING method in this embodiment. The experimental results of the NETTING method in this embodiment on the knowledge fusion task based on two datasets, 15K (EN-FR-15K, EN-DE-15K, DW-15K) and 100K (EN-FR-100K, EN-DE-100K, DW-100K), are shown in Tables 1 and 2 below:
[0130] Table 1. Experimental Results of Knowledge Fusion on the 15K Dataset
[0131]
[0132]
[0133] Table 2. Experimental Results of Knowledge Fusion on the 100K Dataset
[0134] As shown in the table above, for knowledge fusion tasks, the network search data query method proposed in this embodiment shows improvements to varying degrees across multiple evaluation metrics compared to other comparative algorithms. The main reason for this is that this embodiment differentiates between different types of neighbor information in the knowledge graph representation. Based on global topological information, it emphasizes known fusionable entity neighbor information, allowing for more comprehensive utilization of seed information. Furthermore, it introduces reinforcement learning to select seeds from a global perspective, avoiding the greedy strategy of directly selecting seeds based on similarity in each round, which could cause the iteration process to deviate from the initial direction. Experimental results demonstrate the effectiveness of the proposed method.
[0135] Example 2
[0136] Based on the same inventive concept as Embodiment 1 above, this embodiment proposes a web search data query system, including:
[0137] The acquisition unit is used to obtain the search keywords entered by the user;
[0138] The search unit is used to query information data from the target knowledge graph based on search keywords and return the query results;
[0139] An iterative fusion entity pair filtering module is used for:
[0140] Obtain the set of known fusionable entity pairs;
[0141] Using the known set of fusionable entity pairs as the seed set, a multi-angle representation step is performed, representing the knowledge graph from three perspectives. Any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and ;
[0142] The implicit vector representation of any entity i is obtained using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation ;
[0143] According to the first of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are used as candidate fusion entity pairs (candidate instances), and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module.
[0144] After the reinforcement learning agent selects credible fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set, the multi-angle representation step is re-executed until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated.
[0145] Wherein, any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and Specifically, it includes:
[0146]
[0147] in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization;
[0148]
[0149] in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0150]
[0151]
[0152] in, , Let be the weight matrix, and ;
[0153]
[0154] in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows:
[0155]
[0156]
[0157] Furthermore, the implicit vector representation of any entity i is obtained by using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation Specifically, it includes:
[0158]
[0159]
[0160]
[0161]
[0162] in, and It acts as a gating mechanism to control the integration of the three representations. It is a weight matrix. It is the bias vector.
[0163] Furthermore, the first [unclear] based on any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, specifically including:
[0164]
[0165] in, express Vector normalization.
[0166] Furthermore, such as Figure 1 As shown, the candidate fusion entity pairs are input as state to the reinforcement learning-based fusion offset control module. The reinforcement learning agent selects trustworthy fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set. Specifically, this includes:
[0167] Obtain the similarity of the candidate fusion entity pairs to form a state vector. ;in, The maximum length is set. Indicates the first The similarity of candidate fusion entity pairs, if the total number of matched candidate fusion entity pairs in the current round exceeds Then, extract the parts with the highest similarity. If there are insufficient candidate fusion entity pairs If the similarity is 0, then the corresponding similarity is 0.
[0168] The reinforcement learning agent bases its actions on the current state vector. Make an action:
[0169]
[0170] in Indicates the first Whether to add each candidate fusion entity pair to the seed set, if Then add the first Each candidate fusion entity pair is added to the seed set as a new seed for the next iteration. Then do not add the first Each candidate fusion entity pair is added to the seed set as a new seed;
[0171] Based on the reward function, reinforcement learning agents are encouraged to select more reliable, more numerous, and more diverse candidate fusion entity pairs. The reward function formula is as follows:
[0172]
[0173]
[0174]
[0175]
[0176] in, The agent determines the set of fused entity pairs to add to the seed set. The number of fused entity pairs in this set. It is the set of all candidate fusion entity pairs found in the current round. It is the number of candidate fusion entity pairs in this set. For entities With entity The distance between them is calculated using cosine distance;
[0177] Using a fully connected neural network to convert the policy function Parameterization, the state vector The probability distribution mapped to all possible actions; These are the action and state vectors obtained during this iteration;
[0178] Using Monte Carlo policy gradients to adjust parameters The update maximizes the expected cumulative return and is used to update the approximate gradient of the policy network.
[0179]
[0180] in, For the final reward value, the parameter Use the Adam optimizer for optimization.
[0181] The working principle of the system in this embodiment has been described in detail in the method embodiment, and will not be repeated here for the sake of brevity.
[0182] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for querying data via web search, characterized in that, include: Obtain the search keywords entered by the user; Based on the search keywords, retrieve information and data from the target knowledge graph and return the query results; The target knowledge graph is obtained by fusing two existing knowledge graphs; The fusion process includes: Obtain the set of known fusionable entity pairs; Using the known set of fusionable entity pairs as the seed set, a multi-angle representation step is performed, representing the knowledge graph from three perspectives. Any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and ; The implicit vector representation of any entity i is obtained using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation ; According to the first of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are used as candidate fusion entity pairs, and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module. The reinforcement learning agent selects trustworthy fusion entity pairs from candidate fusion entity pairs and adds them to the seed set; Repeat the multi-angle representation steps until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated; Knowledge graph fusion is performed based on the fusion entity pairs in the seed set; The knowledge graph representation is performed from three perspectives: first, graph representation based on graph neural networks, which is used to capture the overall topological information of the knowledge graph; second, graph representation based on attention mechanism, which is used to capture the topological information of known fusionable entity neighbors; and third, graph representation based on attention mechanism, which is used to capture the topological information of unknown fusionable entity neighbors. The statement that any entity i is represented as a first entity derived from its neighbor information is... Hidden vectors , and Specifically, it includes: in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization; in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows: in, , Let be the weight matrix, and ; in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows: 。 2. The network search data query method according to claim 1, characterized in that, The implicit vector representation of any entity i using a gating mechanism , and Integrate to obtain the entity The Hidden Vector Representation Specifically, it includes: in, and It acts as a gating mechanism to control the integration of the three representations. It is a weight matrix. It is the bias vector.
3. The network search data query method according to claim 1, characterized in that, The first according to any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, specifically including: in, express Vector normalization.
4. The network search data query method according to claim 1, characterized in that, The candidate fusion entity pairs are input as state to the reinforcement learning-based fusion offset control module, whereby the reinforcement learning agent selects trustworthy fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set. Specifically, this includes: Obtain the similarity of the candidate fusion entity pairs to form a state vector. ;in, The maximum length is set. Indicates the first The similarity of candidate fusion entity pairs, if the total number of matched candidate fusion entity pairs in the current round exceeds Then, extract the parts with the highest similarity. If there are insufficient candidate fusion entity pairs If the similarity is 0, then the corresponding similarity is 0. The reinforcement learning agent bases its actions on the current state vector. Make an action: in Indicates the first Whether to add each candidate fusion entity pair to the seed set, if Then add the first Each candidate fusion entity pair is added to the seed set as a new seed for the next iteration. Then do not add the first Each candidate fusion entity pair is added to the seed set as a new seed; Based on the reward function, reinforcement learning agents are encouraged to select more reliable, more numerous, and more diverse candidate fusion entity pairs. The reward function formula is as follows: in, The agent determines the set of fused entity pairs to add to the seed set. The number of fused entity pairs in this set. It is the set of all candidate fusion entity pairs found in the current round. It is the number of candidate fusion entity pairs in this set. For entities With entity The distance between them is calculated using cosine distance; Using a fully connected neural network to convert the policy function Parameterization, the state vector The probability distribution mapped to all possible actions; These are the action and state vectors obtained during this iteration; Using Monte Carlo policy gradients to adjust parameters The update maximizes the expected cumulative return and is used to update the approximate gradient of the policy network. in, For the final reward value, the parameter Use the Adam optimizer for optimization.
5. A web search data query system, characterized in that, include: The acquisition unit is used to obtain the search keywords entered by the user; The search unit is used to query information data from the target knowledge graph based on search keywords and return the query results; An iterative fusion entity pair filtering module is used for: Obtain the set of known fusionable entity pairs; Using the known set of fusionable entity pairs as the seed set, a multi-angle representation step is performed, representing the knowledge graph from three perspectives. Any entity i is represented as the first entity obtained by integrating its neighbor information. Hidden vectors , and ; The implicit vector representation of any entity i is obtained using a gating mechanism. , and Integrate to obtain the entity The Hidden Vector Representation ; According to the first of any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, where the distance characterizes the similarity between entity i and entity j; entities with similarity values exceeding a threshold are considered... The entity pairs are used as candidate fusion entity pairs, and the candidate fusion entity pairs are used as state inputs to the reinforcement learning-based fusion offset control module. After the reinforcement learning agent selects credible fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set, the multi-angle representation step is re-executed until the maximum number of iterations is reached or no new candidate fusion entity pairs are generated. The knowledge graph representation is performed from three perspectives: first, graph representation based on graph neural networks, which is used to capture the overall topological information of the knowledge graph; second, graph representation based on attention mechanism, which is used to capture the topological information of known fusionable entity neighbors; and third, graph representation based on attention mechanism, which is used to capture the topological information of unknown fusionable entity neighbors. The statement that any entity i is represented as a first entity derived from its neighbor information is... Hidden vectors , and Specifically, it includes: in, Represents the set of all neighbors of entity i. Indicates the first The weight matrix of the layer, Represents the normalization constant. Let represent the activation function, and let be the input vector of the first layer. ,initial Obtained through random initialization; in, Let represent the set of known fusionable neighbors of entity i. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows: in, , Let be the weight matrix, and ; in, Let represent the set of unknown, fusionable neighbors of a given entity. Indicates the first The weight matrix of the layer, Let represent the activation function, and let be the input vector of the first layer. , It is a physical entity with his neighbors The learnable attention weights are calculated as follows: 。 6. The network search data query system according to claim 5, characterized in that, The implicit vector representation of any entity i using a gating mechanism , and Integrate to obtain the entity The Hidden Vector Representation Specifically, it includes: in, and It acts as a gating mechanism to control the integration of the three representations. It is a weight matrix. It is the bias vector.
7. The network search data query system according to claim 5, characterized in that, The first according to any entity i Hidden Vector Representation , and the first of any entity j Hidden Vector Representation Calculate the distance between entity i and entity j, specifically including: in, express Vector normalization.
8. The network search data query system according to claim 5, characterized in that, The candidate fusion entity pairs are input as state to the reinforcement learning-based fusion offset control module, whereby the reinforcement learning agent selects trustworthy fusion entity pairs from the candidate fusion entity pairs and adds them to the seed set. Specifically, this includes: Obtain the similarity of the candidate fusion entity pairs to form a state vector. ;in, The maximum length is set. Indicates the first The similarity of candidate fusion entity pairs, if the total number of matched candidate fusion entity pairs in the current round exceeds Then, extract the parts with the highest similarity. If there are insufficient candidate fusion entity pairs If the similarity is 0, then the corresponding similarity is 0. The reinforcement learning agent bases its actions on the current state vector. Make an action: in Indicates the first Whether to add each candidate fusion entity pair to the seed set, if Then add the first Each candidate fusion entity pair is added to the seed set as a new seed for the next iteration. Then do not add the first Each candidate fusion entity pair is added to the seed set as a new seed; Based on the reward function, reinforcement learning agents are encouraged to select more reliable, more numerous, and more diverse candidate fusion entity pairs. The reward function formula is as follows: in, The agent determines the set of fused entity pairs to add to the seed set. The number of fused entity pairs in this set. It is the set of all candidate fusion entity pairs found in the current round. It is the number of candidate fusion entity pairs in this set. For entities With entity The distance between them is calculated using cosine distance; Using a fully connected neural network to convert the policy function Parameterization, the state vector The probability distribution mapped to all possible actions; These are the action and state vectors obtained during this iteration; Using Monte Carlo policy gradients to adjust parameters The update maximizes the expected cumulative return and is used to update the approximate gradient of the policy network. in, For the final reward value, the parameter Use the Adam optimizer for optimization.
Citation Information
Patent Citations
Collaborative iteration joint entity alignment method and device based on translation model
CN110188206A
Unsupervised knowledge graph entity alignment method and equipment
CN112948597A