Intelligent retrieval and reasoning generation method and system based on knowledge graph and geoscience

By constructing a geoscience knowledge graph and a text corpus, and combining it with an embedded vector model for retrieval and visualization, the problems of opaque semantic retrieval and insufficient node information are solved, achieving highly accurate and transparent information acquisition.

CN121212352APending Publication Date: 2025-12-26SHANGHAI JIAOTONG UNIV

Patent Information

Application Number
CN202511400664.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing technologies, the semantic retrieval process is opaque, the knowledge graph node information is insufficient, making it difficult to meet high-level retrieval needs, and failing to effectively utilize textual knowledge to enrich node information.

Method used

We construct a geoscience knowledge graph and a text corpus, call the embedding vector model to generate node and text paragraph embedding vectors, perform retrieval through cosine similarity, and organically integrate and visualize the results.

Benefits of technology

It improves the accuracy and transparency of searches, enhances user interactivity, provides more comprehensive information support, and improves the efficiency of information acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121212352A_ABST
    Figure CN121212352A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent retrieval and reasoning generation method and system based on a knowledge graph and geoscience, and the method comprises the steps: firstly constructing a geoscience knowledge graph according to the information of a geoscience data set; secondly, identifying a key intention of the geographical question sentence; then, knowledge graph embedding work is carried out based on the entity relation structure of the knowledge graph, cross-entity potential relation and global information are captured, and reasoning from geoscience explicit data to deep knowledge is achieved; and finally, fusing a map result and a character result to carry out multi-domain retrieval so as to obtain an answer. Compared with an existing question answering system, the brand-new knowledge graph intelligent question answering system is constructed, the recall of answers can be improved, the knowledge reasoning ability is achieved, implicit internal association can be mined through explicit geoscience data, and geoscience experts can be helped to quickly and accurately find a target data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of knowledge graph and embedded vector technology, specifically, it relates to a method and system for intelligent retrieval and reasoning generation based on knowledge graph and geoscience, and in particular, a method and visualization system for intelligent geoscience retrieval and reasoning generation based on knowledge graph and geoscience literature. Background Technology

[0002] In today's digital age, the open internet and industry databases have accumulated massive amounts of textual data, covering academic literature, industry reports, technical documents, policy texts, and other fields. This data is a core resource for scientific research and innovation, business decision-making, and knowledge acquisition. However, this type of data suffers from several problems, such as fragmented distribution (scattered across different platforms with inconsistent formats), weak semantic connections (textual content often exists as independent texts, lacking structured connections between entities and relationships), and significant quality stratification (containing redundant information, ambiguous expressions, and differences in domain terminology). These problems lead to a triple challenge for users when searching for target information: "inaccurate search, incomplete search, and incomprehensible search." Users struggle to quickly locate results that meet their semantic needs and cannot clearly trace the logic of the search process, severely hindering the efficiency of value conversion from textual data.

[0003] In the ever-evolving development of retrieval technology, traditional text retrieval systems have long relied primarily on keyword matching technology, using precise or fuzzy matching at the character level to filter results. However, this approach has significant limitations: First, it struggles to capture the deep semantics inherent in text; for example, it cannot accurately identify the semantic connection between "artificial intelligence" and "core technologies of machine learning"; it also struggles to effectively handle polysemous words, such as "apple," which can refer to both fruit and a company, resulting in persistently high false negative and false positive rates. Second, it lacks the ability to structurally organize entities, attributes, and relationships within textual data, making it difficult to meet users' advanced retrieval needs such as "precise semantic matching and related knowledge mining."

[0004] With the continuous progress and innovative integration of knowledge graph and deep learning technologies, text retrieval systems based on knowledge graphs have gradually emerged and been applied. Knowledge graphs cleverly construct structured networks of entities, relationships, and attributes, providing a solid semantic foundation for these textual data. Simultaneously, embedded vector semantic retrieval technology has emerged. It maps text and knowledge graph entities to low-dimensional vector spaces, and then uses vector similarity calculation to achieve semantic matching. This technology successfully overcomes the semantic barriers faced by traditional keyword retrieval, significantly improving retrieval accuracy and enabling text retrieval to more precisely target information.

[0005] For example, patent document CN116955558A discloses a geoscientific dataset question-answering method and system based on knowledge graph reasoning. The method includes: constructing a geoscientific knowledge graph based on geoscientific dataset information; training a named entity recognition model to perform semantic understanding and information extraction of questions based on the key intent of the geoscientific dataset questions; aligning geographical entities by fusing textual and spatiotemporal information; embedding the knowledge graph based on its entity relationship structure to capture potential cross-entity relationships and global information, achieving knowledge reasoning from explicit geoscientific data to deep knowledge; and fusing the alignment and reasoning results for multi-domain retrieval to obtain the dataset answer. This method constructs a novel knowledge graph-based intelligent question-answering system, which improves answer recall compared to existing question-answering systems while possessing knowledge reasoning capabilities. It can mine implicit intrinsic relationships from explicit geoscientific data, helping geoscientific experts quickly and accurately find target datasets.

[0006] For example, patent document WO2025111795A1 discloses a medical entity retrieval method and system based on knowledge graph embedding and keywords, including query tag tree generation, query tag tree filtering, and query result sorting. It generates a corresponding knowledge graph embedding retrieval formula by parsing the natural language of the query, then calculates the result in a vectorized knowledge graph, and saves the retrieval result in a tree structure. Next, query intents that cannot be generated into the knowledge graph embedding retrieval formula are used as keywords, and neighbors of these keywords are searched in the medical knowledge graph to further filter the query tag tree. The results are sorted by the spatial distance of nodes in the tag tree within the vectorized knowledge graph, and the retrieval results are returned. This method uses a keyword container to store some word information that cannot be directly used to generate the retrieval formula, avoiding the loss of key information, and uses the keywords stored in the keyword container to filter nodes, which can reduce useless information in the returned content.

[0007] However, the current mainstream technical solutions still have two major technical flaws: Firstly, the semantic retrieval process lacks transparency. The current system only displays the final search results to the user, failing to effectively present the intermediate core data. Key information such as the vector matching process between text and knowledge graph entities, the filtering logic for inter-entity association paths, and the basis for calculating semantic similarity are all hidden. This prevents users from verifying the reasonableness of the search results or adjusting their search strategies based on the intermediate processes, significantly reducing the credibility and interactivity of the search service.

[0008] Secondly, knowledge graphs suffer from insufficient information capacity at their nodes and fail to effectively complement textual knowledge. The core value of knowledge graphs lies in their structured representation of entities and relationships. However, limited by their construction logic and storage methods, their nodes typically contain only concise information such as entity names and basic attributes (e.g., "publication time" and "domain"), making it difficult to carry in-depth content such as detailed descriptions, contextual background, and domain-specific interpretations. This in-depth information is abundant in textual data, yet existing systems fail to fully utilize textual knowledge to fill the information gaps in knowledge graph nodes or enrich the semantic dimension of nodes through textual data. For example, they lack the academic literature excerpts to supplement the principle description of the "blockchain technology" node. This makes it difficult for knowledge graphs to provide comprehensive information support in semantic retrieval, thus affecting the semantic richness of embedded vector matching and the practicality of retrieval results.

[0009] Therefore, with the increasing demand for massive amounts of text data and the continuous development of semantic retrieval technology, there is an urgent need to build a text retrieval system that integrates knowledge graphs and embedded vector semantic retrieval technologies and visualizes intermediate data. This has become a key direction for solving existing retrieval pain points and improving information acquisition efficiency. Summary of the Invention

[0010] To address the shortcomings of existing technologies, the purpose of this invention is to provide an intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences, comprising: Step S1: Construct a geoscience knowledge graph and a text corpus based on information from geoscience datasets; Step S2: For knowledge graph nodes and text corpus paragraphs, call the embedding vector model to generate embedding vectors for the nodes and text paragraphs; Step S3: Call the entity extraction model to extract entities from the user question and generate the embedding vector of the user question; Step S4: Based on the principle of vector cosine similarity, node embedding vectors are used to retrieve knowledge graphs, while user question embedding vectors are used to retrieve text paragraphs. Step S5: The search results, the results after graph structure alignment, and the text results are organically integrated. Then, prompt words are injected into the integrated results, and answer reasoning is carried out based on this information. Step S6: Integrate the intermediate and final search results and visualize them on the website front end.

[0011] Preferably, step S1 includes the following steps: Step S101: Construct a geoscience knowledge graph; Based on massive geoscience literature, utilize the semantic and entity extraction capabilities of large models to extract triples, and simultaneously map the source text paragraph information of the triples to form a complete knowledge graph, as shown in the following formula:

[0012] in, The total number of documents, Representing the The number of paragraphs in a document Representing the The first paper One paragraph, Represents large model tools, This is the final set of triples; Step S102: Construct a geoscientific text corpus; For geoscientific literature, use text segmentation tools to divide the articles into individual paragraphs containing complete information, and simultaneously map the original text corresponding to these paragraphs to form a preliminary text corpus, as shown in the following formula:

[0013]

[0014] in, Represents the i-th document, Let i be the set of segments corresponding to the i-th document. Represents the i-th specific document. Each segment is represented by a text segmentation tool (T).

[0015] Preferably, step S2 includes the following steps: Step S201: Generate embedding vectors for the graph nodes. Call the embedding vector generation model to generate an embedding vector for each node name, establish a mapping relationship with the node, and save it to the database; form a unit storage element in the vector database, as shown in the following formula:

[0016] in, For article metadata, The source segment is a triplet. Graph nodes The embedding vector corresponding to the node; Step S202: Generate embedding vectors for text paragraphs; call the embedding vector generation model to generate embedding vectors for each text paragraph, establish a mapping relationship with the text paragraphs, and save them to the database. The unit storage element representation in the vector database is shown in the following formula:

[0017] Where i represents the original information of the article, j represents the text paragraph, and e represents the embedding vector corresponding to the paragraph.

[0018] Preferably, step S3 includes the following steps: Step S301: Addressing user issues Entity extraction is performed; leveraging the large model's own knowledge reserves and semantic understanding capabilities, entities are extracted from the user's question, and then the vectorization model is invoked to vectorize the entities:

[0019] Where E is the entity set, L is the large model tool, and Q is the user question. The entity to be extracted; After extracting entities, the embedding vector generation tool is called to vectorize the extracted entities for subsequent node retrieval.

[0020] Preferably, step S4 includes the following steps: Step S401: Node retrieval; embedding vector for each entity. and knowledge graph node vectors The cosine similarity between two vectors is defined using the following formula:

[0021] Where A·B is the dot product of vectors A and B. To calculate the sum of corresponding elements, and Let represent the Euclidean magnitudes of the vectors, respectively. Step S402: Paragraph similarity retrieval; First, the text embedding vector generation model is called to generate an embedding vector for the user's question. Then, the HNSW algorithm is used to retrieve the vector corresponding to the most similar text paragraph.

[0022] Preferably, step S402 specifically refers to first constructing an HNSW index, which includes a multi-level navigation graph, before the retrieval. ,in Indicates the first A layered graph structure, starting from any node in the highest layer, initializes the candidate set. and result set For each layer from the highest layer to the second layer, update the candidate set using the following formula:

[0023] Among them, dist( () is the Euclidean distance function, which selects the nearest node from the candidate set as the entry point for the next layer node; Secondly, a more refined search is performed at the lowest level of the first layer, expanding the candidate set to all reachable nodes. Calculate the results of all nodes in the result set and the query vector, and update the result set. ,in It is the point with the furthest distance from the current result set; Then, sort the result set in ascending order of distance and return the first k vectors, as shown in the following formula:

[0024] Finally, after the retrieval is complete, the text segment will be used in the inference stage to provide knowledge for the large model.

[0025] Preferably, step S5 includes the following steps: Step S501: Graph triples are textualized; the graph triples are graph structure data and need to be converted into natural language to align with the semantic capabilities of the large model; each graph triple consists of entity 1, relation and entity 2, which are described using natural language. Step S502: Graph and Text Injection of Cue Words; Before using the large model to answer the user's question, graph and text information are injected into the cue words. The cue words add guiding information to the graph and text information, guiding the large model to use the above information to obtain the reasoning answer. The process is shown in the following formula:

[0026] Where G represents the textualized graph subgraph, T represents the text retrieval results, Q represents the user question, P represents the prompt word, LLM is the large model tool, and A is the inferred answer.

[0027] Preferably, step S6 includes the following steps: Step S601: Process Visualization; During the retrieval process, multiple aspects of data are involved, including: the overall knowledge graph, used to form a macroscopic understanding of the knowledge domain; the retrieved knowledge subgraphs, which help users to understand the sub-domains they want to learn about in more detail; and the retrieved text segments, which provide some academic reference knowledge. At the same time, in order to ensure the normal operation of the system, when faced with a large-scale knowledge graph, the system will perform targeted phases. Specifically, it will aggregate the embedding vectors of all nodes and select a few relatively concentrated nodes for display. This ensures that the overall knowledge graph seen by the user does not lose its original macroscopic features, while also highlighting some central nodes of the graph, helping users understand important entities in the sub-domain. Step S602: Result visualization; Input the knowledge graph information and literature information together with the question into the large model for reasoning. The large model mainly uses the retrieved information and combines it with its own embedded knowledge to answer the question.

[0028] Preferably, step S401 specifically refers to, Embedded vector for each entity And retrieve the top k most similar nodes in the knowledge graph, as shown in the following formula:

[0029] in, Represents a set of knowledge graph nodes. Indicates a subset to be retrieved. Represents the k nodes with the highest cosine similarity; After obtaining the most similar graph node, a one-hop expansion is performed on the node to obtain the evidence subgraph corresponding to a single node, as shown in the following formula:

[0030] in, These represent the head element, relation, and tail element of a triple, respectively. This represents a triple with the topk node as its head node. This represents a three-element array with the topk node as its tail element. Finally, by piecing together the evidence subgraphs of all nodes, the final retrieval subgraph can be obtained.

[0031] This invention proposes an intelligent retrieval and reasoning generation system based on knowledge graphs and geosciences, employing the steps of a knowledge graph and geosciences-based intelligent retrieval and reasoning generation method, including: Module M1: Constructs geoscience knowledge graphs and text corpora based on information from geoscience datasets; Module M2: For knowledge graph nodes and text corpus paragraphs, it calls the embedding vector model to generate embedding vectors for the nodes and text paragraphs; Module M3: Calls the entity extraction model to extract entities from the user question and generates the embedding vector of the user question; Module M4: Based on the principle of vector cosine similarity, it uses node embedding vectors to perform knowledge graph retrieval, and uses user question embedding vectors to achieve text paragraph retrieval. Module M5: The search results, after being aligned with the graph structure, are organically integrated with the text results. Then, prompt words are injected into the integrated results, and answer reasoning is performed based on this information. Module M6: Integrates intermediate and final search results and visualizes them on the website front end.

[0032] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention can ensure the accuracy of retrieval and the ability to mine related knowledge through knowledge graph and embedded vector technology, and can also improve the transparency of the retrieval process and user interactivity through intermediate data visualization. It is of great significance and practical value to meet the high-quality retrieval needs of scientific research, industry, learning and other scenarios.

[0033] 2. This invention constructs a brand-new knowledge graph intelligent question-answering system. Compared with existing question-answering systems, this system can significantly improve the completeness of answers and provide users with more comprehensive and richer information retrieval results.

[0034] 3. The system constructed by this invention has powerful knowledge reasoning capabilities. It can mine implicit intrinsic relationships between data by performing deep learning on explicit data. In particular, it can help geoscientists find target datasets quickly and accurately. Attached Figure Description

[0035] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating the intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences proposed in this invention. Figure 2 This is a schematic diagram of the knowledge graph retrieval algorithm flow of the intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences proposed in this invention; Figure 3 This is a schematic diagram of the text retrieval algorithm of the intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences proposed in this invention. Detailed Implementation

[0036] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0037] This invention proposes an intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences, as shown in the appendix. Figure 1 As shown, it includes: Step S1: Construct a geoscience knowledge graph and a text corpus based on information from geoscience datasets; Step S1 includes the following steps: Step S101: Construct a geoscience knowledge graph; Based on massive geoscience literature, utilize the semantic and entity extraction capabilities of large models to extract triples, and simultaneously map the source text paragraph information of the triples to form a complete knowledge graph, as shown in the following formula:

[0038] in, The total number of documents, Representing the The number of paragraphs in a document Representing the The first paper One paragraph, Represents large model tools, This is the final set of triples.

[0039] Step S102: Construct a geoscientific text corpus; For geoscientific literature, use text segmentation tools to divide the articles into individual paragraphs containing complete information, and simultaneously map the original text corresponding to these paragraphs to form a preliminary text corpus, as shown in the following formula:

[0040]

[0041] in, Represents the i-th document, Let i be the set of segments corresponding to the i-th document. Represents the i-th specific document. Each segment is represented by a text segmentation tool (T).

[0042] Step S2: For knowledge graph nodes and text corpus paragraphs, call the embedding vector model to generate embedding vectors for the nodes and text paragraphs; Further, step S2 includes the following steps: Step S201: Generate embedding vectors for the graph nodes. Call the embedding vector generation model to generate an embedding vector for each node name, establish a mapping relationship with the node, and save it to the database. This forms a unit storage element in the vector database, as shown in the following formula:

[0043] in, For article metadata, The source segment is a triplet. Graph nodes This is the embedding vector corresponding to the node.

[0044] Step S202: Generate embedding vectors for text paragraphs; call the embedding vector generation model to generate embedding vectors for each text paragraph, establish a mapping relationship with the text paragraphs, and save them to the database. The unit storage element representation in the vector database is shown in the following formula:

[0045] Where i represents the original information of the article, j represents the text paragraph, and e represents the embedding vector corresponding to the paragraph.

[0046] Step S3: Call the entity extraction model to extract entities from the user question and generate the embedding vector of the user question; Further, step S3 includes the following steps: Step S301: Addressing user issues Entity extraction is performed. Leveraging the large model's inherent knowledge and semantic understanding capabilities, entities are extracted from the user's question, and then a vectorization model is invoked to vectorize these entities.

[0047] Where E is the entity set, L is the large model tool, and Q is the user question. The entity to be extracted; After extracting entities, the embedding vector generation tool is called to vectorize the extracted entities for subsequent node retrieval.

[0048] Step S4: Based on the principle of vector cosine similarity, node embedding vectors are used to retrieve knowledge graphs, while user question embedding vectors are used to retrieve text paragraphs. Step S4 includes the following steps: Step S401: Node retrieval; embedding vector for each entity. and knowledge graph node vectors The cosine similarity between two vectors is defined using the following formula:

[0049] Where A·B is the dot product of vectors A and B. To calculate the sum of corresponding elements, and Let represent the Euclidean magnitudes of the vectors.

[0050] Embedded vector for each entity And retrieve the top k most similar nodes in the knowledge graph, as shown in the following formula:

[0051] in, Represents a set of knowledge graph nodes. Indicates a subset to be retrieved. This represents the k nodes with the highest cosine similarity.

[0052] After obtaining the most similar graph node, a one-hop expansion is performed on the node to obtain the evidence subgraph corresponding to a single node, as shown in the following formula:

[0053] in, These represent the head element, relation, and tail element of a triple, respectively. This represents a triple with the topk node as its head node. This represents a three-element array with the topk node as its tail.

[0054] Finally, by piecing together the evidence subgraphs of all nodes, the final retrieval subgraph can be obtained.

[0055] Step S402: Paragraph Similarity Retrieval; First, the text embedding vector generation model is invoked to generate an embedding vector for the user's question. Then, the HNSW algorithm is used to retrieve the vector corresponding to the most similar text segment using this vector: First, an HNSW index, containing a multi-level navigation graph, is built before retrieval. ,in Indicates the first A layered graph structure, starting from any node in the highest layer, initializes the candidate set. and result set For each layer from the highest layer to the second layer, update the candidate set using the following formula:

[0056] Among them, dist( ) is the Euclidean distance function, which selects the nearest node from the candidate set as the entry point for the next layer of nodes.

[0057] Secondly, a more refined search is performed at the lowest level of the first layer, expanding the candidate set to all reachable nodes. Calculate the results of all nodes in the result set and the query vector, and update the result set. ,in It is the point that is furthest from the current result set.

[0058] Then, sort the result set in ascending order of distance and return the first k vectors, as shown in the following formula:

[0059] Finally, after the retrieval is complete, the text segment will be used in the inference stage to provide knowledge for the large model.

[0060] Step S5: The search results, the results after graph structure alignment, and the text results are organically integrated. Then, prompt words are injected into the integrated results, and answer reasoning is carried out based on this information. Further, step S5 includes the following steps: Step S501: Graph triples are textualized; the graph triples are graph structure data and need to be textualized into natural language to align with the semantic capabilities of the large model; each graph triple consists of entity one, relation and entity two, and entity one, relation and entity two are described using natural language.

[0061] Step S502: Graph and Text Injection of Cue Words; Before using the large model to answer the user's question, graph and text information are injected into the cue words. The cue words add guiding information to the graph and text information, guiding the large model to use the above information to obtain the reasoning answer. The process is shown in the following formula:

[0062] Where G represents the textualized graph subgraph, T represents the text retrieval results, Q represents the user question, P represents the prompt word, LLM is the large model tool, and A is the inferred answer.

[0063] Step S6: Integrate the intermediate and final search results and visualize them on the website front end; Step S6 includes the following steps: Step S601: Process Visualization; During the retrieval process, multiple aspects of data are involved, including: the overall knowledge graph, used to form a macroscopic understanding of the knowledge domain; the retrieved knowledge subgraphs, which help users to understand the sub-domains they want to learn about in more detail; and the retrieved text segments, which provide academic reference knowledge. At the same time, in order to ensure the normal operation of the system, when faced with a large-scale knowledge graph, the system will perform targeted phases. Specifically, it will aggregate the embedding vectors of all nodes and select relatively concentrated nodes for display. This ensures that the overall knowledge graph seen by the user does not lose its original macroscopic features, while also highlighting some central nodes of the graph, helping users understand important entities in the sub-domain.

[0064] Step S602: Result visualization; Input the knowledge graph information and literature information together with the question into the large model for reasoning. The large model mainly uses the retrieved information and combines it with its own embedded knowledge to answer the question.

[0065] This invention proposes an intelligent retrieval and reasoning generation system based on knowledge graphs and geosciences, employing the steps of an intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences, including: Module M1: Constructs geoscience knowledge graphs and text corpora based on information from geoscience datasets; Module M2: For knowledge graph nodes and text corpus paragraphs, it calls the embedding vector model to generate embedding vectors for the nodes and text paragraphs; Module M3: Calls the entity extraction model to extract entities from the user question and generates the embedding vector of the user question; Module M4: Based on the principle of vector cosine similarity, it uses node embedding vectors to perform knowledge graph retrieval, and uses user question embedding vectors to achieve text paragraph retrieval. Module M5: The search results, after being aligned with the graph structure, are organically integrated with the text results. Then, prompt words are injected into the integrated results, and answer reasoning is performed based on this information. Module M6: Integrates intermediate and final search results and visualizes them on the website front end.

[0066] To better illustrate or implement the method proposed in this invention, the following embodiments are provided: Example 1: This invention proposes an intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences, as shown in the appendix. Figure 2 As shown, it includes: Step S20010: Extract triples from geoscience literature to obtain triple information related to the geoscience field; Step S20020: Convert the extracted triples into node embedding vector data to complete the vectorization process of the triples; Step S20030: Perform entity extraction on the user question to obtain the entities involved in the user question; Step S20040: Convert the extracted entities into entity embedding vectors to achieve entity vectorization; Step S20050: Use entity embedding vectors to retrieve similar nodes in the node embedding vector data; Step S20060: Perform a one-hop expansion on the retrieved similar nodes to generate the corresponding evidence subgraph.

[0067] Example 2: This invention proposes an intelligent retrieval and reasoning generation method based on knowledge graphs and geosciences, as shown in the appendix. Figure 3 As shown, it includes: Step S30010: Process geoscientific literature into text blocks; Step S30020: Convert the text block into a text embedding vector; Step S30030: Store the text embedding vector in the vector database; Step S30040: Convert the user question into an embedding vector; Step S30050: Retrieve data from the vector database using the embedding vector of the user's question; Step S30060: Retrieve relevant text segments from the vector database.

[0068] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0069] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. An intelligent retrieval and reasoning generation method based on a knowledge graph and geosciences, characterized in that, Comprise: Step S1: constructing a geoscience knowledge graph and a text corpus according to geoscience dataset information; Step S2: calling an embedding vector model for knowledge graph nodes and text corpus paragraphs to generate embedding vectors for the nodes and text paragraphs; Step S3: calling an entity extraction model to extract entities from a user question and generate an embedding vector for the user question; Step S4: based on the vector cosine similarity principle, using node embedding vectors to search the knowledge graph, and using user question embedding vectors to search text paragraphs; Step S5: organically fusing the results obtained by searching, the results after aligning the graph structure, and the text results, then performing a prompt word injection operation on the fused results, and based on these information, performing answer reasoning; Step S6: integrating the intermediate and final results of the search and visualizing them to the website front end. 2.The knowledge graph and geoscience-based intelligent retrieval and reasoning generation method according to claim 1, characterized in that, The step S1 comprises the following steps: Step S101: constructing a geoscience knowledge graph; based on massive geoscience literature, using the semantic and entity extraction capabilities of a large model to extract triples, and mapping the source text paragraph information of the triples to form a complete knowledge graph, as shown in the following formula: wherein, is the total number of documents, represents the first paragraph of the document, represents the first paragraph of the document, represents the first paragraph of the document, is the final set of triples; Step S102: constructing a geoscience text corpus; for geoscience literature, using a text segmentation tool to segment articles into individual paragraphs containing complete information, and mapping the original text corresponding to these paragraphs to form a preliminary text corpus, as shown in the following formula: wherein, represents the i-th document, is the set of segments corresponding to the i-th document, represents the j-th segment of the i-th document, and T represents a text segmentation tool. 3.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method according to claim 1, characterized in that, The step S2 comprises the following steps: Step S201: generating embedding vectors for graph nodes; calling an embedding vector generation model to generate embedding vectors for each node name, and forming a mapping relationship with the node, and saving to the database; forming a unit storage element in the vector database, as shown in the following formula: wherein, is article meta information, is a triple source paragraph, is a graph node, is an embedding vector corresponding to the node; Step S202: generating embedding vectors for text paragraphs; calling an embedding vector generation model to generate embedding vectors for each text paragraph, and forming a mapping relationship with the text paragraph, and saving to the database; forming a unit storage element in the vector database, as shown in the following formula: Wherein, i is the original information of the article, j is the text paragraph, and e is the embedding vector corresponding to the paragraph. 4.The knowledge graph and geoscience-based intelligent retrieval and reasoning generation method of claim 1, wherein, The step S3 comprises the following steps: Step S301: performing entity extraction on the user question Entity extraction is performed on the user question, and a vectorization model is called to vectorize the entities. where E is a set of entities, L is a large model tool, and Q is a user question, is an extracted entity; After extracting the entities, calling an embedding vector generation tool to vectorize the extracted entities for subsequent node retrieval. 5.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method of claim 1, wherein, The step S4 comprises the following steps: Step S401: node retrieval; for each entity embedding vector and knowledge graph node vectors The cosine similarity of two vectors is defined using the cosine similarity, as shown in the following formula: where A B is the dot product of vectors A and B, are the corresponding elements of the sum, and denote the Euclidean norm of a vector, respectively. Step S402: paragraph similarity search; first, calling a text embedding vector generation model to generate an embedding vector for the user question, then using the vector to search for the most similar text paragraph vector using the HNSW algorithm. 6.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method according to claim 5, characterized in that, The step S402 specifically refers to first, searching and constructing a HNSW index in advance, containing a multi-layer navigation graph , wherein represents the graph structure of the i-th layer, starting from an arbitrary node in the highest layer, initializing a candidate set and a result set ; for each layer from the highest layer and the second layer, updating the candidate set by the following formula: ; for each layer from the highest layer and the second layer, updating the candidate set by the following formula: where dist( ) is the distance metric function Euclidean distance, and the node with the shortest distance is selected from the candidate set as the entry of the next layer node. Second, do a more refined search in the bottom layer of the first layer, expanding the candidate set to all reachable nodes ; compute the results of all nodes in the result set with the query vector, updating the result set where is the farthest point in the current result set Then, sorting the result set in ascending order of distance, and returning the top k vectors, as shown in the following formula: Finally, after the search is completed, the text paragraph is used in the reasoning stage to provide knowledge for the large model. 7.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method according to claim 1, characterized in that, The step S5 comprises the following steps: Step S501: textizing the graph triples; the graph triples belong to graph structure type data, which need to be naturalized to align with the semantic capabilities of the large model; each graph triple consists of entity one, relationship, and entity two, which are described using natural language; Step S502: Injecting graph and text into prompt words; before using a large model to answer user questions, inject graph information and text information into prompt words. The prompt words add guidance information for graph information and text information, guide the large model to use the above information to obtain reasoning answers, as shown in the following formula: Wherein, G represents the text of the graph subgraph, T represents the text of the search result, Q represents the user question, P represents the prompt word, LLM is the large model tool, and A is the reasoning answer. 8.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method of claim 1, wherein, The step S6 includes the following steps: Step S601: Process visualization; in the retrieval process, various data contents are involved, including: the overall knowledge graph, which is used to form a macroscopic understanding of the knowledge field; the knowledge subgraph after retrieval: to help users understand the subfield they want to understand more carefully; the text segment of the retrieval: to provide academic reference knowledge; at the same time, in order to ensure the normal operation of the system, when facing a relatively large knowledge graph, the system will be targeted to do the stage, specifically, the embedding vectors of all nodes are aggregated, and the more concentrated nodes are selected for display; Step S602: Result visualization; input the knowledge graph information and literature information together with the question into the large model for reasoning. The large model uses the retrieval information as the main and combines its own embedded knowledge to answer the question. 9.The knowledge graph and geoscience based intelligent retrieval and reasoning generation method according to claim 5, characterized in that, The step S401 specifically refers to obtaining each entity embedding vector and retrieving the topk most similar nodes in the knowledge graph, as shown in the following formula: wherein, denotes a set of knowledge graph nodes, denotes a subset of the search, denotes the k nodes with the largest cosine similarity; after obtaining the most similar graph nodes, one-hop expansion is performed on the nodes to obtain the evidence subgraph corresponding to a single node, as shown in the following formula: wherein, denotes the head element, the relation, the tail element in a triple, denotes a triple with the topk node as the head node, denotes a triple with the topk node as the tail element; finally, all the evidence subgraphs of all the nodes are spliced together to obtain the final search subgraph.

10. An intelligent retrieval and reasoning generation system based on a knowledge graph and geosciences, characterized in that, The steps of the knowledge graph and geoscience-based intelligent retrieval and reasoning generation method according to any one of claims 1-9, comprising: Module M1: constructing a geoscience knowledge graph and a text corpus according to geoscience dataset information; Module M2: calling an embedding vector model for knowledge graph nodes and text corpus paragraphs to generate embedding vectors for nodes and text segments; Module M3: calling an entity extraction model to extract entities from user questions and generate embedding vectors for user questions; Module M4: based on the vector cosine similarity principle, using node embedding vectors to retrieve the knowledge graph, and using user question embedding vectors to retrieve text paragraphs; Module M5: organically integrating the results obtained by retrieval, the results after graph structure alignment, and the text type results, then carrying out prompt word injection operation for the integrated results, and based on these information, carrying out answer reasoning; Module M6: integrating intermediate and final results in retrieval, and visualizing to the website front end.

Citation Information

Patent Citations

  • Geology data set question and answer method and system based on knowledge graph reasoning

    CN116955558A

  • Medical entity retrieval method based on knowledge graph embedding and key, and system therefor

    WO2025111795A1

Cited By

  • Fault knowledge graph question-answering system and method

    CN122196108A