A data retrieval system, method, apparatus and storage medium

By performing semantic parsing and intent recognition of natural language and combining knowledge graphs to generate library query statements, the problem of inaccurate retrieval results in existing technologies has been solved, achieving efficient and accurate data retrieval and visualization.

CN115599802BActive Publication Date: 2026-02-03ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211121052.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2026-02-03
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

Existing knowledge graph-based data retrieval solutions cannot understand the meaning behind keywords, resulting in inaccurate search results that require users to perform further filtering, leading to low efficiency.

Method used

A semantic parsing model is used to identify intent, extract elements, and map resources from natural language, generating library query statements. Data retrieval is performed by combining knowledge graphs, and the results are then visualized.

Benefits of technology

It improves the accuracy and efficiency of data retrieval, understands user intent, provides intuitive visualizations, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599802B_ABST
    Figure CN115599802B_ABST
Patent Text Reader

Abstract

The application discloses a data retrieval system, method and device and a storage medium. In the application, a service support layer receives natural language, performs semantic analysis on the natural language to determine a retrieval path, the retrieval path comprises various entities and the relationships between the various entities, a gallery query statement is generated according to the retrieval path, and then various entity data and relationship data between the various entities are retrieved and displayed according to the gallery query statement. The retrieval mode combined with the natural language and the semantic analysis has certain reasoning capability, so that the retrieval is more accurate and efficient, and the effect and efficiency of the retrieval are better. The various entity data and the relationship data between the various entities are visually displayed, and the experience and display effect of the retrieval are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field, and in particular to a data retrieval system, method and device, and a storage medium. BACKGROUND

[0002] In the era of big data, knowledge and information are growing explosively in various industries, generating an unprecedented amount of data. Knowledge graph organizes data through the way of knowledge base, organically organizes structured data and semi-structured data, and establishes the correlation between data. With the increasingly wide application of knowledge graph in the field of big data, the retrieval efficiency of knowledge has become increasingly important.

[0003] The existing data retrieval scheme based on knowledge graph is generally keyword matching retrieval. The input keyword is matched and retrieved with the knowledge graph through keyword segmentation to retrieve the data corresponding to the keyword. The existing technology has the problem that keyword matching cannot understand the meaning behind the keyword, the retrieval result is not accurate, and the user needs to further filter the search result, the effect and efficiency of the query are poor. SUMMARY

[0004] The embodiments of the present application provide a data retrieval system, method, device and storage medium to solve the problem that the keyword matching of the prior art cannot understand the meaning behind the keyword, the retrieval result is not accurate, the user needs to further filter the search result, and the effect and efficiency of the query are poor.

[0005] The present application provides a data retrieval system, which comprises:

[0006] A data storage layer for storing a knowledge graph;

[0007] A service support layer for performing semantic analysis on an input natural language, determining a retrieval path, and generating a gallery query statement according to the retrieval path, wherein the retrieval path comprises various entities and the relationships between the various entities;

[0008] A business support layer for retrieving various entity data and relationship data between the various entities according to the gallery query statement;

[0009] A display layer for visually displaying a retrieval portal, the various entity data and the relationship data between the various entities.

[0010] Further, the service support layer is specifically configured to perform intent recognition, element extraction and resource mapping on the natural language based on a pre-trained semantic analysis model, determine a subgraph structure and a starting node corresponding to the natural language, and determine a retrieval path according to the subgraph structure and the starting node.

[0011] Further, the service support layer is specifically configured to determine a relationship triple and an attribute triple based on a pre-trained semantic analysis model, determine the subgraph structure and the starting node based on the relationship triple and the attribute triple, and determine the retrieval path based on the subgraph structure and the starting node.

[0012] Further, the service support layer is specifically configured to determine a relationship set and an intent node based on the relationship triple and the attribute triple, find a point data from the intent node in the relationship set, find a point data of the intent node as a starting node, record a relationship chain until there is no point data, find the point data and relationship data of the relationship in the relationship chain from the knowledge graph to obtain subgraph data, and determine the retrieval path based on the subgraph structure.

[0013] Further, the service support layer is further configured to retrieve a first-degree attribute and a first-degree attribute value of the intent node.

[0014] The display layer is further configured to perform a tiled visual display of the first-degree attribute and the first-degree attribute value of the intent node.

[0015] In another aspect, the present application provides a data retrieval method, which comprises:

[0016] performing semantic analysis on an input natural language to determine a retrieval path, and generating a gallery query statement based on the retrieval path, wherein the retrieval path comprises respective entities and relationships between the respective entities;

[0017] retrieving respective entity data and relationship data between the respective entities based on the gallery query statement;

[0018] performing visual display of the respective entity data and the relationship data between the respective entities.

[0019] Further, the semantic analysis on the input natural language to determine the retrieval path comprises:

[0020] performing intent recognition, element extraction, and resource mapping on the natural language based on a pre-trained semantic analysis model, determining a subgraph structure and a starting node corresponding to the natural language based on the intent recognition, the element extraction, and the resource mapping, and determining the retrieval path based on the subgraph structure and the starting node.

[0021] Further, the intent recognition, the element extraction, and the resource mapping on the natural language to determine the subgraph structure and the starting node corresponding to the natural language comprise:

[0022] The natural language is subjected to intent recognition, element extraction and resource mapping, relationship triplets and attribute triplets are determined, the subgraph structure and the starting node are determined according to the relationship triplets and the attribute triplets.

[0023] Further, the subgraph structure and the starting node are determined according to the relationship triplets and the attribute triplets, and the retrieval path is determined according to the subgraph structure and the starting node.

[0024] The relationship set and the intent node are determined according to the relationship triplets and the attribute triplets, the opposite point data is searched from the intent node in the relationship set, the opposite point data is searched as the starting node until there is no opposite point data, the searched relationship is recorded to obtain a relationship chain, the opposite point data and the relationship data of the relationship in the relationship chain are searched from the knowledge graph to obtain subgraph data, and the retrieval path is determined according to the subgraph structure.

[0025] Further, the method further comprises:

[0026] The first-degree attribute and the first-degree attribute value of the intent node are searched, and the first-degree attribute and the first-degree attribute value of the intent node are subjected to flat visualization display.

[0027] In another aspect, the application provides a data retrieval device, which comprises:

[0028] A determination module is configured to perform semantic analysis on the input natural language, determine a retrieval path, and generate a gallery query statement according to the retrieval path, wherein the retrieval path comprises various entities and relationships between the various entities.

[0029] A retrieval module is configured to retrieve various entity data and relationship data between the various entities according to the gallery query statement.

[0030] A display module is configured to visually display the various entity data and the relationship data between the various entities.

[0031] The determination module is specifically configured to perform intent recognition, element extraction and resource mapping on the natural language based on a pre-trained semantic analysis model, determine a subgraph structure and a starting node corresponding to the natural language, and determine a retrieval path according to the subgraph structure and the starting node.

[0032] The determination module is specifically configured to perform intent recognition, element extraction and resource mapping on the natural language, determine relationship triplets and attribute triplets, and determine the subgraph structure and the starting node according to the relationship triplets and the attribute triplets.

[0033] The determination module is specifically configured to determine a relationship set and an intent node according to the relationship triple and the attribute triple, find opposite point data from the intent node in the relationship set, take the opposite point data as a starting node to find opposite point data thereof until there is no opposite point data, record the found relationship to obtain a relationship chain, find opposite point data and relationship data of the relationship in the relationship chain from the knowledge graph to obtain subgraph data, and determine a retrieval path according to the subgraph structure.

[0034] The retrieval module is further configured to retrieve the first-degree attributes and the first-degree attribute values of the intent node.

[0035] The display module is further configured to perform tiled visual display of the first-degree attributes and the first-degree attribute values of the intent node.

[0036] In another aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method steps of any one of the aspects.

[0037] The present application provides a data retrieval system, method, device and storage medium. The system comprises: a data storage layer configured to store a knowledge graph; a service support layer configured to perform semantic analysis on input natural language, determine a retrieval path, and generate a gallery query statement according to the retrieval path, wherein the retrieval path comprises various entities and relationships between the various entities; a business support layer configured to retrieve various entity data and relationship data between the various entities according to the gallery query statement; and a display layer configured to visually display a retrieval entry, the various entity data and the relationship data between the various entities.

[0038] The above technical solution has the following advantages or beneficial effects:

[0039] In the present application, the service support layer receives natural language, performs semantic analysis on the natural language to determine a retrieval path, generates a gallery query statement according to the retrieval path, and then retrieves various entity data and relationship data between the various entities according to the gallery query statement and displays the data. The retrieval method combining natural language and semantic analysis has certain reasoning ability, making the retrieval more accurate and efficient, and the effect and efficiency of the retrieval are better. The various entity data and the relationship data between the various entities are visually displayed, improving the experience and display effect of the retrieval. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and all other drawings obtained by those of ordinary skill in the art without creative effort based on these drawings are within the scope of the present application.

[0041] Figure 1 The data retrieval system structure schematic diagram provided by the present application is shown in the figure.

[0042] Figure 2 The data processing flowchart of the data retrieval system provided by the present application is shown in the figure.

[0043] Figure 3 The process schematic diagram of generating triple information provided by the present application is shown in the figure.

[0044] Figure 4 The process schematic diagram of generating gallery query statement provided by the present application is shown in the figure.

[0045] Figure 5 The retrieval path generation process schematic diagram provided by the present application is shown in the figure.

[0046] Figure 6 The process schematic diagram of one-degree relationship flattening of the node provided by the present application is shown in the figure.

[0047] Figure 7 The data retrieval effect schematic diagram provided by the present application is shown in the figure.

[0048] Figure 8 The data retrieval process schematic diagram provided by the present application is shown in the figure.

[0049] Figure 9 The data retrieval device structure schematic diagram provided by the present application is shown in the figure.

[0050] Figure 10 The electronic equipment structure schematic diagram provided by the present application is shown in the figure. DETAILED DESCRIPTION

[0051] The present application will be described in further detail below with reference to the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.

[0052] Traditional knowledge retrieval mainly takes keywords as search purposes, and through some word segmentation processing, the contents with higher matching are fed back to the user in the index database. Such retrieval method cannot understand the meaning behind the keywords, so the user needs to screen and confirm the search results, and the result is naturally not accurate enough.

[0053] This patent provides a user-centric approach that uses natural language input, performs semantic analysis on the input text to identify intent, extract elements, and map resources, then generates a graph database query language to retrieve data. After data parsing and encapsulation, the results are finally returned to the presentation layer. This approach enables precise queries, displays the exploration path of intent nodes, and provides flattened, one-dimensional relationship data, significantly improving retrieval accuracy and providing users with intuitive and efficient results.

[0054] The relevant terms used in this application are explained as follows:

[0055] Graph database: A type of non-relational database that uses graph theory (knowledge graph) to store data on relationships between entities.

[0056] Entity: refers to something that is distinguishable and exists independently, such as a person, a city, or a commodity.

[0057] Attributes: refer to the characteristics, properties, features, and parameters that an entity may have. Attribute values ​​are the values ​​of an entity under a specific attribute.

[0058] Relationships are edges that connect different entities in a graph database. They can be causal relationships, proximity relationships, inferential relationships, compositional relationships, etc.

[0059] First-order relationship: Entities and relationships retrieved from the current entity through a single hop.

[0060] Pair data: In a graph database, an edge will have 2 points, which are paired data.

[0061] Semantic parsing refers to the use of various machine learning methods to mine and learn deeper concepts from text and natural language. Its main purpose is the understanding and generation of natural language, mapping natural language input into appropriate and effective representations.

[0062] Figure 1 The data retrieval system provided in this application is structurally illustrated, and the system includes:

[0063] Data storage layer 11 is used to store the knowledge graph;

[0064] Service support layer 22 is used to perform semantic parsing on the input natural language, determine the retrieval path, and generate a library query statement based on the retrieval path, wherein the retrieval path includes various entities and the relationships between the various entities;

[0065] Business support layer 33 is used to retrieve data of each entity and the relationship data between the entities according to the library query statement;

[0066] The presentation layer 44 is used to visualize the search entry, the data of each entity, and the data on the relationships between the entities.

[0067] like Figure 1 As shown, the data storage layer in the data retrieval system stores the knowledge graph, specifically the data storage corresponding to the knowledge graph. Currently, the data is stored in a graph database. This application relates to a data retrieval process based on a knowledge graph and does not limit the construction process of the knowledge graph. The presentation layer provides a visual display of the retrieval entry point. Users can input natural language into the retrieval entry point, and the natural language is transmitted to the service support layer via the presentation layer. The service support layer performs semantic parsing on the input natural language to determine the retrieval path, which includes various entities and the relationships between them. For example, if the user inputs "Zhang Xiaolei's father's brother's son's colleague," the service support layer performs semantic parsing to determine that the natural language contains the entity "Zhang Xiaolei," and the relationships between the entities are "father, brother, son, colleague." Based on the semantic parsing of the natural language, the system obtains the entities and their relationships, determines the retrieval path, and generates a graph library query statement based on the retrieval path. The generated graph library query statement enters the business support layer via the service support layer. The business support layer retrieves data on each entity and the relationships between the entities based on the graph library query statement. Using the example above, the business support layer retrieves entity data based on the image library query: "Zhang Xiaolei, Zhang Dalei, Zhang Taolei, Zhang Lianglei, Zhang San". The relationship between Zhang Xiaolei and Zhang Dalei is "father", the relationship between Zhang Dalei and Zhang Taolei is "brother", the relationship between Zhang Taolei and Zhang Lianglei is "son", and the relationship between Zhang Lianglei and Zhang San is "colleague". The presentation layer visualizes the entity data and the relationships between them.

[0068] In this application, the service support layer receives natural language, performs semantic parsing to determine the retrieval path, which includes various entities and the relationships between them. After generating a graph library query statement based on the retrieval path, it retrieves and displays data on each entity and the relationships between them. This retrieval method, combining natural language and semantic parsing, possesses a certain degree of reasoning ability, making the retrieval more accurate and efficient, resulting in good retrieval performance and efficiency. Visualizing the data on each entity and the relationships between them enhances the retrieval experience and display effect.

[0069] The presentation layer includes a user query module and a visualization module, both of which are web pages. The user query module is used to visualize the search entry point, while the visualization module is used to visualize the data of each entity and the relationships between them.

[0070] In this application, the business support layer is also used to retrieve the first-degree attributes and first-degree attribute values ​​of the intent node; the presentation layer is also used to perform a tiled visualization display of the first-degree attributes and first-degree attribute values ​​of the intent node.

[0071] The business support layer is primarily responsible for connecting the presentation layer and the service support layer. Its core is the retrieval module, which performs operations such as data validation, formatting, and data processing on the input and output data. It also performs business processing on the returned data, including assembling exploration paths, flattening the first-degree nodes of intent nodes into first-degree attributes, and retrieving the corresponding first-degree attribute values. This module supports the presentation layer.

[0072] For example, if the user inputs "Zhang Xiaolei's father's brother's son's colleague" in natural language, the intent node is determined to be "Zhang San". The first-degree attributes of this intent node include Zhang San's ID number, age, occupation, marital status, gender, ethnicity, height, daughter, sister, landlord, etc. For example, the first-degree attribute value corresponding to Zhang San's age is 33 years old, the first-degree attribute value for gender is male, and the first-degree attribute value for ethnicity is Han, etc.

[0073] In this application, the service support layer is specifically used to perform intent recognition, element extraction, and resource mapping on natural language based on a pre-trained semantic parsing model, determine the subgraph structure and starting node corresponding to the natural language, and determine the retrieval path based on the subgraph structure and starting node.

[0074] The service support layer, through the integration of data and services, supports related applications in the upper-layer applications, providing various services and shared resources required by the applications. This includes a semantic parsing module, a graph library query statement generation module, and a graph data parsing module.

[0075] The semantic parsing module uses a pre-trained semantic parsing model to process the natural language input by the user, including operations such as intent recognition, feature extraction, and resource mapping.

[0076] The graph query statement generation module generates graph query statements by extracting subgraph structures, determining starting nodes, and selecting the optimal path from the results of semantic parsing.

[0077] The graph data parsing module performs general parsing processing on the data returned by the graph database. It parses the raw data returned by the graph database into graph data. Graph data here is a type of data that meets a special data structure. It is a collection of points and edges, where a point = {unique identifier VID, label, attribute set}, an edge = {unique identifier EID, label, attribute set}, and an attribute = {key, value}. At this point, the data does not have business attributes.

[0078] Figure 2The data processing flowchart for the data retrieval system provided in this application shows that the presentation layer includes a user query module and a visualization module, the business support layer includes a retrieval module, and the service support layer includes a semantic parsing module, a graph library query statement generation module, and a graph data parsing module. The data storage layer stores a graph database (knowledge graph).

[0079] like Figure 2 As shown, the user inputs natural language into the user query module of the presentation layer. This natural language is then input into the semantic parsing module of the service support layer via the retrieval module of the business support layer. The semantic parsing module processes the user's input natural language using a pre-trained semantic parsing model, including intent recognition, feature extraction, and resource mapping, to obtain semantic parsing results. These results are then input into the graph query statement generation module. This module generates a graph query statement by extracting subgraph structures, determining starting nodes, and selecting the optimal path. The graph query statement is then input into the graph database of the data storage layer. The graph database returns query data to the graph data parsing module based on the query statement. The graph database parsing module performs general parsing on the raw data returned by the graph database to obtain graph data, which is then returned to the retrieval module. The retrieval module performs validation, formatting, and data processing on the input and output data, and performs business processing on the returned data, including assembling exploration paths, flattening the first-degree nodes of intent nodes into attributes, and inputting these attributes into the visualization module. The visualization module is responsible for displaying the data, including the data of each entity, the relationship data between entities, the first-degree attributes of intent nodes, and their values, all displayed in a flat, visualized manner. The optimal path selection refers to the process of determining the optimal path based on the priority of attributes and the priority of points and edges, which may be multiple paths in the extracted subgraph structure. This aims to improve the query performance of the graph database by prioritizing filtering conditions with high discriminative power. For example, in the query "father of a male with a height of about 180 cm and whose place of origin is Shaoxing City", place of origin and father are parsed into edge structures, while height and male are parsed into attributes height and gender. Height has a higher discriminative power than gender, and father is the intent node. The optimal path selected is place of origin => entity (height, male) => father.

[0080] In this application, the service support layer is specifically used to perform intent recognition, element extraction, and resource mapping on natural language based on a pre-trained semantic parsing model, determine relation triples and attribute triples, determine the subgraph structure and starting node based on the relation triples and attribute triples, and determine the retrieval path based on the subgraph structure and starting node.

[0081] Optionally, the training process of the semantic parsing model can be as follows: a natural language sample set is collected in advance, in which each natural language sample set is labeled with an entity, the relationship between entities, attributes and attribute values, and the semantic parsing model is trained based on the natural language sample set and the labeled information.

[0082] Based on a pre-trained semantic parsing model, semantic parsing is performed on natural language to extract entities, relationships between entities, attributes, and attribute values. Triple information is determined based on the entities, relationships between entities, attributes, and attribute values ​​in the natural language. Triple information includes relation triples and attribute triples. For example, a relation triple is (entity 1, relation, entity 2), and an attribute triple is (entity, attribute, attribute value).

[0083] Figure 3 This is a schematic diagram illustrating the process of generating triplet information provided in this application, such as... Figure 3 As shown, it includes natural language input (original query text), intent recognition, entity extraction, entity standardization, relation extraction, entity and relation mapping, entity and relation association, and triple information generation.

[0084] Intent recognition: Identify the intent in natural language and filter out the entities that need to be displayed from multiple entities in natural language.

[0085] Entity extraction: Extracting entities from the graph classification system, such as people and vehicles.

[0086] Entity standardization: Special entities need to be standardized, such as time range, age range, etc.

[0087] Relation extraction: Extract relational nouns, such as father, mother, etc.

[0088] Entity-relationship mapping, also known as resource mapping, involves mapping entities to corresponding nodes in the knowledge graph according to rules. For example, a person can be mapped to the Person defined in the graph. Similar entities and relationships can also be mapped, such as "father" and "dad" being mapped to the relationship "hasFather".

[0089] Entity and Relationship Association: Associating entities with relationships.

[0090] Triple information generation: Generate attribute triples and relation triples.

[0091] In the semantic parsing module, multiple triples and intent nodes are generated from natural language. The graph query statement generation module mainly generates graph query statements from triples and intent nodes. Optionally, the standard graph query language Gremlin statement can be used.

[0092] Unlike traditional entity retrieval which only returns a list of entities, this application primarily considers querying entity relationships with complex interrelationships, returning a list of entity relationships. Specifically, it returns all queried relationship paths, allowing for the parsing of exploration paths in subsequent operations.

[0093] Figure 4 This is a schematic diagram illustrating the process of generating a gallery query statement provided in this application, such as... Figure 4 As shown, the semantic parsing result (semantic parsing input parameter) is first passed in. Based on the semantic parsing result, the triple information and intent node are determined. The subgraph structure is extracted based on the triple information. The starting node is determined based on the subgraph structure and intent node. The optimal retrieval path is selected based on the starting node. The full path graph query language Gremlin statement is generated based on the optimal retrieval path.

[0094] In this application, by constructing a type of business data, it is possible to display both the exploration path of intent nodes and the attributes and attribute values ​​after flattening the first-degree relationship of intent nodes.

[0095] Specifically, in the semantic parsing module, multiple triples and intent nodes are generated from the natural language text. The triples are then used to extract relation sets, and exploration paths are generated using these relation sets and the original graph database. The first-degree relations of the intent nodes are then queried again, flattened into attribute sets, and finally, the attribute sets of the intent nodes and the exploration path data are assembled and returned to the visualization module.

[0096] In this application, the service support layer is specifically used to determine the relation set and intent node based on the relation triples and attribute triples. In the relation set, it searches for point data starting from the intent node, and uses the point data as the starting node to search for its point data until there is no point data. It records the searched relations to obtain the relation chain, and searches for the point data and relation data of the relations in the relation chain from the knowledge graph to obtain subgraph data. It determines the retrieval path based on the subgraph structure.

[0097] Figure 5 A schematic diagram of the retrieval path generation process provided in this application is shown below. Figure 5 As shown, the relationship set and intent node are determined based on the triple information. It is then determined whether the intent node has pair data. If so, the relationship is added to the relationship chain, and the pair data is assigned to the intent node. The relationship set and intent node are traversed in a loop. If not, the node relationship chain is returned, and the path is explored based on the node relationship chain and the original graph data.

[0098] The triplet information is extracted based on the semantic parsing results.

[0099] The graph data parsing module returns the original graph data.

[0100] Extract the relationship set and intent node from the triple information.

[0101] The relationship chain of intent nodes is generated by using a relationship set and intent nodes. The specific process is as follows: starting from the intent node in the relationship set, search for the corresponding data, and then use the corresponding data as the starting node to search for its corresponding data, until there is no more corresponding data. Record the searched relationships, which is the relationship chain of the node.

[0102] The point data and relationships in the relationship chain can all be found in the corresponding detailed data from the original graph data, similar to subgraph data. This data is the exploration path of the intent node.

[0103] Figure 6 A schematic diagram illustrating the process of tiling the first-degree relationship of nodes provided in this application is shown below. Figure 5 As shown, the parameters passed to the semantic parsing process extract triple information. The intent node is then extracted from the triple information. The intent node queries its first-degree relation. This first-degree relation is flattened into attributes; specifically, the edge names of the first-degree relation are constructed as attributes, and the default attributes of the corresponding nodes are constructed as attribute values, assembling them into an attribute set. The flattened attributes of the first-degree node are combined with the node's own attributes to form the final node attribute set. The final data includes the exploration path for displaying the intent node and the flattened attribute set of the intent node's first-degree relation.

[0104] Figure 7 This is a schematic diagram illustrating the data retrieval effect provided in this application. Figure 7 The top side includes the search entry point for the user query module, where the input natural language is, for example, "Zhang Xiaolei's father's brother's son's colleague." The bottom side is the visualization module. The left side of the visualization module shows the search path visualization, which optionally uses the network tool in vis.js to render the exploration path. The right side of the visualization module shows the attributes of the intent node "Zhang San" itself and the attribute set of the first-degree relationship tiling.

[0105] This application uses semantic parsing as the retrieval method for knowledge graphs. It possesses a certain degree of reasoning ability, understanding the meaning of user-input natural language, making retrieval more accurate and efficient. It can achieve not only single-entity retrieval but also entity relationship retrieval. For example, it can retrieve information such as "Zhang San," "Zhang San's father's colleague," "women aged 10-20," and "men from Zhejiang Province with a height greater than 180cm." Semantic parsing provides a certain degree of error tolerance for input, making it more flexible. For instance, "Zhang San's father" and "Zhang San's father" are mapped to the same relational elements through semantic analysis, resulting in identical retrieval results. The visualization module not only displays the attributes of the nodes themselves but also flattens the first-degree relationships of the nodes as attributes, and shows the reasoning process (i.e., the exploration path), closely aligned with the user's perspective, offering a user-friendly and efficient data display.

[0106] Figure 8 The data retrieval process provided for this application includes the following steps:

[0107] S101: Perform semantic parsing on the input natural language, determine the retrieval path, and generate a library query statement based on the retrieval path, wherein the retrieval path includes each entity and the relationship between the entities.

[0108] S102: Retrieve data on each entity and the relationships between the entities according to the library query statement.

[0109] S103: Visualize the data of each entity and the data on the relationships between the entities.

[0110] Semantic parsing of the input natural language to determine the retrieval path includes:

[0111] Based on a pre-trained semantic parsing model, intent recognition, element extraction, and resource mapping are performed on the natural language to determine the subgraph structure and starting node corresponding to the natural language, and the retrieval path is determined based on the subgraph structure and starting node.

[0112] Performing intent recognition, feature extraction, and resource mapping on natural language, and determining the subgraph structure and starting node corresponding to the natural language includes:

[0113] The natural language is subjected to intent recognition, element extraction and resource mapping to determine relation triples and attribute triples, and the subgraph structure and starting node are determined based on the relation triples and attribute triples.

[0114] The subgraph structure and starting node are determined based on relation triples and attribute triples. The retrieval path is then determined based on the subgraph structure and starting node, including:

[0115] The relation set and intent node are determined based on relation triples and attribute triples. In the relation set, the corresponding data is searched starting from the intent node. The corresponding data is used as the starting node to search for its corresponding data until no corresponding data is found. The searched relations are recorded to obtain the relation chain. The corresponding data and relation data of the relations in the relation chain are searched from the knowledge graph to obtain the subgraph data. The retrieval path is determined based on the subgraph structure.

[0116] The method further includes:

[0117] Retrieve the first-degree attributes and their values ​​of the intent node; and display the first-degree attributes and their values ​​in a tiled visualization.

[0118] Figure 9 The schematic diagram of the data retrieval device provided in this application shows that the device includes:

[0119] The determination module 91 is used to perform semantic parsing on the input natural language, determine the retrieval path, and generate a library query statement based on the retrieval path, wherein the retrieval path includes various entities and the relationships between the various entities;

[0120] The retrieval module 92 is used to retrieve data on each entity and the relationships between the entities according to the library query statement.

[0121] Display module 93 is used to visualize the data of each entity and the data on the relationships between the entities.

[0122] The determination module 91 shown is specifically used to perform intent recognition, element extraction and resource mapping on the natural language based on a pre-trained semantic parsing model, determine the subgraph structure and starting node corresponding to the natural language, and determine the retrieval path based on the subgraph structure and starting node.

[0123] The determination module 91 shown is specifically used to perform intent recognition, element extraction and resource mapping on the natural language, determine relation triples and attribute triples, and determine the subgraph structure and starting node based on the relation triples and attribute triples.

[0124] The determination module 91 shown is specifically used to determine the relationship set and intent node based on the relationship triple and attribute triple. In the relationship set, it searches for point data starting from the intent node, and uses the point data as the starting node to search for its point data until there is no point data. It records the searched relationships to obtain a relationship chain, and searches for the point data and relationship data of the relationships in the relationship chain from the knowledge graph to obtain subgraph data. It determines the retrieval path based on the subgraph structure.

[0125] The retrieval module 92 is also used to retrieve the first-degree attribute and the first-degree attribute value of the intent node;

[0126] The display module 93 is also used to perform a tiled visualization of the first-degree attribute and the first-degree attribute value of the intent node.

[0127] This application also provides an electronic device, such as Figure 10 As shown, it includes: processor 301, communication interface 302, memory 303 and communication bus 304, wherein processor 301, communication interface 302 and memory 303 communicate with each other through communication bus 304;

[0128] The memory 303 stores a computer program, which, when executed by the processor 301, causes the processor 301 to perform any of the above method steps.

[0129] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0130] Communication interface 302 is used for communication between the above-mentioned electronic device and other devices.

[0131] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0132] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0133] This application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform any of the above method steps.

[0134] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0135] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data retrieval system, characterized in that, The system includes: Data storage layer, used to store knowledge graphs; The service support layer is used to perform intent recognition, element extraction, and resource mapping on natural language based on a pre-trained semantic parsing model. It determines relation triples and attribute triples, establishes relation sets and intent nodes based on these triples, searches for corresponding data points starting from intent nodes within the relation set, and continues searching for corresponding data points from these nodes until no more data points are found. The searched relations are recorded to obtain a relation chain. Based on the corresponding data points and relation data in the relation chain, a search is performed on the knowledge graph to obtain subgraph data. A retrieval path is determined based on the subgraph structure, and a library query statement is generated based on the retrieval path. The retrieval path includes each entity and the relationships between these entities. The business support layer is used to retrieve data of each entity and the relationship data between the entities according to the library query statement. The presentation layer is used to visualize the search entry point, the data of each entity, and the relationship data between the entities.

2. The system as described in claim 1, characterized in that, The business support layer is also used to retrieve the first-degree attribute and the first-degree attribute value of the intent node; The presentation layer is also used to provide a tiled visualization of the first-degree attributes and their values ​​for the intent node.

3. A data retrieval method, characterized in that, The method includes: Based on a pre-trained semantic parsing model, the input natural language is subjected to intent recognition, element extraction, and resource mapping to determine relation triples and attribute triples. A relation set and intent nodes are then determined based on these relation triples and attribute triples. Within the relation set, data pairs are searched starting from the intent nodes, using each data pair as a starting node to search for its corresponding data pair, until no data pairs remain. The searched relations are recorded to obtain a relation chain. Based on the data pairs and relations within the relation chain, a search is performed on the knowledge graph to obtain subgraph data. A retrieval path is determined based on the subgraph structure, and a library query statement is generated based on the retrieval path. The retrieval path includes each entity and the relationships between these entities. Retrieve data on each entity and the relationships between them based on the library query statement. The data of each entity and the data on the relationships between the entities are visualized.

4. The method as described in claim 3, characterized in that, The method further includes: Retrieve the first-degree attribute and first-degree attribute value of the intent node; perform a tiled visualization display of the first-degree attribute and first-degree attribute value of the intent node.

5. A data retrieval device, characterized in that, The device includes: The determination module is used to perform intent recognition, element extraction, and resource mapping on the input natural language based on a pre-trained semantic parsing model, determine relation triples and attribute triples, determine relation sets and intent nodes based on the relation triples and attribute triples, search for point data starting from the intent node in the relation set, and search for point data of its starting node until no point data is found, record the searched relations to obtain a relation chain, search for point data and relation data of the relations in the relation chain from the knowledge graph to obtain subgraph data, determine the retrieval path according to the subgraph structure, and generate a library query statement according to the retrieval path, wherein the retrieval path includes each entity and the relationships between the various entities; The retrieval module is used to retrieve data on each entity and the relationships between the entities based on the library query statement. The display module is used to visualize the data of each entity and the relationship data between the entities.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 3-4.

Citation Information

Patent Citations

  • Data retrieval and visualization system based on knowledge graph

    CN108920716A

  • Knowledge graph query statement generation method and device, equipment and storage medium

    CN112818092A