Semantic position retrieval method, system and equipment based on deep clustering and medium
Through deep clustering and Skyline semantic location retrieval methods, the problem of too large candidate entity sets in the knowledge graph is solved, efficient semantic location retrieval is achieved, and retrieval efficiency and performance are improved.
Patent Information
- Application Number
- CN202410743728.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-10
AI Technical Summary
Keyword search methods in existing knowledge graphs still need to traverse a large number of candidate entities online during retrieval, resulting in low efficiency. Especially in large-scale knowledge graphs, it is difficult to effectively reduce the size of the candidate set.
A semantic location retrieval method based on deep clustering is adopted to extract the spatial and semantic information of knowledge graph entities, use a spatial entity encoder to encode them into embedding vectors, and use the cascaded twin neural network framework for deep clustering, combined with Skyline Semantic location retrieval methods reduce the size of the candidate set.
It significantly improves retrieval efficiency, reduces the need for online traversal, improves search performance on large-scale knowledge graphs, and can quickly return Top-k results with location information.
Smart Images

Figure CN118627607A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph spatial data retrieval, and in particular to a semantic location retrieval method, system, device and medium based on deep clustering. Background Art
[0002] Knowledge graphs are usually composed of entities (such as people, organizations, places, etc.) and relationships connecting entities (such as born in, studied in, etc.). These entities and relationships in existing knowledge graphs have been further enriched, and time and space information has been supplemented. For example, YAGO2 expands the dimensions of space and time based on YAGO. This expansion of spatiotemporal information makes complex search and analysis based on knowledge graphs possible. Keyword search on such knowledge graphs is a widely studied field, which allows users to retrieve the required information without understanding the knowledge graph model and structured query languages such as SPARQL. Although existing methods use spatial indexes such as R-tree and different pruning rules to reduce the retrieval space, there are still too many candidate entities that need to be traversed and checked online. Summary of the invention
[0003] Purpose of the invention: The present invention aims to provide a semantic location retrieval method based on deep clustering that can reduce the size of a candidate set; another purpose of the present invention is to provide a semantic location retrieval system, device and medium based on deep clustering.
[0004] Technical solution: The semantic location retrieval method based on deep clustering described in the present invention comprises the following steps:
[0005] (1) Extracting spatial and semantic information of entities in the knowledge graph;
[0006] (2) Using a spatial entity encoder, the spatial and semantic information of an entity is encoded into a unified embedding vector;
[0007] (3) Using a cascaded twin neural network framework, perform deep clustering on the embedding vectors obtained in step (3) to obtain a clustering result set;
[0008] (4) Based on the clustering result set and user task information, a skyline-based semantic location retrieval method is used to query the semantic locations that match the user task information.
[0009] Furthermore, step (1) extracts the spatial and semantic information of entities in the knowledge graph as follows:
[0010] (11) Divide the entities in the knowledge graph into spatial entities and general entities;
[0011] (12) Extract keywords of any entity in the knowledge graph to form a general keyword set that describes each entity;
[0012] (13) The general keyword sets of the spatial entity and its sub-entities are concatenated and deduplicated to form a set of spatial keywords that describe each spatial entity;
[0013] (14) Extract the geographic coordinate information of spatial entities.
[0014] Furthermore, step (12) extracts keywords of any entity in the knowledge graph to form a general keyword set describing each entity, as follows:
[0015] First, the node name is extracted from the node URI, and then the node label value is segmented using the "_" symbol, and a preliminary keyword set is generated by converting it to lowercase letters. For the preliminary keyword set, the stop word list is used to remove the wikicat, wordnet, of, and 109303008 keywords, and finally de-duplicate processing is performed to generate a general keyword set.
[0016] Furthermore, step (2) uses a spatial entity encoder to encode the spatial information and semantic information of the entity into a unified embedding vector as follows:
[0017] (21) Given a spatial entity s i =(x i ,y i ), spatial encoder Enc x ()=NN(PE (t) (x)) The coordinate x i Encoded as a spatial embedding vector Among them, NN() represents the fully connected layer, Indicates d (x) dimensional representation space, d (x) =6S, S represents the total number of grid scales, PE (t) (x) represents the multi-scale representation of the connection vector;
[0018] (22) Given a spatial entity s i =(x i ,y i ), semantic encoder Enc y () Encode the spatial keyword set into a semantic embedding vector The details are as follows:
[0019]
[0020] in, represents the embedding vector of the hth keyword in the spatial keyword set, H represents the total number of vectors in the spatial keyword set, Indicates d (y) Dimensional representation space;
[0021] (23) The complete spatial entity embedding vector e is the spatial embedding vector e[x i ] and the semantic embedding vector e[y i ], as follows:
[0022]
[0023] And, d = d (x) +d (y) .
[0024] Furthermore, the multi-scale representation PE of the connection vector (t) (x) The following conditions are met:
[0025]
[0026] Where S represents the total number of grid scales. For each scale s, The following conditions are met:
[0027]
[0028]
[0029] Among them, a j is a unit vector, and the angle between a1, a2, and a3 is 2π / 3; λ min is the minimum grid size, λ max is the maximum grid size, g is λ max / λ min Here, sine and cosine functions of different frequencies are used to decompose the coordinates into multi-scale representations, which can better reflect the surrounding environment and capture more spatial information.
[0030] Furthermore, step (3) uses a cascaded twin neural network framework to perform deep clustering on the entity embedding vectors, as follows:
[0031] (31) Define the cluster partitioning objective (CPO) as
[0032]
[0033] Among them, S(s i ,s j ) represents a pair of spatial entities in the same cluster (s i ,s j ), by minimizing CPO to minimize the semantic position differences within the same cluster and maximize the semantic position differences between different clusters;
[0034] (32) Use the twin neural network to cluster the entity embedding vectors and define the loss function L(s i ,s j )as follows:
[0035]
[0036] Among them, C(s i )=C(s j ) means they are in the same cluster, and the loss function is 1-S(s i ,s j ) are summed and minimized to reduce the differences in entity embedding vectors within the cluster;
[0037] (33) A cascaded twin neural network framework is used for clustering training. The framework is divided into several layers, each layer contains several twin neural networks, forming a tree structure. Each twin neural network is responsible for dividing the current set into two subsets, thereby dividing the entity embedding vector set into thousands of clusters as the clustering result set.
[0038] Furthermore, step (4) uses a skyline-based semantic location retrieval method to query semantic locations that meet the conditions as follows:
[0039] (41) The user inputs user task information, which includes the query location and query keywords, and returns the number of results k;
[0040] (42) For the clustering result set C1, C2, ..., C n , calculate the average value of all embedded vectors in each cluster as the center point of the cluster, and get the cluster center point set o1, o2, ..., o n ;
[0041] (43) The cluster center point o i The similarity with the given query is compared with the threshold τ. If it is less than the threshold, all embedding vectors in the cluster are pruned, otherwise they are added to the candidate set;
[0042] (44) For the candidate set, a skyline-based semantic location retrieval algorithm is used to return the top-k results with location information to the user according to the scores.
[0043] The semantic location retrieval system based on deep clustering of the present invention comprises:
[0044] Data preprocessing module, used to extract spatial and semantic information of entities in the knowledge graph;
[0045] User input module, used to input user task information;
[0046] The entity spatial encoding module is used to encode the spatial and semantic information of an entity into a unified embedding vector;
[0047] The deep clustering module is used to perform deep clustering on the obtained embedding vectors using a cascaded twin neural network framework to obtain a clustering result set;
[0048] The semantic location retrieval module is used to query the semantic location that meets the user's task information using a semantic location retrieval method based on Skyline.
[0049] The computer device of the present invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the steps of the above method are implemented when the processor executes the computer program.
[0050] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program implements the steps of the above method when executed by a processor.
[0051] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: 1. The present invention uses a cascaded twin neural network framework to improve cluster performance and training speed, and uses a twin neural network for deep clustering to reduce the retrieval space, so as to avoid online graph traversal on a large-scale knowledge graph and improve retrieval efficiency; 2. The present invention uses a spatial entity encoder to encode the spatial and semantic information of each entity into a unified embedding vector, so that the spatial and semantic information of the entities in the knowledge graph can be effectively clustered later; 3. The present invention can perform deep clustering on candidate entities and reduce the size of the candidate set, thereby improving retrieval efficiency; 4. The present invention can retrieve and return Top-k results with location information based on the query location and query keywords. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of the present invention;
[0053] Figure 2 A diagram of the construction process of a general keyword set;
[0054] Figure 3 A training framework for cascaded Siamese neural networks. DETAILED DESCRIPTION
[0055] The present invention will be further described below in conjunction with the accompanying drawings.
[0056] The semantic location retrieval method based on deep clustering of the present invention comprises the following steps:
[0057] Step (1): Extract the spatial and semantic information of entities in the knowledge graph. The specific implementation process is as follows:
[0058] (11) Divide the entities in the knowledge graph into spatial entities and general entities;
[0059] (12) For any entity in the knowledge graph, keywords are extracted from its labels and attribute values to form a general keyword set that describes each entity, such as Figure 2 As shown, for<Vatican_Hill> For example, we first extract the node name from the node URI, and then use the "_" symbol to segment the words together with the node label value, and convert them to lowercase letters to generate a preliminary keyword set. For the preliminary keyword set, we use a stop word list to remove keywords such as wikicat, wordnet, of, 109303008, etc. that cannot well represent the node characteristics, so as to save storage space and improve search efficiency. Finally, we generate the final keyword set through deduplication processing;
[0060] (13) For spatial entities in the knowledge graph, the general keyword sets of the entity and its sub-entities are concatenated and deduplicated to form a set of spatial keywords that describe each spatial entity;
[0061] (14) For spatial entities in the knowledge graph, extract their geographic coordinate information.
[0062] Step (2) encodes the spatial information and semantic information of the entity into a unified embedding vector. The specific implementation process is as follows: (21) Use the spatial encoder Enc x ()=NN(PE (t) (x)), the coordinate x i Encoded as a spatial embedding vector Among them, NN() represents the fully connected layer, PE (t) (x) represents the multi-scale representation of the connection vector, which satisfies the following formula:
[0063]
[0064] Where S represents the total number of grid scales, Satisfies the following formula:
[0065]
[0066] Given three unit vectors, the angle between any vectors is 2π / 3 and satisfies the following formula:
[0067]
[0068] So, It can be expressed as the following formula:
[0069]
[0070] This method uses sine and cosine functions of different frequencies to decompose coordinates into multi-scale representations, which can better reflect the surrounding environment and capture more spatial information;
[0071] (22) Using semantic encoder Enc y (), encode the keywords of the spatial keyword set into semantic embedding vectors The specific method is as follows:
[0072]
[0073] in, represents the embedding vector of the hth keyword in the spatial keyword set, and H represents the total number of vectors in the spatial keyword set;
[0074] (23) The sum of spatial embedding and semantic embedding is used as the complete spatial entity embedding vector, which is specifically expressed as And satisfy d = d (x) +d (y) :
[0075] Step (3) uses a cascaded twin neural network framework to perform deep clustering on the entity embedding vectors. The specific implementation process is as follows:
[0076] (31) The cluster partitioning objective (CPO) is defined as follows:
[0077]
[0078] Among them, S(s i ,s j ) represents the similarity of a pair of spatial entities in the same cluster. By minimizing CPO, the semantic position difference within the same cluster is minimized, while the semantic position difference between different clusters is maximized.
[0079] (32) Use the twin neural network to cluster the entity embedding vectors and define the loss function as follows:
[0080]
[0081] Among them, C(s i )=C(s j ) means they are in the same cluster, and the loss function is 1-S(s i ,s j ) are summed and minimized to reduce the differences in entity embedding vectors within the cluster;
[0082] (33) A cascaded twin neural network framework is used for actual clustering training. The framework is divided into multiple layers, each layer contains several twin neural networks, forming a tree structure. Each neural network is responsible for dividing the current set into two subsets, thereby dividing the entity embedding vector set into thousands of clusters.
[0083] Specifically, 35,000 spatial entities are randomly selected as training samples in the knowledge graph, and the overall framework is trained end-to-end; a partitioning strategy is adopted for small-scale clustering, and when the number of spatial entities in a cluster is less than 50, further partitioning is stopped; the training cycle is set to 3, the batch size is set to 256, and Adam is selected as the optimizer. For each model in the cascade framework, the same sampling and training process is repeated from level 0 until a predetermined number of clusters is reached, as shown in Figure 3 shown.
[0084] Step (4) uses the skyline-based semantic location retrieval method to query the semantic locations that meet the conditions. The specific implementation process is as follows:
[0085] (41) User input: query location, query keyword, return number of results k;
[0086] (42) For the clustering result set C1, C2, ..., C n , calculate the average value of all embedded vectors in each cluster as the center point of the cluster, and get o1, o2, ..., o n ;
[0087] (43) The cluster center point o i The similarity with the given query is compared with the threshold τ. If it is less than the threshold, all embedding vectors in the cluster are pruned, otherwise they are added to the candidate set;
[0088] (44) Use a skyline-based semantic location retrieval algorithm to return the top-k results with location information to the user according to the scores.
[0089] The Skyline-based semantic place retrieval algorithm used in step (44) returns the top-k results with location information to the user according to the scores, and specifically refers to the method of the article SSPR: A Skyline-Based Semantic Place Retrieval Method.
[0090] The semantic location retrieval system based on deep clustering of the present invention comprises:
[0091] Data preprocessing module, used to extract spatial and semantic information of entities in the knowledge graph;
[0092] User input module, used to input user task information;
[0093] The entity spatial encoding module is used to encode the spatial and semantic information of an entity into a unified embedding vector;
[0094] The deep clustering module is used to perform deep clustering on the obtained embedding vectors using a cascaded twin neural network framework to obtain a clustering result set;
[0095] The semantic location retrieval module is used to query the semantic location that meets the user's task information using a semantic location retrieval method based on Skyline.
[0096] The computer device of the present invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the steps of the above method are implemented when the processor executes the computer program.
[0097] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program implements the steps of the above method when executed by a processor.
Claims
1. A semantic location retrieval method based on deep clustering, It is characterized in that The following steps are involved: (1) Extracting spatial and semantic information of entities in the knowledge graph; (2) Using a spatial entity encoder, the spatial and semantic information of an entity is encoded into a unified embedding vector; (3) Using a cascaded twin neural network framework, perform deep clustering on the embedding vectors obtained in step (3) to obtain a clustering result set; (4) Based on the clustering result set and user task information, a skyline-based semantic location retrieval method is used to query the semantic locations that match the user task information.
2. The semantic location retrieval method based on deep clustering according to claim 1, It is characterized in that Step (1) extracts the spatial and semantic information of entities in the knowledge graph as follows: (11) Divide the entities in the knowledge graph into spatial entities and general entities; (12) Extract keywords of any entity in the knowledge graph to form a general keyword set that describes each entity; (13) The general keyword sets of the spatial entity and its sub-entities are concatenated and deduplicated to form a set of spatial keywords that describe each spatial entity; (14) Extract the geographic coordinate information of spatial entities.
3. The semantic location retrieval method based on deep clustering according to claim 2, It is characterized in that Step (12) extracts keywords of any entity in the knowledge graph to form a general keyword set describing each entity, as follows: First, the node name is extracted from the node URI, and then the node label value is segmented using the "" symbol, and a preliminary keyword set is generated by converting lowercase letters. For the preliminary keyword set, the stop word list is used to remove the wikicat, wordnet, of, and 109303008 keywords, and finally de-duplicate processing is performed to generate a general keyword set.
4. The semantic location retrieval method based on deep clustering according to claim 1, It is characterized in that Step (2) uses a spatial entity encoder to encode the spatial information and semantic information of an entity into a unified embedding vector as follows: (21) Given a spatial entity s i =(x i ,y i ), spatial encoder Enc x ()=NN(PE (t) (x)) The coordinate x i Encoded as a spatial embedding vector Among them, NN() represents the fully connected layer, Indicates d (x) dimensional representation space, d (x) =6S, S represents the total number of grid scales, PE (t) (x) represents the multi-scale representation of the connection vector; (22) Given a spatial entity s i =(x t ,y i ), semantic encoder Enc y () Encode the spatial keyword set into a semantic embedding vector The details are as follows: in, represents the embedding vector of the hth keyword in the spatial keyword set, h represents the total number of vectors in the spatial keyword set, Indicates d (y) Dimensional representation space; (23) The complete spatial entity embedding vector e is the spatial embedding vector e[x i ] and the semantic embedding vector e[y i ], as follows: And, d = d (x) +d (y) .
5. The semantic location retrieval method based on deep clustering according to claim 4, It is characterized in that The multi-scale representation of the connection vector PE (t) (x) The following conditions are met: Where S represents the total number of grid scales. For each scale s, The following conditions are met: Among them, a j is a unit vector, and a 1 、a 2 、a 3 The angle between them is 2π / 3; min is the minimum grid size, λ max is the maximum grid size, g is λ max / λ min .
6. The semantic location retrieval method based on deep clustering according to claim 1, It is characterized in that Step (3) uses a cascaded twin neural network framework to perform deep clustering on the entity embedding vectors, as follows: (31) Define the cluster partitioning objective (CPO) as Among them, S(s i ,s j ) represents a pair of spatial entities in the same cluster (s i ,s j ), by minimizing CPO to minimize the semantic position differences within the same cluster and maximize the semantic position differences between different clusters; (32) Use the twin neural network to cluster the entity embedding vectors and define the loss function L(s i ,s j )as follows: Among them, C(s i )=C(s j ) means they are in the same cluster, and the loss function is 1-S(s i ,s j ) sums and minimizes it; (33) A cascaded twin neural network framework is used for clustering training. The framework is divided into several layers, each layer contains several twin neural networks, forming a tree structure. Each twin neural network is responsible for dividing the current set into two subsets, thereby dividing the entity embedding vector set into thousands of clusters as the clustering result set.
7. The semantic location retrieval method based on deep clustering according to claim 1, It is characterized in that Step (4) uses the Skyline-based semantic location retrieval method to query the semantic locations that meet the conditions as follows: (41) The user inputs user task information, which includes the query location and query keywords, and returns the number of results k; (42) For the clustering result set C 1 , C 2 , ..., C n , calculate the average value of all embedded vectors in each cluster as the center point of the cluster, and get the cluster center point set o 1 , o 2 , ..., o n ; (43) The cluster center point o i The similarity with the given query is compared with the threshold τ. If it is less than the threshold, all embedding vectors in the cluster are pruned, otherwise they are added to the candidate set; (44) For the candidate set, a skyline-based semantic location retrieval algorithm is used to return the top-k results with location information to the user according to the scores.
8. A semantic location retrieval system based on deep clustering, It is characterized in that include: Data preprocessing module, used to extract spatial and semantic information of entities in the knowledge graph; User input module, used to input user task information; The entity spatial encoding module is used to encode the spatial and semantic information of an entity into a unified embedding vector; The deep clustering module is used to perform deep clustering on the obtained embedding vectors using a cascaded twin neural network framework to obtain a clustering result set; The semantic location retrieval module is used to query the semantic location that meets the user's task information using a semantic location retrieval method based on Skyline.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
FMEA-based authority collaborative management system and method
CN119513900A
