Knowledge graph query optimization method based on semantic annotation
By performing semantic annotation and keyword vector analysis on the historical query data of the knowledge graph, combined with the historical query category analysis of the query user, the knowledge graph query is optimized, and the problems of slow query response speed and low result matching in the existing technology are solved, achieving more efficient and accurate query results.
Patent Information
- Application Number
- CN202410874893.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-07-02
AI Technical Summary
In the prior art, due to the large amount of data in the knowledge graph query, the query response speed is slow, and the reply that is closest to the query cannot be quickly retrieved, and there is a problem of delay in reply and low matching degree of query results.
By collecting the query information of the target knowledge graph in the historical query window, the historical query data set is extracted, and the data set is extracted with the query item as the index. Then, semantic recognition analysis and keyword vector analysis are performed on the query data set, semantic understanding complexity and project keyword vector sets are generated, and semantic annotation is performed. Combining the query user's historical query category analysis and current query information, match the query results.
Optimizing knowledge graph query through semantic annotation improves query accuracy and efficiency, reduces reply delay, and improves the matching degree between query results and user needs.
Smart Images

Figure CN118820398B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a knowledge graph query optimization method based on semantic annotation. Background Art
[0002] By using papers and other materials in the power field to build a knowledge graph, relevant knowledge corresponding to the query is provided to power practitioners. However, due to the complexity of the knowledge graph, it is impossible to quickly retrieve the most relevant response to the query from a large number of relevant knowledge when performing query retrieval. There are often cases where the response is delayed and the query results do not match the items you want to inquire about. The existing technology has technical problems such as large data volume and slow query response speed when performing knowledge graph queries. Summary of the invention
[0003] The present application provides a knowledge graph query optimization method based on semantic annotation, which is used to solve the technical problems of large data volume and slow query response speed when performing knowledge graph query in the prior art.
[0004] In view of the above problems, the present application provides a knowledge graph query optimization method based on semantic annotation.
[0005] In a first aspect of the present application, a knowledge graph query optimization method based on semantic annotation is provided, the method comprising:
[0006] Collect the query information of the target knowledge graph in the historical query window to obtain the historical query data set;
[0007] Perform multi-user query data extraction on the historical query data set using the query item as an index to obtain Q query data sets, wherein the Q query data sets correspond to the Q query items;
[0008] Performing semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query items;
[0009] Perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets;
[0010] Performing semantic annotation on the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets to obtain semantic annotation results;
[0011] Perform historical query category analysis on the target query user to obtain the first query coefficient;
[0012] The query information of the target query user at the current moment is obtained, matched with the Q query items, and combined with the first query coefficient and the semantic annotation result to obtain the target query result.
[0013] The second aspect of the present application provides a knowledge graph query optimization system based on semantic annotation, the system comprising:
[0014] The historical query data set acquisition module is used to collect the query information of the target knowledge graph in the historical query window to obtain the historical query data set;
[0015] A query data set acquisition module is used to extract multi-user query data from the historical query data set using query items as indexes to obtain Q query data sets, wherein the Q query data sets correspond to the Q query items;
[0016] A comprehension complexity obtaining module, configured to perform semantic recognition analysis on the Q query data sets to obtain Q semantic comprehension complexities of the Q query items;
[0017] A keyword vector set generation module is used to traverse and perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets;
[0018] A semantic annotation result obtaining module, used to semantically annotate the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets, to obtain semantic annotation results;
[0019] A first query coefficient obtaining module, used to perform historical query category analysis on the target query user to obtain a first query coefficient;
[0020] The query result obtaining module is used to obtain the query information of the target query user at the current moment, match it with the Q query items, and obtain the target query result by combining the first query coefficient and the semantic annotation result.
[0021] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0022] This application collects query information of the target knowledge graph in the historical query window to obtain a historical query data set, then extracts multi-user query data from the historical query data set with query items as indexes, obtains Q query data sets, wherein the Q query data sets correspond to Q query items, and then performs semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query items, performs keyword vector analysis on the Q query data sets by traversal, generates Q project keyword vector sets, and then semantically annotates the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q project keyword vector sets to obtain semantic annotation results, performs historical query category analysis on the target query user to obtain the first query coefficient, and then obtains the query information of the target query user at the current moment, matches it with the Q query items, and combines it with the first query coefficient to obtain the target query result. The technical effect of optimizing knowledge graph queries by semantic annotation and improving query accuracy and efficiency is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 A schematic diagram of the flow of a knowledge graph query optimization method based on semantic annotation provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of a process for obtaining Q semantic understanding complexities in a knowledge graph query optimization method based on semantic annotation provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of a process for obtaining Q first semantic understanding complexities in a knowledge graph query optimization method based on semantic annotation provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of the structure of a knowledge graph query optimization system based on semantic annotation provided in an embodiment of the present application.
[0028] Explanation of the accompanying drawings: historical query data set acquisition module 11, query data set acquisition module 12, understanding complexity acquisition module 13, keyword vector set generation module 14, semantic annotation result acquisition module 15, first query coefficient acquisition module 16, query result acquisition module 17. DETAILED DESCRIPTION
[0029] The present application provides a knowledge graph query optimization method based on semantic annotation, which is used to solve the technical problems of large data volume and slow query response speed when performing knowledge graph query in the prior art.
[0030] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0031] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules that are not explicitly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] like Figure 1 As shown, the present application provides a knowledge graph query optimization method based on semantic annotation, wherein the method comprises:
[0034] Step S100: collecting query information of the target knowledge graph in the historical query window to obtain a historical query data set;
[0035] Step S200: extracting multi-user query data from the historical query data set using the query item as an index to obtain Q query data sets, wherein the Q query data sets correspond to the Q query items;
[0036] In a possible embodiment, the target knowledge graph is generated by extracting data, identifying attributes, and building relationships from relevant knowledge materials such as papers and patents in the electric power field. The historical query window is a time period for data query on the target knowledge graph within a historical time, which may be half a year, a year, etc. The historical query data set is obtained by extracting the query record information of the target knowledge graph within the historical query window. Among them, the historical query data set is the record data generated after data query in the target knowledge graph within a historical time, including query time, query items, query results and other data. Obtaining the historical query data set provides reliable data support for the subsequent analysis of the application of the target knowledge graph.
[0037] In one embodiment, the historical query data set is subjected to multi-user query data extraction with the query item as an index, that is, the data generated when different query items are queried by different users in the historical query window are classified and analyzed to obtain the Q query data sets. The Q query data sets correspond to the Q query items. Each query data set includes data when multiple users query the query items.
[0038] Step S300: performing semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query items;
[0039] Further, such as Figure 2 As shown, semantic recognition analysis is performed on the Q query data sets to obtain Q semantic understanding complexities of the Q query items. Step S300 of the embodiment of the present application further includes:
[0040] Retrieving the Q query data sets using the single consultation duration as an index to generate Q single consultation duration sets;
[0041] Performing frequent item analysis on the Q single consultation duration sets to obtain Q first semantic understanding complexities;
[0042] Retrieving the Q query data sets using the query interaction frequency as an index to generate Q query interaction frequency sets;
[0043] Performing frequent item analysis on the Q query interaction frequency sets to obtain Q second semantic understanding complexities;
[0044] Retrieving the Q query data sets using the query user overlap rate as an index, generating Q query user overlap rates, and using the Q query user overlap rates as Q third semantic understanding complexities;
[0045] Semantic recognition analysis is performed on the Q first semantic understanding complexities, the Q second semantic understanding complexities, and the Q third semantic understanding complexities, respectively, to obtain Q semantic understanding complexities of the Q query items.
[0046] Further, such as Figure 3 As shown, step S300 of the embodiment of the present application also includes:
[0047] Extract the average consultation duration of each of the Q single consultation duration sets to obtain the Q starting points of the single consultation duration;
[0048] Taking the starting points of Q single consultation durations as the starting points for frequent item analysis, mining the set of Q single consultation durations to obtain Q stage consultation durations;
[0049] Determine whether the clustering density increments of the Q single consultation duration starting points and the Q stage consultation durations meet the preset increments. If not, stop the frequent item analysis and take the stage consultation durations corresponding to the maximum clustering density values during the analysis as the Q target single consultation durations;
[0050] The ratio of the Q target single consultation durations to the sum of the Q target single consultation durations is respectively taken as the Q first semantic understanding complexities.
[0051] In one possible embodiment, semantic recognition analysis is performed on the Q query data sets respectively to determine the complexity of understanding the relevant content of different query items, and obtain Q semantic understanding complexities of the Q query items. The Q semantic understanding complexities are used to describe the comprehensibility of the content of different query items after being queried and retrieved in the target knowledge graph. The higher the semantic understanding complexity, the lower the comprehensibility of the relevant content of the corresponding query item, and more keywords are needed to explain the query item.
[0052] In one embodiment, the Q query data sets are retrieved using the single consultation duration as an index, wherein the single consultation duration is used to describe the length of time spent on each consultation when searching the target knowledge graph. The Q single consultation duration sets describe the semantic understanding difficulty of the Q query items from a time dimension, thereby obtaining the Q first semantic understanding complexities after analysis. By performing frequent item analysis on the Q single consultation duration sets, the most representative single consultation duration of each query item in the historical query window is determined, and the Q first semantic understanding complexities are determined.
[0053] Then, the Q query data sets are retrieved with the query interaction frequency as an index to generate Q query interaction frequency sets. The query interaction frequency is used to describe the number of single query interactions when any query item is queried in the target knowledge graph. The higher the query interaction frequency, the higher the number of interactions with the target knowledge graph required when querying the relevant content of the query item, and the more difficult it is to understand the relevant content of the corresponding query item. By performing frequent item analysis on the Q query interaction frequency sets, the semantic understanding complexity of the Q query items is determined from the dimension of query interaction frequency, and the Q second semantic understanding complexities are generated.
[0054] Then, the query user overlap rate is used as an index to retrieve the Q query data sets and generate Q query user overlap rates, wherein the query user overlap rate is the degree to which the same query item is repeatedly queried by the same user. Optionally, the total query times of the Q query items in the historical query window are counted respectively, and then the number of single records of only one user query is counted, and the ratio of the single record number to the total query number is subtracted from 1 to obtain the query user overlap rate. The Q query user overlap rates are used as Q third semantic understanding complexities to describe the semantic understanding complexity of the Q query items from the degree of overlap of repeated user queries.
[0055] In one embodiment, after obtaining the Q first semantic understanding complexities, Q second semantic understanding complexities and Q third semantic understanding complexities, the Q semantic understanding complexities of the Q query items are obtained by weighted calculation of the Q first semantic understanding complexities, Q second semantic understanding complexities and Q third semantic understanding complexities according to weight values set by technical personnel in the field.
[0056] In an embodiment of the present application, the average consultation duration is extracted from Q single consultation duration sets respectively to obtain Q single consultation duration starting points. The Q single consultation duration starting points are the average length of time spent on each query of the Q query items. Further, the Q single consultation duration starting points are used as the starting points for frequent item analysis, and the Q single consultation duration sets are mined according to the preset mining step set by a technician in this field to obtain Q stage consultation durations. The preset mining step is the consultation time length of a single move when performing frequent item analysis pre-set by a technician in this field. Optionally, the clustering density of the single consultation duration starting point is used to describe the density of the number of single consultation durations gathered around the single consultation duration starting point, and the clustering density is obtained by calculating the number of consultation durations in a circular area constructed with the single consultation duration starting point as the center and the preset mining step as the radius compared to the area of the area. Based on the same calculation principle, the clustering density of the Q stage consultation durations is calculated. Then, calculate the difference between the starting points of the Q single consultation durations and the clustering density of the Q stage consultation durations, obtain the clustering density increment, and determine whether the clustering density increment meets the preset increment. If so, it means that an area with a relatively dense clustering of single consultation durations has been excavated, and the frequent item analysis can be stopped. The stage consultation duration corresponding to the maximum clustering density during the analysis process is taken as the Q target single consultation durations. Then, take the ratio of the Q target single consultation durations to the sum of the Q target single consultation durations as the Q first semantic understanding complexities.
[0057] Step S400: traverse and perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets;
[0058] Furthermore, step S400 in the embodiment of the present application further includes:
[0059] Extract entity information from the Q query data sets, convert them into word vectors, and obtain Q word vector sets;
[0060] Traverse the Q word vector sets to screen the central word vectors, and use the word vectors with the top k occurrence frequencies as the Q central word vector sets;
[0061] Calculate the similarity between the Q center word vector sets and the word vectors in the Q word vector sets respectively, and output the word vectors whose calculation results meet the preset similarity as the Q center word vector group sets;
[0062] The Q center word vector group sets are interactively fused to obtain Q project keyword vector sets.
[0063] In a possible embodiment, keyword vector analysis is performed on the Q query data sets to determine the keyword vectors of relatively important content in each query item, and the Q item keyword vector sets are generated. Obtaining the Q item keyword vector sets paves the way for subsequent rapid response queries.
[0064] In one embodiment, by extracting entity information from the Q query data sets, that is, extracting keywords from the query data, and then using graph embedding technology to convert the extraction results into word vectors, the Q word vector sets are obtained. Then, the frequency of occurrence of each word vector in the Q word vector sets is counted, and the word vectors with the frequency of occurrence in the top k positions are used as Q center word vector sets. Then, by using the cosine similarity formula, the similarity between the Q center word vector sets and the word vectors in the Q word vector sets is calculated respectively. The higher the similarity, the closer the relationship between the word vectors in the Q word vector sets and the word vectors in the Q word vector sets. The word vectors whose calculation results meet the preset similarity pre-set by those skilled in the art are output as Q center word vector group sets. Each center word vector group corresponds to a center word vector. Then, the union of the Q center word vector group sets is calculated respectively, and the interactive fusion of multiple center word vector groups in each center word vector group set is completed, thereby obtaining Q project keyword vector sets.
[0065] Step S500: semantically annotating Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets to obtain semantic annotation results;
[0066] Furthermore, step S500 of the embodiment of the present application further includes:
[0067] Collect multiple sample semantic understanding complexities, multiple sample item keyword vector sets, multiple query items, and multiple sample semantic annotation results as training data sets;
[0068] Dividing the training data set into a training set and a validation set according to a certain ratio, and using the training set to train a network layer constructed based on a feedforward neural network to obtain training accuracy;
[0069] Using the verification set to verify the trained network layer to obtain verification accuracy;
[0070] Performing a network parameter update analysis based on the training accuracy and the verification accuracy to obtain a network parameter update instruction;
[0071] Based on the network parameter update instruction, the parameters of the trained network layer are updated to generate a semantic annotation network layer;
[0072] The semantic annotation network layer is used to perform semantic annotation on the Q semantic understanding complexities, the Q project keyword vector sets and the Q query projects to obtain the semantic annotation result.
[0073] Further, based on the training accuracy and the verification accuracy, a network parameter update analysis is performed to obtain a network parameter update instruction. Step S500 of the embodiment of the present application further includes:
[0074] Determine whether the difference between the training accuracy and the verification accuracy is greater than a preset difference, and if so, output a network parameter update instruction;
[0075] If not, determine whether the training accuracy and / or the verification accuracy is greater than a preset accuracy; if not, output a network parameter update instruction.
[0076] In a possible embodiment, semantic annotation is performed on the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets, and the degree and content of semantic annotation required for different query items are determined, so as to obtain semantic annotation results intelligently. The semantic annotation results are used to annotate the relationship between item keyword vectors in the item keyword vector sets of different query items.
[0077] In one embodiment, multiple sample semantic understanding complexity, multiple sample project keyword vector sets, multiple query items and multiple sample semantic annotation results are collected as training data sets, and then the training data sets are divided into training sets and verification sets according to a certain ratio. Optionally, the ratio of training sets to verification sets is 3:1. Then, the network layer constructed based on the feedforward neural network is trained using the training set, and the matching degree of multiple training semantic annotation results output by the network layer and multiple sample semantic annotation results in the input training data set is statistically calculated, and the matching degree is used as the training accuracy. Among them, the training accuracy is used to describe the accuracy of the output of the network layer during the training process. The higher the training accuracy, the better the training degree of the network layer. Then, multiple sample semantic understanding complexity, multiple sample project keyword vector sets, and multiple query items in the verification set are input into the trained network layer for verification, and multiple verification semantic annotation results are obtained. The multiple verification semantic annotation results are matched with the multiple sample semantic annotation results in the input verification data set, and the verification matching degree is calculated, and the verification matching degree is used as the verification accuracy. The verification accuracy is used to describe the semantic annotation capability of the network layer for unknown data. The higher the verification accuracy, the better the prediction capability of the network layer.
[0078] Then, according to the training accuracy and verification accuracy, an analysis is performed to determine whether it is necessary to update the network parameters of the network layer, and a network parameter update instruction is obtained. The network parameter update instruction is a command to update the network parameters of the network layer, and then, based on the network parameter update instruction, the parameters of the trained network layer are updated to generate a semantic annotation network layer. The semantic annotation network layer is used to perform intelligent semantic annotation according to the Q semantic understanding complexities and the Q project keyword vector sets and Q query projects, so as to obtain the semantic annotation result.
[0079] Further, based on the training accuracy and the verification accuracy, a network parameter update analysis is performed to obtain a network parameter update instruction. Step S500 of the embodiment of the present application further includes:
[0080] Determine whether the difference between the training accuracy and the verification accuracy is greater than a preset difference, and if so, output a network parameter update instruction;
[0081] If not, determine whether the training accuracy and / or the verification accuracy is greater than a preset accuracy; if not, output a network parameter update instruction.
[0082] In one possible embodiment, it is determined whether the difference between the training accuracy and the verification accuracy is greater than a preset difference. If so, it indicates that the model has learned too much about the data in the training set and is in an overfitting state and needs to update the network parameters. At this time, a network parameter update instruction is output. If not, it indicates that the network layer is not in an overfitting state at this time. It is determined whether the training accuracy or the verification accuracy is greater than the preset accuracy, or whether the training accuracy and the verification accuracy are greater than the preset accuracy. If not, it indicates that the output accuracy of the network layer is not high and the network parameters need to be adjusted and updated, and a network parameter update instruction is output.
[0083] Step S600: Analyze the historical query category of the target query user to obtain a first query coefficient;
[0084] Step S700: Acquire the query information of the target query user at the current moment, match it with the Q query items, and obtain the target query result by combining the first query coefficient and the semantic annotation result.
[0085] Further, historical query category analysis is performed on the target query user to obtain a first query coefficient. Step S600 of the embodiment of the present application further includes:
[0086] Collecting statistics on the query data of the target query user in the historical query window to generate a target user historical query data set;
[0087] Performing a query frequency analysis on the target user's historical query data set for similar items to obtain the query frequency of similar items;
[0088] Determine the average interval time of similar item queries based on the target user's historical query data set;
[0089] A historical query category analysis is performed on the frequency of similar queries and the average interval time of similar item queries to obtain a first query coefficient.
[0090] In a possible embodiment, the target query user is a user who needs to query the target knowledge graph. A historical query category analysis is performed on the query situation of the target query user in the historical query window to determine the target query user's ability to understand the query retrieval results, that is, the first query coefficient, and then the query result that fits the actual situation of the target query user is matched according to the first query coefficient to obtain the target query result.
[0091] In one embodiment, a target user historical query data set is generated by counting the query data of the target query user in the historical query window. The target historical query data set is used to describe the query records of the target user in the historical query window, including data such as query time, query interaction times, and query content. Then, the target user historical query data set is retrieved with the query frequency of similar items as an index to obtain multiple historical similar query frequencies, and then the average of the multiple historical query frequencies is calculated to obtain the similar query frequency. Among them, the similar query frequency is used to calculate the number of queries for the same query item when the target query user performs the target knowledge graph query. The higher the similar query frequency, the deeper the user's understanding of the query item. Then, according to the target user historical query data set, the query intervals of multiple similar items are counted, and then the average of the query intervals of the multiple similar items is calculated to obtain the average query interval time of the similar items. Then, the first query coefficient is obtained by inputting the similar query frequency and the average query interval time of the similar item into the two-dimensional mapping unit for retrieval. Preferably, the two-dimensional mapping unit is used to describe the mapping relationship between the first query coefficient of the query user and the frequency of similar queries and the average interval time of the similar item queries. The two-dimensional mapping unit is generated by obtaining multiple sample similar query frequencies and multiple sample similar item query average interval times, and multiple sample first query coefficients, constructing a mapping relationship between multiple sample similar query frequencies and multiple sample similar item query average interval times and multiple sample first query coefficients.
[0092] In one embodiment, the target query item is determined by matching the query information of the target query user at the current moment with the Q query items, and then the target query item is retrieved in the target knowledge graph, and the target query result is determined based on the first query coefficient and the semantic annotation result. The target query result is generated by inputting the target query item, the target knowledge graph, the first query coefficient and the semantic annotation result into the query network layer. Optionally, by obtaining multiple sample target query items, multiple sample target knowledge graphs, multiple sample first query coefficients and multiple sample semantic annotation results as training sets, supervised training is performed on a framework built based on a convolutional neural network until the output reaches convergence, thereby obtaining the trained query network layer.
[0093] Furthermore, step S600 in the embodiment of the present application further includes:
[0094] Retrieving the query evaluation of the target query user in the historical query window to obtain multiple historical query evaluation results;
[0095] Performing consistency analysis on the multiple historical query evaluation results to determine a consistency factor;
[0096] It is determined whether the consistency factor is less than or equal to a preset threshold value, and if so, the first query coefficient is corrected using the consistency factor.
[0097] In one possible embodiment, multiple historical query evaluation results are used to describe the satisfaction of the multiple target query users with the query results in the historical time. The variance of the multiple historical query evaluation results is calculated to perform consistency analysis, and the inverse of the calculation result is used as the consistency factor. The larger the consistency factor, the more consistent the query behavior of the target query user is, and it is easy to obtain a relatively stable query result. The smaller the consistency factor, the less satisfactory the target query user is for different query questions. At this time, it is necessary to multiply the ratio of the consistency factor to the preset threshold by the first query coefficient to obtain a corrected first query coefficient.
[0098] In summary, the embodiments of the present application have at least the following technical effects:
[0099] This application collects the query information of the target knowledge graph in the historical query window to obtain a historical query data set, provides basic analysis data for analyzing the application of the target knowledge graph, and then extracts multi-user query data from the historical query data set with the query project as the index to obtain Q query data sets, and then performs semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query projects, thereby determining the query understanding difficulty of different query projects, generating Q project keyword vector sets, and then semantically annotating the Q query projects in the target knowledge graph according to the Q semantic understanding complexities and the Q project keyword vector sets to obtain semantic annotation results, perform historical query category analysis on the target query user to obtain the first query coefficient, and then obtain the query information of the target query user at the current moment, match it with the Q query projects, and combine it with the first query coefficient to obtain the target query result. The technical effect of optimizing the knowledge graph query by using semantic annotation, improving the matching degree between the query result and the query user, and improving the query efficiency is achieved.
[0100] Embodiment 2
[0101] Based on the same inventive concept as the knowledge graph query optimization method based on semantic annotation in the aforementioned embodiment, Figure 4 As shown, the present application provides a knowledge graph query optimization system based on semantic annotation, and the system and method embodiments in the embodiments of the present application are based on the same inventive concept. Among them, the system includes:
[0102] A historical query data set acquisition module 11 is used to collect query information of the target knowledge graph in the historical query window to obtain a historical query data set;
[0103] A query data set acquisition module 12 is used to extract multi-user query data from the historical query data set using query items as indexes to obtain Q query data sets, wherein the Q query data sets correspond to Q query items;
[0104] The understanding complexity obtaining module 13 is used to perform semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query items;
[0105] A keyword vector set generation module 14 is used to perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets;
[0106] A semantic annotation result obtaining module 15 is used to semantically annotate the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets to obtain semantic annotation results;
[0107] A first query coefficient obtaining module 16 is used to perform historical query category analysis on the target query user to obtain a first query coefficient;
[0108] The query result obtaining module 17 is used to obtain the query information of the target query user at the current moment, match it with the Q query items, and obtain the target query result by combining the first query coefficient and the semantic annotation result.
[0109] Furthermore, the comprehension complexity obtaining module 13 is used to perform the following steps:
[0110] Retrieving the Q query data sets using the single consultation duration as an index to generate Q single consultation duration sets;
[0111] Performing frequent item analysis on the Q single consultation duration sets to obtain Q first semantic understanding complexities;
[0112] Retrieving the Q query data sets using the query interaction frequency as an index to generate Q query interaction frequency sets;
[0113] Performing frequent item analysis on the Q query interaction frequency sets to obtain Q second semantic understanding complexities;
[0114] Retrieving the Q query data sets using the query user overlap rate as an index, generating Q query user overlap rates, and using the Q query user overlap rates as Q third semantic understanding complexities;
[0115] Semantic recognition analysis is performed on the Q first semantic understanding complexities, the Q second semantic understanding complexities, and the Q third semantic understanding complexities, respectively, to obtain Q semantic understanding complexities of the Q query items.
[0116] Furthermore, the comprehension complexity obtaining module 13 is used to perform the following steps:
[0117] Extract the average consultation duration of each of the Q single consultation duration sets to obtain the Q starting points of the single consultation duration;
[0118] Taking the starting points of Q single consultation durations as the starting points for frequent item analysis, mining the set of Q single consultation durations to obtain Q stage consultation durations;
[0119] Determine whether the clustering density increments of the Q single consultation duration starting points and the Q stage consultation durations meet the preset increments. If not, stop the frequent item analysis and take the stage consultation durations corresponding to the maximum clustering density values during the analysis as the Q target single consultation durations;
[0120] The ratio of the Q target single consultation durations to the sum of the Q target single consultation durations is respectively taken as the Q first semantic understanding complexities.
[0121] Furthermore, the keyword vector set generating module 14 is used to perform the following steps:
[0122] Extract entity information from the Q query data sets, convert them into word vectors, and obtain Q word vector sets;
[0123] Traverse the Q word vector sets to screen the central word vectors, and use the word vectors with the top k occurrence frequencies as the Q central word vector sets;
[0124] Calculate the similarity between the Q center word vector sets and the word vectors in the Q word vector sets respectively, and output the word vectors whose calculation results meet the preset similarity as the Q center word vector group sets;
[0125] The Q center word vector group sets are interactively fused to obtain Q project keyword vector sets.
[0126] Furthermore, the semantic annotation result obtaining module 15 is used to perform the following steps:
[0127] Collect multiple sample semantic understanding complexities, multiple sample item keyword vector sets, multiple query items, and multiple sample semantic annotation results as training data sets;
[0128] Dividing the training data set into a training set and a validation set according to a certain ratio, and using the training set to train a network layer constructed based on a feedforward neural network to obtain training accuracy;
[0129] Using the verification set to verify the trained network layer to obtain verification accuracy;
[0130] Performing a network parameter update analysis based on the training accuracy and the verification accuracy to obtain a network parameter update instruction;
[0131] Based on the network parameter update instruction, the parameters of the trained network layer are updated to generate a semantic annotation network layer;
[0132] The semantic annotation network layer is used to perform semantic annotation on the Q semantic understanding complexities, the Q project keyword vector sets and the Q query projects to obtain the semantic annotation result.
[0133] Furthermore, the semantic annotation result obtaining module 15 is used to perform the following steps:
[0134] Determine whether the difference between the training accuracy and the verification accuracy is greater than a preset difference, and if so, output a network parameter update instruction;
[0135] If not, determine whether the training accuracy and / or the verification accuracy is greater than a preset accuracy; if not, output a network parameter update instruction.
[0136] Furthermore, the first query coefficient obtaining module 16 is used to perform the following steps:
[0137] Collecting statistics on the query data of the target query user in the historical query window to generate a target user historical query data set;
[0138] Performing a query frequency analysis on the target user's historical query data set for similar items to obtain the query frequency of similar items;
[0139] Determine the average interval time of similar item queries based on the target user's historical query data set;
[0140] A historical query category analysis is performed on the frequency of similar queries and the average interval time of similar item queries to obtain a first query coefficient.
[0141] Furthermore, the first query coefficient obtaining module 16 is used to perform the following steps:
[0142] Retrieving the query evaluation of the target query user in the historical query window to obtain multiple historical query evaluation results;
[0143] Performing consistency analysis on the multiple historical query evaluation results to determine a consistency factor;
[0144] It is determined whether the consistency factor is less than or equal to a preset threshold value, and if so, the first query coefficient is corrected using the consistency factor.
[0145] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0146] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0147] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.
Claims
1. A knowledge graph query optimization method based on semantic annotation, characterized in that: The method comprises: Collect the query information of the target knowledge graph in the historical query window to obtain the historical query data set; Perform multi-user query data extraction on the historical query data set using the query item as an index to obtain Q query data sets, wherein the Q query data sets correspond to the Q query items; Performing semantic recognition analysis on the Q query data sets to obtain Q semantic understanding complexities of the Q query items; Perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets; Performing semantic annotation on the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets to obtain semantic annotation results; Perform historical query category analysis on the target query user to obtain the first query coefficient; Acquire the query information of the target query user at the current moment, match it with the Q query items, and obtain the target query result by combining the first query coefficient and the semantic annotation result; Wherein, semantic recognition analysis is performed on the Q query data sets to obtain Q semantic understanding complexities of the Q query items, and the method further includes: Retrieving the Q query data sets using the single consultation duration as an index to generate Q single consultation duration sets; Performing frequent item analysis on the Q single consultation duration sets to obtain Q first semantic understanding complexities; Retrieving the Q query data sets using the query interaction frequency as an index to generate Q query interaction frequency sets; Performing frequent item analysis on the Q query interaction frequency sets to obtain Q second semantic understanding complexities; Retrieving the Q query data sets using the query user overlap rate as an index, generating Q query user overlap rates, and using the Q query user overlap rates as Q third semantic understanding complexities; Performing semantic recognition analysis on the Q first semantic understanding complexities, the Q second semantic understanding complexities, and the Q third semantic understanding complexities respectively to obtain Q semantic understanding complexities of the Q query items; Wherein, the method further comprises: Extract the average consultation duration of each of the Q single consultation duration sets to obtain the Q starting points of the single consultation duration; Taking the starting points of Q single consultation durations as the starting points for frequent item analysis, mining the set of Q single consultation durations to obtain Q stage consultation durations; Determine whether the clustering density increments of the Q single consultation duration starting points and the Q stage consultation durations meet the preset increments. If not, stop the frequent item analysis and take the stage consultation durations corresponding to the maximum clustering density values during the analysis as the Q target single consultation durations; The ratio of the single consultation duration of the Q targets to the sum of the single consultation durations of the Q targets is respectively taken as Q first semantic understanding complexities; Wherein, historical query category analysis is performed on the target query user to obtain a first query coefficient, and the method further includes: Collecting statistics on the query data of the target query user in the historical query window to generate a target user historical query data set; Performing a query frequency analysis on the target user's historical query data set for similar items to obtain the query frequency of similar items; Determine the average interval time of similar item queries based on the target user's historical query data set; A historical query category analysis is performed on the frequency of similar queries and the average interval time of similar item queries to obtain a first query coefficient.
2. The method according to claim 1, characterized in that The method further comprises: Extracting entity information from the Q query data sets, converting them into word vectors, and obtaining Q word vector sets; Traverse the Q word vector sets to screen the central word vectors, and use the word vectors with the top k occurrence frequencies as the Q central word vector sets; Calculate the similarity between the Q center word vector sets and the word vectors in the Q word vector sets respectively, and output the word vectors whose calculation results meet the preset similarity as the Q center word vector group sets; The Q center word vector group sets are interactively fused to obtain Q project keyword vector sets.
3. The method according to claim 1, characterized in that The method further comprises: Collect multiple sample semantic understanding complexities, multiple sample item keyword vector sets, multiple query items, and multiple sample semantic annotation results as training data sets; Dividing the training data set into a training set and a validation set according to a certain ratio, and using the training set to train a network layer constructed based on a feedforward neural network to obtain training accuracy; Using the verification set to verify the trained network layer to obtain verification accuracy; Performing a network parameter update analysis based on the training accuracy and the verification accuracy to obtain a network parameter update instruction; Based on the network parameter update instruction, the parameters of the trained network layer are updated to generate a semantic annotation network layer; The semantic annotation network layer is used to perform semantic annotation on the Q semantic understanding complexities, the Q project keyword vector sets and the Q query projects to obtain the semantic annotation result.
4. The method according to claim 3, characterized in that Performing a network parameter update analysis based on the training accuracy and the verification accuracy to obtain a network parameter update instruction, the method further comprising: Determine whether the difference between the training accuracy and the verification accuracy is greater than a preset difference, and if so, output a network parameter update instruction; If not, determine whether the training accuracy and / or the verification accuracy is greater than a preset accuracy; if not, output a network parameter update instruction.
5. The method according to claim 1, characterized in that The method further comprises: Retrieving the query evaluation of the target query user in the historical query window to obtain multiple historical query evaluation results; Performing consistency analysis on the multiple historical query evaluation results to determine a consistency factor; It is determined whether the consistency factor is less than or equal to a preset threshold value, and if so, the first query coefficient is corrected using the consistency factor.
6. The knowledge graph query optimization system based on semantic annotation is characterized by: The system is used to execute the knowledge graph query optimization method based on semantic annotation according to any one of claims 1 to 5, and the system comprises: The historical query data set acquisition module is used to collect the query information of the target knowledge graph in the historical query window to obtain the historical query data set; A query data set acquisition module is used to extract multi-user query data from the historical query data set using query items as indexes to obtain Q query data sets, wherein the Q query data sets correspond to the Q query items; A comprehension complexity obtaining module, configured to perform semantic recognition analysis on the Q query data sets to obtain Q semantic comprehension complexities of the Q query items; A keyword vector set generation module is used to traverse and perform keyword vector analysis on Q query data sets to generate Q project keyword vector sets; A semantic annotation result obtaining module, used to semantically annotate the Q query items in the target knowledge graph according to the Q semantic understanding complexities and the Q item keyword vector sets, to obtain semantic annotation results; A first query coefficient obtaining module, used to perform historical query category analysis on the target query user to obtain a first query coefficient; The query result obtaining module is used to obtain the query information of the target query user at the current moment, match it with the Q query items, and obtain the target query result by combining the first query coefficient and the semantic annotation result.
Citation Information
Patent Citations
Semantic retrieval method and device, equipment and storage medium
CN112860866A
Advanced search method based on semantic understanding
CN117851444A