An intelligent question and answer method and system fusing a rock knowledge graph

By constructing a rock knowledge graph and employing subject-triggered multi-relation joint extraction and R-GCN model for graph reasoning, the problems of multi-dimensional knowledge fusion and terminology inconsistency in rock question answering are solved, achieving efficient and accurate intelligent question answering, which is applicable to rock classification, engineering attribute query and geological risk assessment.

CN122452791APending Publication Date: 2026-07-24SHANDONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG UNIV
Filing Date
2026-06-29
Publication Date
2026-07-24

Smart Images

  • Figure CN122452791A_ABST
    Figure CN122452791A_ABST
Patent Text Reader

Abstract

The application provides an intelligent question and answer method and system fusing a rock knowledge graph, relates to the cross technical field of artificial intelligence and geological engineering, and aims at the problems of fragmented knowledge in the rock field, non-uniform terms, weak reasoning ability, weak professional property of intelligent question and answer, poor practicability and low accuracy. The method comprises the following steps: acquiring multi-source text data, and pre-processing the multi-source text data; performing sentence segmentation and standardization processing on the pre-processed multi-source text data; performing concurrent multi-relation triple extraction through a subject trigger type multi-relation joint extraction mechanism; constructing an ontology structure level, fusing the multi-relation triple, obtaining a rock knowledge graph, analyzing a user question and performing graph query, adopting an intention perception mechanism, performing graph reasoning on the graph retrieval content through an R-GCN model, and generating a natural language answer from the graph reasoning result. The application solves the problems of fragmented knowledge in the rock field and weak reasoning ability, and realizes accurate and rapid question answering in the rock field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of artificial intelligence and geological engineering, and in particular relates to an intelligent question-answering method and system that integrates rock knowledge graph. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Knowledge graphs, as a structured knowledge representation method, organize and express the relationships between knowledge through nodes and edges, and are now widely used in fields such as artificial intelligence, search engines, and recommendation systems. With the development of internet technology, information across industries is becoming increasingly digitized. However, traditional information acquisition methods relied heavily on paper materials, resulting in incomplete information retrieval and low efficiency. Furthermore, while traditional search engines were born from the internet, they rely solely on keyword matching, ignoring semantic context, making it difficult to handle complex logical reasoning needs. Users must manually sift through massive amounts of web links to find valid information, which is time-consuming and susceptible to irrelevant content.

[0004] Question-answering systems, leveraging natural language processing technology, overcome the limitations of traditional search. Through deep semantic analysis of user queries, they automatically generate answers from structured or unstructured data, providing precise structure rather than simply returning the source of information. This significantly improves knowledge acquisition efficiency and represents an upgrade from "information retrieval" to "knowledge answering."

[0005] In the field of engineering construction, rock, as a fundamental load-bearing medium, directly determines the stability and feasibility of a project through its mechanical properties, structural composition, and fracture distribution. Furthermore, the permeability and water sensitivity of rock affect groundwater control and the long-term operational safety of the project. In complex geological environments such as earthquakes and rockbursts, in-depth research into rock behavior is crucial for disaster prevention and ensuring construction safety. Therefore, rock research is not only a fundamental aspect of design and construction but also a vital support for risk management and performance optimization, and a foundation for ensuring the successful implementation of projects.

[0006] However, existing rock question-answering technologies still have certain shortcomings: they are limited to the simple inclusion of rock types and basic physical and mechanical properties, lacking in-depth integration of multi-dimensional knowledge; the application of knowledge graphs in the field of rock research is still in its infancy, with inconsistent terminology definitions, which limits knowledge expression and reasoning capabilities, resulting in weak professionalism, poor practicality, and low accuracy in intelligent question answering in the field of rocks. Summary of the Invention

[0007] To overcome the shortcomings of the existing technologies, this invention provides an intelligent question-answering method and system that integrates a rock knowledge graph. It performs semantic-level processing on multi-source data through a sentence boundary detection model and a pre-trained word vector model, and constructs a rock knowledge graph based on a subject-triggered multi-relation joint extraction mechanism, thereby achieving accurate and fast question answering in the field of rocks and effectively improving retrieval efficiency and accuracy.

[0008] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: The first aspect of this invention provides an intelligent question-answering method that integrates a rock knowledge graph, comprising: Acquire multi-source text data and preprocess the multi-source text data; A sentence boundary detection model and a pre-trained word vector model are used to perform sentence segmentation and standardization on the preprocessed multi-source text data. The subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from standardized multi-source text data. Construct an ontology structure hierarchy and merge it with multi-relation triples to obtain a rock knowledge graph; Based on a rock knowledge graph, user questions are parsed and graph queries are performed. An intent-aware mechanism is employed, and graph reasoning is performed on the graph retrieval content using the R-GCN model. A dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from the graph reasoning results, and the rock knowledge graph is updated based on user feedback on the natural language answers.

[0009] As one implementation method, preprocessing of multi-source text data is performed, specifically as follows: PyMuPDF is used to extract PDF text from multi-source text data while preserving the original text structure; The PDF text headers, footers, page numbers, non-semantic line breaks, and special symbols are thoroughly cleaned using regular expressions and Chinese word segmentation tools.

[0010] As one implementation method, a subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from standardized multi-source text data. The specific process is as follows: By using a binary classifier, all subject entity boundaries in the sentence are identified, and a set of candidate subjects is obtained. A self-attention mechanism between subjects is used to enhance the context of candidate subjects, resulting in enhanced subject representations. Based on the enhanced subject representation, a subject graph structure is constructed, and information is transmitted and aggregated through a graph neural network. Based on the subject graph structure, all relation categories corresponding to each subject are activated one by one, and a gating mechanism is used to fuse the subject representation and the context representation. The object position is identified by the object tagger corresponding to each relation of the subject, and candidate triples are generated by combining them. Domain rules are used to perform semantic normalization and redundancy cleanup on candidate triples to obtain multi-relation triples.

[0011] As one implementation method, the ontology structure hierarchy is constructed, and the specific process is as follows: Based on multi-relation triples, the frequency of entity occurrence is counted, and the nested structure of contextual semantics is parsed. Based on the contextual semantic nesting structure, the rock classification hierarchy is dynamically constructed using the sentence embedding clustering tree algorithm, and specific standard knowledge is integrated to obtain the initial ontology structure hierarchy; Based on the initial ontology structure hierarchy, a typical attribute field is extracted using an instance-oriented attribute fusion mechanism, and attribute modeling is performed using the Property Graph approach. By employing a relational semantic graph convolutional aggregation mechanism, semantic clustering and type normalization of relations are performed to obtain a set of relation types, thus completing relation modeling; Based on the initial ontology structure hierarchy, attribute modeling, and relationship modeling, the final ontology structure hierarchy is generated through a visual interface.

[0012] As one implementation method, an intent-aware mechanism is employed, using the R-GCN model to perform graph inference on the graph retrieval content. The specific process is as follows: The TransE graph embedding algorithm is used to vectorize the entities and relationships in the rock knowledge graph; A question intent prompting mechanism is adopted to embed the user's query intent into the entity vector and perform structure-aware path search; In structure-aware path search, for questions that are not matched in the query, a dynamic path template is constructed, and similarity retrieval technology is used to match the initial inference path; The initial inference path information is adjusted by using a weighted R-GCN model to obtain the final set of inference paths.

[0013] As one implementation method, a dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from graph reasoning results. The specific process is as follows: The graph reasoning results are parsed, and the entity nodes and relation types in the final reasoning path are mapped to a standard set of triples; Declarative sentences are generated by matching syntactic structures using rule templates and filling in standard triples. The text generation model converts declarative sentences into natural language answers and highlights key entities and relationships in the answers.

[0014] As one implementation method, the rock knowledge graph is updated based on user feedback on natural language answers. The specific process is as follows: Collect user feedback on natural language answers; Based on user feedback on natural language answers, a dictionary expansion mechanism is used to adjust the edge weights and relationship confidence of the rock knowledge graph.

[0015] A second aspect of the present invention provides an intelligent question-answering system that integrates a rock knowledge graph, comprising: The knowledge graph module is used to acquire multi-source text data and preprocess it. A sentence boundary detection model and a pre-trained word vector model are used to segment and standardize the preprocessed multi-source text data. A subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from the standardized multi-source text data. An ontology structure hierarchy is constructed and fused with the multi-relation triples to obtain the rock knowledge graph. The intelligent question answering module is used to parse user questions and perform graph queries based on the rock knowledge graph. It adopts an intent-aware mechanism and uses the R-GCN model to perform graph reasoning on the retrieved content. Based on a dual-channel strategy of rule templates and text generation model, it generates natural language answers from the graph reasoning results and updates the rock knowledge graph based on user feedback on the natural language answers.

[0016] A third aspect of the present invention provides a computer device including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to perform the steps of the method described in the first aspect of the present invention.

[0017] A fourth aspect of the present invention is to provide a computer-readable storage medium having a program stored thereon that, when executed by a processor, performs the steps described in the first aspect of the present invention.

[0018] The above one or more technical solutions have the following beneficial effects: In this embodiment, multi-source data such as rock classification, mineral composition, physical and mechanical parameters, engineering applications, and weathering characteristics are integrated to construct a rock knowledge system that is cross-document, cross-granularity, and semantically consistent. This achieves multi-dimensional knowledge fusion, overcomes the problem of single coverage in traditional knowledge graphs, and solves the problem of inconsistent terminology through normalization operations such as sentence boundary detection models and FastText pre-trained word vector models. This improves the semantic consistency of the knowledge graph and can comprehensively and effectively support induction, comparison, and reasoning in scientific research and applications.

[0019] In this embodiment, a subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples and fuse them into an ontology structure hierarchy to construct a rock knowledge graph for question retrieval. An improved TransE algorithm (embedded with question intent hints) and a weighted R-GCN model support semantic reasoning for complex queries. A dual-channel answer strategy is employed to generate answers, and the rock knowledge graph is dynamically updated based on user feedback. This addresses issues such as fragmented knowledge and weak reasoning capabilities in the rock domain, enabling accurate and rapid question answering in the rock field, replacing traditional manual retrieval, and improving retrieval efficiency and accuracy. It significantly enhances the professionalism, accuracy, and practicality of the intelligent question-answering system, possessing significant engineering application value and suitable for intelligent knowledge services in scenarios such as rock classification and identification, engineering attribute querying, and geological risk assessment.

[0020] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0021] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0022] Figure 1 This is a schematic diagram of the process of constructing a rock knowledge graph according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the intelligent question-answering process in the rock domain according to Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of an intelligent question-answering system that integrates a rock knowledge graph, according to Embodiment 2 of the present invention. Figure 4 This is a schematic diagram illustrating the extraction of multi-relation triples from standardized multi-source text data according to Embodiment 1 of the present invention. Figure 5 This is a schematic diagram illustrating the generation of natural language answers from the graph reasoning results of Embodiment 1 of the present invention. Detailed Implementation

[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0024] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.

[0025] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0026] Example 1 This embodiment discloses an intelligent question-answering method that integrates a rock knowledge graph.

[0027] To more clearly illustrate this embodiment, an intelligent question-answering process integrating a rock knowledge graph can be specifically described as follows: An intelligent question-answering method integrating a rock knowledge graph includes: S1. Obtain multi-source text data and preprocess the multi-source text data; S2. Sentence segmentation and standardization are performed on the preprocessed multi-source text data using a sentence boundary detection model and a pre-trained word vector model. S3. Through a subject-triggered multi-relation joint extraction mechanism, concurrently extract multi-relation triples from standardized multi-source text data; S4. Construct the ontology structure hierarchy and merge it with multi-relation triples to obtain the rock knowledge graph; S5. Based on the rock knowledge graph, parse user questions and perform graph queries; S6. Employ an intent-aware mechanism and use the R-GCN model to perform graph inference on the graph retrieval content; S7. A dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from the graph reasoning results, and the rock knowledge graph is updated based on user feedback on the natural language answers.

[0028] like Figure 1 As shown, in step S1, multi-source text data is acquired and preprocessed.

[0029] (1) Obtain multi-source text data.

[0030] In this embodiment, high-quality text data containing multiple dimensions such as rock classification, mineral composition, physical and mechanical parameters, engineering applications, and weathering characteristics are compiled, including journal articles, master's and doctoral dissertations, technical reports, exploration reports, and textbooks in the field of rock.

[0031] (2) Preprocess the multi-source text data.

[0032] In this embodiment, the specific process is as follows: 1) PyMuPDF is used to extract PDF text from multi-source text data while preserving the original text structure.

[0033] PyMuPDF is used to convert collected PDF documents into processable plain text while maintaining their original text structure, which facilitates the construction of the knowledge graph in the next step.

[0034] 2) Use regular expressions and Chinese word segmentation tools to perform deep cleaning of PDF text headers, footers, page numbers, non-semantic line breaks, and special symbols.

[0035] Through the above steps, a rock knowledge system that is cross-document, cross-granularity, and semantically consistent was constructed, achieving multi-dimensional knowledge integration, providing a comprehensive and effective data foundation, and overcoming the problem of single coverage in traditional knowledge graphs.

[0036] like Figure 1 As shown, in step S2, a sentence boundary detection model and a pre-trained word vector model are used to perform sentence segmentation and standardization on the preprocessed multi-source text data.

[0037] (1) Sentence segmentation is performed using a sentence boundary detection model.

[0038] In this embodiment, BERT's sentence boundary detection model is used to replace traditional punctuation-based sentence segmentation, achieving accurate segmentation of complex sentences in academic language. Sentence boundary recognition is modeled as a sequence labeling problem, with the following formula: ; Where S represents a sentence's word or character sequence; As a label, indicate whether the word is at the beginning of a sentence (B) or inside a sentence (I); Indicates the first i The nth word or character represents the nth word or character in the input sequence. i Each element.

[0039] (2) Standardization is performed using the FastText pre-trained word vector model.

[0040] In the field of rock terminology, there are problems such as synonyms, abbreviations, and ambiguity. In order to build a unified atlas entity space, terminology standardization is required.

[0041] In this embodiment, a glossary of rock terminology is constructed, such as granite, marble, hardness, etc., and semantically similar terms are converted into standard terms.

[0042] Based on standard terminology from authoritative materials or specifications, a FastText pre-trained word vector model is used to calculate the vector similarity between words in a sentence and the terminology database. The cosine similarity of word vectors is used to measure the semantic closeness between non-standard expressions and standard terms. The formula is: ; in, for Vector representation of .

[0043] If the sim value of a word is higher than the set threshold, then the word will be replaced with the standard usage.

[0044] Furthermore, the threshold can be set to 0.85. When it is greater than or equal to 0.85, the terminology is standardized; when it is less than or equal to 0.75, the original terminology is retained; when it is between 0.75 and 0.85, manual identification is used.

[0045] For example: "This area is mainly composed of quartz sand layers and slate."

[0046] Extracted terms: Quartz sandstone, slate; The terminology library contains the following standard terms: terminology library = ["quartz sandstone", "slate", "phyllite", "quartzite", "felsic sandstone"]. Calculate cosine similarity; if the similarity between quartz sandstone and quartz sandstone is greater than 0.85, it can be replaced with quartz sandstone; if the similarity is less than 0.75 with quartzite, it is not replaced; if the similarity between slate and slate in the terminology library is 1.0, then it is slate.

[0047] After the above steps, based on FastText word vectors and domain terminology database, automatic normalization of rock terminology can be achieved, solving inconsistencies in expression such as synonyms and abbreviations, and improving the semantic consistency of knowledge graph.

[0048] like Figure 1 , Figure 4 As shown, in step S3, the multi-relation triples in the standardized multi-source text data are extracted concurrently through the subject-triggered multi-relation joint extraction mechanism.

[0049] In this embodiment, a subject-triggered multi-relation joint extraction mechanism, which differs from the traditional CasRel subject-verb-object order, is employed, enabling each subject to independently activate all semantic relation predictions. All relation sub-prediction channels are activated concurrently around each subject, supporting simultaneous localization and attribution matching of multiple relations and multiple objects. This overcomes the limitations of the traditional sequential subject-verb-object structure, significantly improving the robustness and efficiency of multi-relation joint extraction. Specifically: (1) The boundaries of all subject entities in the sentence are identified by a binary classifier to obtain a set of candidate subjects.

[0050] The standardized multi-source text data is input into a binary classifier to predict whether each word in the sentence is the start or end position of a subject entity, thus obtaining a candidate subject set. The formulas for predicting the start and end positions are as follows:

[0051] in, The predicted probability for the starting position. The predicted probability of the endpoint location; For the Sigmoid function; W s , W e ,b s , b e These are learnable parameters.

[0052] The set of subject starting positions is selected by a threshold, which can be set to 0.5.

[0053] (2) The candidate subject is enhanced by using the inter-subject self-attention mechanism to obtain the enhanced subject representation.

[0054] A self-attention mechanism between subjects is introduced to establish explicit semantic connections between subject entities. The vectors of all identified subjects are constructed into a subject embedding matrix, its attention score matrix is ​​calculated, and the subject embeddings are weighted and summed to obtain an enhanced subject representation that integrates contextual information between subjects.

[0055] Specifically, the subject embedding matrix is ​​formed by representing all candidate subjects. The formula for the subject embedding matrix is: .

[0056] in, H s is the subject embedding matrix; h sm is the original representation vector of each subject entity.

[0057] The formula for calculating the self-attention weights between subjects is:

[0058] The enhanced representation is obtained by weighted summation, and the formula is:

[0059] in, H s 'This is the enhanced representation matrix obtained by weighted summation;' W Q , W K , W v This is the attention parameter matrix.

[0060] Finally, the enhanced representation of each subject is given by the following formula: .

[0061] (3) Based on the enhanced subject representation, construct a subject graph structure and use a graph neural network for information transmission and aggregation.

[0062] The specific process is as follows: 1) Based on the enhanced representation of the subject, construct the inter-subject graph structure, where each subject is regarded as a node in the graph, and the establishment of edges can be based on word order adjacency, punctuation grouping, or syntactic dependency relationship.

[0063] 2) By using graph neural networks (GCN) to propagate and aggregate information from subject nodes, a structure-aware subject vector is generated, enhancing the ability to perceive cross-subject structures and subject grouping patterns.

[0064] (4) Based on the subject graph structure, activate all relation categories corresponding to each subject one by one, and use a gating mechanism to integrate subject representation and context representation.

[0065] Specifically, 1) After the subject graph modeling is completed, activate all predefined relation categories for each subject one by one, using the following formula:

[0066] in, r s This indicates the distribution of relation categories triggered by the subject. z s The subject vector in the subject graph structure W r , b r are the learnable parameters for the relation classification layer, respectively.

[0067] 2) A gating mechanism is used to integrate subject representation and context representation.

[0068] To improve the fusion quality of subject and context decoding, a Gated Fusion mechanism is used instead of the traditional CLN structure to dynamically fuse subject representation with sentence encoding. The gating unit adaptively determines the degree of influence of subject information on the decoding of tokens at each position, thereby improving the accuracy and robustness of relation-object recognition.

[0069] (5) Identify the object position by using the object labeler corresponding to each subject relation and generate candidate triples.

[0070] The object position is identified by the object annotator corresponding to each relation. For each subject and its corresponding relation category, the identified object boundaries are combined into a candidate triple in the form of (subject, relation, object).

[0071] (6) The candidate triples are semantically normalized and redundancy is cleaned up using domain rules to obtain multi-relation triples.

[0072] To further improve the uniformity and usability of triples, a rule-guided post-processing module is introduced for semantic normalization and redundancy cleanup. Equivalent words and isomorphic phrases are uniformly processed using tools such as domain dictionaries and combined attribute templates. Simultaneously, composite entity structures are expanded and reconstructed to ensure the consistency of triples and the accuracy and integrity of the graph.

[0073] A specific example is: Subject entity candidate = {“granite”}; after determining the subject, the system trains a corresponding sub-labeler for each relation type to identify the object position. It automatically outputs a set of triples, such as (quartz diorite, containing, biotite).

[0074] After the above steps, all relation sub-prediction channels are activated concurrently with each subject as the center, supporting simultaneous localization and attribution matching of multiple relations and multiple objects. This breaks through the limitations of the traditional serial subject-verb-object structure and significantly improves the robustness and efficiency of joint extraction of multiple relations.

[0075] like Figure 1 As shown, in step S4, the ontology structure hierarchy is constructed and fused with multi-relation triples to obtain the rock knowledge graph.

[0076] First, the ontology structure hierarchy is constructed. In the concept hierarchy construction phase, a hybrid structured and unstructured ontology tree growth mechanism is employed. The specific process is as follows: (1) Based on multi-relation triples, the frequency of entity occurrence is statistically analyzed, and the contextual semantic nesting structure is parsed. The triple statistics and semantic structure extraction are realized, providing a data basis for subsequent clustering and hierarchical analysis.

[0077] (2) Based on the context semantic nesting structure, the rock classification hierarchy is dynamically constructed using the sentence embedding clustering tree algorithm, and specific standard knowledge is integrated to obtain the initial ontology structure hierarchy.

[0078] A primary classification of rock types is dynamically generated using a sentence embedding-based clustering tree algorithm, and authoritative knowledge sources are integrated to achieve automatic growth and standard alignment of the semantic ontology framework. Based on nested contexts and sentence embedding clustering results, the semantic categories of rock types are initially divided, and an initial ontology structure hierarchy is constructed by integrating authoritative knowledge (such as specific standards and geological atlases).

[0079] (3) Based on the initial ontology structure hierarchy, typical attribute fields are extracted using an instance-oriented attribute fusion mechanism, and attribute modeling is performed using the Property Graph method.

[0080] In terms of attribute modeling, an instance-oriented attribute fusion mechanism is adopted. By comparing structured samples with entity context descriptions, typical attribute fields (such as color, density, weathering level, mineral composition, etc.) are automatically extracted and clustered. After clustering synonymous fields, attribute subgraphs are organized in a Property Graph manner, so that rock-type nodes connect multiple attribute nodes and their value ranges, supporting attribute visualization, range reasoning, and upper and lower bound constraints.

[0081] (4) Using the relational semantic graph convolution aggregation mechanism, semantic clustering and type normalization of relations are performed to obtain a relational type set and complete relational modeling.

[0082] In relation modeling, semantic clustering is performed based on the co-occurrence frequency of relations in triples, path similarity, and graph structure patterns. A relation semantic graph convolutional aggregation mechanism is introduced to normalize equivalent relations with different representations and output a normalized set of relation types. This achieves relation semantic clustering and type normalization, unifying equivalent relations under different representations.

[0083] (5) Based on the initial ontology structure hierarchy, attribute modeling and relation modeling, the final ontology structure hierarchy is generated through a visual interface.

[0084] To enhance the ontology construction process, an expert review and consistency verification module is embedded. Based on a hybrid visual editing interface and map consistency verification rules, it assists geological experts in reviewing and correcting automatically generated ontology branches to obtain the final ontology structure hierarchy.

[0085] The automatically generated ontology branches are presented in a hybrid visual editing interface; map consistency verification rules are applied to assist geological experts in reviewing, correcting or confirming, and to complete the fusion optimization of "automatic modeling + manual intervention".

[0086] Specifically, during the ontology construction process, a rock classification tree is constructed, such as: rock - igneous rock - acidic rock - granite; attribute modeling: define the attribute structure of each type of rock, such as "density", "elastic modulus", "compressive strength", "chemical composition", etc.; relationship classification and constraints: composition relationship (such as "contains", "composed of", evolution relationship (such as "weathered into", "metamorphosed into"), application relationship (such as "applies to", "commonly used in"), classification relationship (such as "belongs to", "is a species"), etc.

[0087] Secondly, the final ontological structure hierarchy is fused with multi-relation triples to obtain the rock knowledge graph.

[0088] A graph database structure is constructed by integrating multi-relation triples into the ontology structure. The extracted triples are stored using Neo4j, a graph-based database that intuitively represents and stores data through structures such as nodes, relations, and attributes. Each rock type, mineral name, and geological process constitutes a node; semantic links between nodes are formed by terms such as "formed in," "contains," and "metamorphosed into."

[0089] In the context of a knowledge graph, entities can be mapped to nodes in the graph, and the relationships between entities are represented as edges connecting the nodes. Each node and edge in the graph has attributes that describe its characteristics.

[0090] Finally, before the rock knowledge graph is stored in the database, structural consistency is enhanced through mechanisms such as attribute index optimization, entity deduplication and fusion, and semantic tag injection. At the same time, a multi-level tag system and entity type inheritance structure are constructed to enable the graph to have capabilities such as inter-class inheritance, attribute constraints, and path visualization.

[0091] like Figure 2 As shown, in step 5, the user's question is parsed and a graph query is performed based on the rock knowledge graph.

[0092] (1) In the intelligent question-answering system stage, the application layer and user interaction are constructed, and the front-end page is designed to provide a question input box, allowing users to freely input questions. Specifically: The front-end page is designed to provide users with a question input box. Through this input box, users can enter their questions according to their needs. At the same time, users can choose their preferred way of entering their questions, without being restricted by special syntax or writing style.

[0093] (2) The dual mechanism of “domain dictionary enhancement and deep semantic modeling” is adopted to convert the natural language questions input by users into structured semantic representations.

[0094] Specifically, the BERT-wwm-ext Chinese pre-trained model is used to perform context encoding on the input questions, and the BiLSTM-CRF architecture is used for named entity recognition to identify professional terms such as granite, compressive strength, and hardness. Relational intent extraction uses the TextCNN model to perform multi-class classification of the questions.

[0095] After identifying technical terms, the structured question semantics are converted into knowledge graph-oriented retrieval statements. The system is deployed in the Neo4j graph database environment, uses the Cypher query language for retrieval, calls preset query templates, and introduces word vector matching for fuzzy entity recognition and synonym path expansion.

[0096] Through the above steps, the dual mechanisms of domain dictionary enhancement and deep semantic modeling effectively solve the problems of ambiguity and complex word order in geological terminology. Furthermore, the model has been fine-tuned and trained with rock corpus, which has improved its adaptability.

[0097] like Figure 2 As shown, in step 6, an intent-aware mechanism is used to perform graph inference on the graph retrieval content through the R-GCN model.

[0098] The specific process is as follows: (1) The TransE graph embedding algorithm is used to vectorize the entities and relationships of the rock knowledge graph. The question intent prompting mechanism is used to embed the user's query intent into the entity vector and perform structure-aware path search.

[0099] In this embodiment, the TransE graph embedding algorithm is adopted. Based on the traditional TransE model, prompt tokens are introduced as virtual anchors embedded in the entity representation, so that the natural language question input by the user can be more closely aligned with the relevant entities and relational semantics in the vector space, and semantic-driven initialization localization is achieved.

[0100] (2) In structure-aware path search, for questions that are not matched in the query, a dynamic path template is constructed and a similarity retrieval technique is used to match the initial reasoning path.

[0101] In this embodiment, a structure-aware path search is initiated. For entities or paths not directly matched in the user query, a dynamic path template library is constructed. The library is then combined with the graph topology, relation type entropy, and semantic similarity index to search for the path candidate that best matches the contextual target, thereby improving the path recall quality and controlling computational complexity.

[0102] (3) The initial inference path information is adjusted by the weighted R-GCN model to obtain the final inference path set.

[0103] In this embodiment, an adjustable hop count and relational link quality-biased graph neural network inference module is introduced. Based on R-GCN, a path weight adjustment mechanism is added, and the inference information flow is dynamically adjusted using entity credibility distribution to avoid noise propagation along long paths and enhance causal path focusing capabilities. The formula is:

[0104] in, For nodes i exist l Layer representation; For nodes i exist l The representation of +1 layer; r The type of relationship in the graph; Let i be the set of neighboring nodes of node i under relation type r; For the i-th level, targeting relation type r The transformation matrix; This is a self-circulating weight matrix; Normalization factor; For nodes j exist l Layer representation; j It is a node i Neighboring nodes, through relationships r Connected.

[0105] The path weight is given by the formula:

[0106]

[0107] For nodes i and j Semantic cosine similarity; H ( r ) represents the entropy value of the relation; score ( path The path quality score is denoted as . , , These are the learnable weight coefficients.

[0108] Final reasoning path score:

[0109] Among them, the Relational Graph Convolutional Network (R-GCN) is an extended graph convolutional network (GCN) method designed to handle various relationships between entities in a knowledge base. By introducing relationship-specific transformation matrices, R-GCN can effectively capture the features of different types of edges in the graph, thus performing well in tasks such as entity classification and link prediction.

[0110] like Figure 2 , Figure 5 As shown, in step 7, a dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from the graph reasoning results, and the rock knowledge graph is updated based on user feedback on the natural language answers.

[0111] (1) A dual-channel strategy based on rule templates and text generation model is used to generate natural language answers from graph reasoning results.

[0112] The structured triples or path information obtained from graph reasoning need to be further converted into natural language answers that users can understand. The specific process is as follows: 1) Analyze the graph reasoning results and map the entity nodes and relation types in the final reasoning path to a standard set of triples.

[0113] In this implementation, the reasoning results are analyzed, and the entity nodes and relation types in multiple paths are mapped to a standard set of triples. Combined with the semantic vector of the question, a structure-aware prompt sequence is constructed.

[0114] 2) Generate declarative sentences by matching syntactic structures with rule templates and filling in standard triples.

[0115] 3) Convert declarative sentences into natural language answers using a text generation model, and highlight key entities and relationships in the answers.

[0116] In this embodiment, upon entering the answer generation stage, a dual-channel strategy is first employed for parallel processing: One is the rule-based template generation module, which matches the corresponding structure in the preset syntactic template library based on entity type, relational semantics and graph roles, and directly fills in to generate professional and accurate declarative sentences.

[0117] The second is the T5-PEGASUS Chinese text generation model based on instruction fine-tuning. By inputting semantic embedding of questions, graph path vectors and instruction prompts, it automatically generates answers in a natural language style, achieving a balance between content accuracy and language readability.

[0118] Secondly, a structural prompting embedding mechanism is adopted to use the graph path as a control vector to guide the generation process.

[0119] To improve the logical consistency of generated statements, a structural prompting embedding mechanism is introduced, using graph paths as control vectors to guide the generation process and ensure that the answer covers key entities and relationship chains. Furthermore, multi-granularity answer output (such as direct answers, compressed summaries, and full path descriptions) is supported to adapt to different interaction needs.

[0120] Finally, the visual answer display module, built using HTML format, highlights the subject, relation, and object keywords in the generated sentences and links with the graph visualization interface, allowing users to click to view the hierarchical structure of nodes, thus achieving a closed-loop question-and-answer experience that links structure, language, and graph.

[0121] (2) Update the rock knowledge graph based on user feedback on natural language answers.

[0122] To achieve continuous optimization of the graph and system self-learning, it is necessary to collect user feedback, analyze response satisfaction, and drive the dynamic evolution of the graph and model updates. The specific process is as follows: 1) Collect user feedback information on natural language answers.

[0123] In this embodiment, a user feedback button is embedded in the system interface to collect feedback data.

[0124] 2) Based on user feedback on natural language answers, a dictionary expansion mechanism is used to adjust the edge weights and relationship confidence of the rock knowledge graph.

[0125] In this embodiment, if a user adds a new relationship or proposes a new term that the system cannot recognize, the new term is added to the queue of entities awaiting review by triggering a dictionary expansion mechanism. Simultaneously, based on user interaction frequency, path scores, and error correction data, the system adjusts edge weights and relationship confidence in the graph, and adds high-quality new samples to the training set for fine-tuning the question parsing content and the graph embedding content.

[0126] Specifically, after the answer is provided to the user, user experience data is collected, and satisfaction and dissatisfaction are categorized. If the user is dissatisfied, further information on dissatisfaction is collected, the system adjusts the edge weights and relation confidence in the graph, adds high-quality new samples to the training set, and fine-tunes the question parsing content and graph embedding content. Furthermore, edge weight updates are dynamically adjusted based on user feedback (such as "correct / incorrect" labels, click frequency, and path selection). The formula is: ; in, For entities in the current graph i The weight of the edge between entity j and entity j; This is a smoothing coefficient used to control the proportion of influence between historical and current feedback. fij Based on the latest user interaction feedback, it is represented as , To prevent small constants from being divided by zero.

[0127] Adjusting relationship confidence involves dynamically evaluating and optimizing graph relationships based on user feedback, thereby improving the reliability and performance of the graph in question-answering reasoning, entity recognition, and model training.

[0128] The confidence level estimation formula is: ; in, conf(r The confidence level is the previous one. Npos(r) This represents the number of times the relationship has been positively acknowledged by the user. Npath(r) This represents the number of times the relationship appears in the inference path that the user has marked as "correct"; Nneg(r) The number of times the error was rejected or corrected by users. To control for the influence weight of the number of confirmations in the inference path, the confidence level for this test is: ; in, conf(t)(r) The confidence level of the previous time; fr(t+1) It can be 1 or 0, with 1 indicating a correct response and 0 indicating an incorrect response. Retain weight for history.

[0129] Based on a rock knowledge graph, specific intelligent question answering is performed. For example: Enter the question: "Which water conservancy projects are suitable for using granite?" Problem analysis and retrieval: Entity identification yielded {"granite" (rock type), "water conservancy project" (application scenario)}, and the intent was classified as an engineering applicability query (TextCNN confidence score 0.89). Diagrammatic reasoning: Granite → [Compressive strength = 210MPa] → [Suitable for] → Dam foundation (Path weight 0.83).

[0130] Answer generation (dual-channel strategy): Template channel outputs "Granite is often used in dam foundation engineering due to its high compressive strength (210MPa) and low permeability."; T5-PEGASUS generates "Based on knowledge graph analysis, the mechanical properties of granite make it a preferred material for dam foundation construction in water conservancy projects, specifically suitable for..." The final demonstration showed that "granite is suitable for dam foundations due to its high compressive strength".

[0131] User feedback: The term "altered granite" has been added to the pending review queue and to the training set.

[0132] Example 2 The purpose of this embodiment is to provide an intelligent question-answering system that integrates a rock knowledge graph, including: The knowledge graph module is used to acquire multi-source text data and preprocess it. A sentence boundary detection model and a pre-trained word vector model are used to segment and standardize the preprocessed multi-source text data. A subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from the standardized multi-source text data. An ontology structure hierarchy is constructed and fused with the multi-relation triples to obtain the rock knowledge graph. The intelligent question answering module is used to parse user questions and perform graph queries based on the rock knowledge graph. It adopts an intent-aware mechanism and uses the R-GCN model to perform graph reasoning on the retrieved content. Based on a dual-channel strategy of rule templates and text generation model, it generates natural language answers from the graph reasoning results and updates the rock knowledge graph based on user feedback on the natural language answers.

[0133] The knowledge graph module includes a data acquisition and preprocessing module, a semantic-level processing module, a triple extraction module, an ontology construction and graph generation module, a question graph query module, a question graph reasoning module, and an answer generation and feedback module.

[0134] The data acquisition and preprocessing module is used to acquire multi-source text data and preprocess the multi-source text data.

[0135] The semantic-level processing module is used to perform sentence segmentation and standardization on preprocessed multi-source text data using a sentence boundary detection model and a pre-trained word vector model.

[0136] The triple extraction module is used to concurrently extract multi-relation triples from standardized multi-source text data through a subject-triggered multi-relation joint extraction mechanism.

[0137] The ontology construction and graph generation module is used to construct the ontology structure hierarchy and merge it with multi-relation triples to obtain the rock knowledge graph.

[0138] The question graph query module is used to parse user questions and perform graph queries based on the rock knowledge graph.

[0139] The Problem Graph Reasoning module is used to perform graph reasoning on the retrieved content using an intent-aware mechanism and the R-GCN model.

[0140] The answer generation and feedback module is used to generate natural language answers from the graph reasoning results using a dual-channel strategy based on rule templates and text generation models, and to update the rock knowledge graph based on user feedback on the natural language answers.

[0141] Based on an intelligent question-answering system that integrates a rock knowledge graph, the method steps in Embodiment 1 are implemented.

[0142] This embodiment fully leverages the structured advantages and deep semantic modeling capabilities of knowledge graphs to create a complete chain from natural language to graph reasoning and then to human language output. Through the collaborative construction of multiple modules, it builds an intelligent response system with professional understanding, semantic reasoning, and interpretation capabilities.

[0143] Example 3 The purpose of this embodiment is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method.

[0144] Example 4 The purpose of this embodiment is to provide a computer-readable storage medium.

[0145] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above method.

[0146] Example 5 The purpose of this embodiment is to provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods and functions involved in any of the above embodiments.

[0147] The steps and methods involved in the apparatus of the above embodiments correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.

[0148] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.

[0149] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. An intelligent question-answering method integrating a rock knowledge graph, characterized in that, include: Acquire multi-source text data and preprocess the multi-source text data; A sentence boundary detection model and a pre-trained word vector model are used to perform sentence segmentation and standardization on the preprocessed multi-source text data. The subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from standardized multi-source text data. Construct an ontology structure hierarchy and merge it with multi-relation triples to obtain a rock knowledge graph; Based on a rock knowledge graph, user questions are parsed and graph queries are performed. An intent-aware mechanism is employed, and graph reasoning is performed on the graph retrieval content using the R-GCN model. A dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from the graph reasoning results, and the rock knowledge graph is updated based on user feedback on the natural language answers.

2. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, The preprocessing of multi-source text data is as follows: PyMuPDF is used to extract PDF text from multi-source text data while preserving the original text structure; The PDF text is thoroughly cleaned using regular expressions and Chinese word segmentation tools, including headers, footers, page numbers, non-semantic line breaks, and special symbols.

3. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, The subject-triggered multi-relation joint extraction mechanism concurrently extracts multi-relation triples from standardized multi-source text data. The specific process is as follows: By using a binary classifier, all subject entity boundaries in the sentence are identified, and a set of candidate subjects is obtained. A self-attention mechanism between subjects is used to enhance the context of candidate subjects, resulting in enhanced subject representations. Based on the enhanced subject representation, a subject graph structure is constructed, and information is transmitted and aggregated through a graph neural network. Based on the subject graph structure, all relation categories corresponding to each subject are activated one by one, and a gating mechanism is used to fuse the subject representation and the context representation. The object position is identified by the object tagger corresponding to each relation of the subject, and candidate triples are generated by combining them. Domain rules are used to perform semantic normalization and redundancy cleanup on candidate triples to obtain multi-relation triples.

4. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, The specific process of constructing the ontology structure hierarchy is as follows: Based on multi-relation triples, the frequency of entity occurrence is counted, and the nested structure of contextual semantics is parsed. Based on the contextual semantic nesting structure, the rock classification hierarchy is dynamically constructed using the sentence embedding clustering tree algorithm, and specific standard knowledge is integrated to obtain the initial ontology structure hierarchy; Based on the initial ontology structure hierarchy, a typical attribute field is extracted using an instance-oriented attribute fusion mechanism, and attribute modeling is performed using the Property Graph approach. By employing a relational semantic graph convolutional aggregation mechanism, semantic clustering and type normalization of relations are performed to obtain a set of relation types, thus completing relation modeling; Based on the initial ontology structure hierarchy, attribute modeling, and relationship modeling, the final ontology structure hierarchy is generated through a visual interface.

5. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, An intent-aware mechanism is employed, and the R-GCN model is used to perform graph inference on the retrieved content. The specific process is as follows: The TransE graph embedding algorithm is used to vectorize the entities and relationships in the rock knowledge graph; A question intent prompting mechanism is adopted to embed the user's query intent into the entity vector and perform structure-aware path search; In structure-aware path search, for questions that are not matched in the query, a dynamic path template is constructed, and similarity retrieval technology is used to match the initial inference path; The initial inference path information is adjusted by using a weighted R-GCN model to obtain the final set of inference paths.

6. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, A dual-channel strategy based on rule templates and text generation models is used to generate natural language answers from graph reasoning results. The specific process is as follows: The graph reasoning results are parsed, and the entity nodes and relation types in the final reasoning path are mapped to a standard set of triples; Declarative sentences are generated by matching syntactic structures using rule templates and filling in standard triples. The text generation model converts declarative sentences into natural language answers and highlights key entities and relationships in the answers.

7. The intelligent question-answering method integrating rock knowledge graphs as described in claim 1, characterized in that, The rock knowledge graph is updated based on user feedback on natural language answers. The specific process is as follows: Collect user feedback on natural language answers; Based on user feedback on natural language answers, a dictionary expansion mechanism is used to adjust the edge weights and relationship confidence of the rock knowledge graph.

8. An intelligent question-answering system integrating a rock knowledge graph, characterized in that, include: The knowledge graph module is used to acquire multi-source text data and preprocess the multi-source text data; A sentence boundary detection model and a pre-trained word vector model are used to perform sentence segmentation and standardization on the preprocessed multi-source text data. The subject-triggered multi-relation joint extraction mechanism is used to concurrently extract multi-relation triples from standardized multi-source text data. Construct an ontology structure hierarchy and merge it with multi-relation triples to obtain a rock knowledge graph; The intelligent question-answering module is used to parse user questions and perform graph queries based on the rock knowledge graph; An intent-aware mechanism is adopted, and graph reasoning is performed on the graph retrieval content through the R-GCN model. Based on a dual-channel strategy of rule templates and text generation model, natural language answers are generated from the graph reasoning results, and the rock knowledge graph is updated according to the user's feedback on the natural language answers.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it performs the steps of the method described in any one of claims 1-7.