Coal mine intelligent question and answer method based on cooperation of knowledge graph and large language model
Patent Information
- Application Number
- CN202611343668.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-10-30
AI Technical Summary
[0007]本发明的目的在于针对现有煤矿智能问答技术中存在的知识来源分散、训练数据质量不足、问答结果准确率不高、通用模型幻觉明显、知识图谱表达不自然以及缺少结果交叉校验机制等问题,提供一种基于知识图谱与大语言模型协同的煤矿智能问答方法
[0052]本发明通过对煤矿安全管理、质量检查、地质勘探、事故案例、政策法规和设备规程等多源原始文档进行统一整合,构建煤矿知识库,提高了煤矿专业知识的覆盖范围和组织效率。
Smart Images

Figure CN123014207A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of artificial intelligence, knowledge engineering, coal mine safety information processing and coal mine intelligent technology, and in particular relates to a coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model. Background Technology
[0002] The existing dynamic coal mining industry is a crucial component of energy production and industrial raw material supply. Its production and operation involve multiple professional aspects, including safety management, quality inspection, geological exploration, accident analysis, compliance with regulations and systems, equipment operation and maintenance, and emergency response. With the continuous advancement of digitalization and intelligentization in coal mines, a wealth of knowledge in the coal mining field is gradually being condensed into electronic documents, including safety management systems, quality inspection records, geological exploration reports, accident case analysis reports, policy and regulatory documents, and equipment operating procedures. These documents constitute an important carrier of coal mining knowledge.
[0003] However, most existing coal mine knowledge exists in scattered, unstructured text formats, with complex document sources, inconsistent formats, and inconsistent expressions, making it difficult to quickly extract, organize, and efficiently reuse this knowledge. This is especially true in coal mine safety production and emergency decision-making scenarios, where numerous low-frequency but highly specialized long-tail questions exist, such as requirements for drawing ventilation system diagrams under multi-coal-seam mining conditions, self-rescue requirements for underground personnel in distress, accident information reporting procedures, gas disaster prevention measures, and equipment operating procedures. These types of questions typically require comprehensive judgment based on regulations, technical specifications, and historical cases. Traditional methods relying on manual document retrieval or experience consultation are slow and inconsistent in accuracy, failing to meet the needs of coal mine sites and management departments for rapid and accurate question-and-answer support.
[0004] In recent years, large language models have made significant progress in natural language understanding, text generation, and complex reasoning, possessing strong context modeling and language expression capabilities, thus holding significant application value in open and specialized question answering fields. However, when general-purpose large language models are directly applied to the coal mining sector, there are still obvious shortcomings: on the one hand, their pre-training knowledge mainly comes from general corpora, which do not adequately cover coal mining terminology, regulations, and operating procedures; on the other hand, in the absence of external factual support, large language models are prone to generating illusions, that is, generating content that appears reasonable in form but is inaccurate in fact.
[0005] Knowledge graphs can provide a unified model of regulations, equipment, disaster types, job responsibilities, emergency measures, and accident processes in the coal mining sector through a structured organization of entities, relationships, and events. This provides interpretable and traceable knowledge support for question-answering systems. Compared to methods relying solely on language generation, knowledge graphs have significant advantages in terms of professional knowledge constraints, logical link expression, and structured reasoning. However, relying solely on knowledge graphs also has limitations, such as insufficient naturalness in natural language expression, limited adaptability to complex colloquial questions, and high costs in graph construction and maintenance. Other studies have also pointed out that independent knowledge graphs suffer from poor generalization ability, high maintenance costs, and reliance on symbolic logic.
[0006] Therefore, it is necessary to propose a coal mine intelligent question answering method, system, and device that combines the advantages of coal mine knowledge graphs and domain-specific large language models. This allows the system to utilize both the semantic understanding and natural language expression capabilities of domain-specific large language models and the structured knowledge constraints and logical reasoning capabilities of knowledge graphs. Furthermore, by using a summarization and reflection mechanism to fuse, cross-validate, and correct the two candidate answers, the system can improve the accuracy, completeness, reliability, and interpretability of coal mine professional question answering. Summary of the Invention
[0007] The purpose of this invention is to address the problems existing in current coal mine intelligent question answering technologies, such as scattered knowledge sources, insufficient training data quality, low accuracy of question answering results, obvious illusions of general models, unnatural knowledge graph representation, and lack of result cross-validation mechanisms, and to provide a coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model.
[0008] To achieve the above-mentioned objectives, the present invention specifically adopts the following technical solution:
[0009] In a first aspect, the present invention provides a coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model, comprising the following steps:
[0010] S1. Obtain multi-source original documents in the coal mining field and perform preprocessing processes including document classification, text extraction, layout cleaning, and document segmentation. The multi-source original documents are segmented into multiple document blocks with source identification information, thereby constructing a coal mining knowledge base.
[0011] S2. Generate original question-and-answer pairs for the coal mine domain based on document blocks in the coal mine knowledge base, and perform hierarchical quality filtering on the original question-and-answer pairs to obtain the coal mine question-and-answer training dataset; perform domain fine-tuning on the pre-trained large language model based on the coal mine question-and-answer training dataset, and use the fine-tuned large language model as the large model for the coal mine domain.
[0012] S3. Extract entity and event information, as well as the interaction relationships between entities, between entities and events, and between events from the document blocks of the coal mine knowledge base, and construct a coal mine knowledge graph;
[0013] S4. After performing semantic parsing and structured representation on the user-input coal mining domain question, input the results into the coal mining domain big model and the coal mining knowledge graph reasoning module respectively, and generate the first candidate answer and the second candidate answer accordingly, forming a dual-path candidate answer;
[0014] S5. A summary-reflection dual-agent collaborative mechanism is adopted to fuse, verify, and correct the two candidate answers to obtain the final intelligent question answering result for coal mines.
[0015] Based on the above scheme, each step can be implemented in the following preferred manner.
[0016] As a preferred option in the first aspect mentioned above, the specific process of constructing the coal mine knowledge base in S1 is as follows:
[0017] S11. Classify the acquired multi-source original documents according to the document topic, and divide the multi-source original documents into six categories: safety management documents, quality inspection documents, geological exploration documents, accident case analysis reports, policy and regulation documents, and equipment operation procedure documents;
[0018] S12. Perform text extraction and layout cleaning on multi-source original documents, and delete invalid headers and footers, blank characters, garbled characters and non-text information;
[0019] S13. Based on the document title and chapter level, the text content of the original documents from multiple sources is divided into paragraphs and blocks to obtain multiple semantically complete document blocks. Source identification information is established for each document block. The text content and source identification information of all document blocks are organized in a unified manner to form a coal mine knowledge base.
[0020] As a preferred embodiment of the first aspect mentioned above, the hierarchical quality filtering performed in S2 includes: additional prefix cleanup, duplicate content detection, hint leakage detection, syntax correction, and semantic similarity filtering.
[0021] As a preferred embodiment of the first aspect mentioned above, the construction process of the coal mine question-answering training dataset in S2 is as follows:
[0022] S21. Input the pre-built prompt template for the coal mining field and the document block into one or more large language models, guide the large language models to generate original question-answer pairs around the text content of the document block, and store the original question-answer pairs in a structured manner.
[0023] S22. Perform hierarchical quality filtering on the original question-and-answer pairs, including: performing additional prefix cleanup on the original question-and-answer pairs, deleting non-question-and-answer text content containing JSON wrappers and additional tags; performing duplicate content detection on the original question-and-answer pairs, deleting original question-and-answer pairs containing duplicate text content; performing hint leakage detection on the original question-and-answer pairs, deleting or rewriting original question-and-answer pairs that retain hint template information; performing syntax format correction on the original question-and-answer pairs to ensure that each original question-and-answer pair meets the uniform structure requirements; and performing semantic similarity filtering on the original question-and-answer pairs, deleting, merging, or rewriting original question-and-answer pairs whose semantic similarity is greater than a preset similarity threshold.
[0024] S23. The original question-answer pairs retained after hierarchical quality filtering in S22, along with the source identifier information of the document blocks corresponding to the original question-answer pairs, are used as a question-answer sample to construct a coal mine question-answer training dataset consisting of multiple question-answer samples.
[0025] As a preferred embodiment of the first aspect mentioned above, in S2, the field fine-tuning of the present invention adopts a parameter-efficient fine-tuning method to obtain a large model of the coal mine field.
[0026] As a preferred option in the first aspect mentioned above, the specific process of constructing the coal mine knowledge graph in S3 is as follows:
[0027] S31. First, identify entities and events in the document block. The large language model identifies noun objects as entities and actions or state changes as events from the text content of the document block. The identified entities include legal and regulatory entities, equipment and facilities entities, job responsibility entities, disaster type entities, emergency measures entities, and detection indicator entities. The identified events include accident occurrence events, violation events, inspection process events, and emergency response events.
[0028] S32. Then input all document blocks into the large language model, which will identify the interaction relationships between entities, between entities and events, and between events. The identified interaction relationships include prescriptive relationships, applicable relationships, causal relationships, preventive relationships, inspection relationships, disposition relationships, belonging relationships, and corresponding relationships.
[0029] S34. Construct triples based on the identified entities, events, and interaction relationships; the subject and object of the triple are both entities or events; the relationship in the triple is an interaction relationship between entities, or an interaction relationship between events, or an interaction relationship between an entity and an event;
[0030] S35. For the triples extracted in step S34, perform abstract type induction to generalize the entities to be induced into a unified type; during the abstract type induction process, introduce the context information of the neighbor set of the entities to be induced.
[0031] S36. Based on the optimal abstraction type of the entity to be summarized, the large language model performs a unified mapping of synonymous entities, similar relationships, and similar events to obtain a coal mine knowledge graph; the nodes in the coal mine knowledge graph are the identified entities or events, and the edges in the coal mine knowledge graph represent the interaction relationships between nodes.
[0032] As a preferred embodiment of the first aspect mentioned above, the specific process for generating dual-path candidate answers in S4 is as follows:
[0033] S41. Obtain the user-input coal mining-related questions, and use a large language model to perform word segmentation, keyword recognition, coal mining-related topic recognition, entity, event, interaction relationship recognition, and question type recognition in the coal mining-related questions to obtain structured questions;
[0034] S42. Input the structured question into the large model of the coal mining field, and the large model of the coal mining field generates natural language based on the structured question to obtain the first candidate answer;
[0035] S43. Input the structured question into the coal mine knowledge graph reasoning module, which will generate a second candidate answer based on entity matching, relationship retrieval, path analysis, and rule constraints.
[0036] As a preferred embodiment of the first aspect mentioned above, in S43, the process for generating the second candidate answer is as follows:
[0037] S431. The entities read from the structured question are used as key entities. Matching entity nodes or event nodes are retrieved in the coal mine knowledge graph through semantic similarity, and the retrieved nodes are used as target nodes.
[0038] S432. The question intent in the structured question is mapped to the interaction relationship in the coal mine knowledge graph through a large language model;
[0039] S433. After completing entity matching and relation retrieval, prioritize searching the coal mine knowledge graph. Nodes directly connected to the target node are retrieved as one-hop facts. When one-hop facts are insufficient to fully answer the user's input question about the coal mining field, multi-hop path expansion is performed within a preset maximum path length to obtain a candidate evidence path set consisting of candidate evidence paths that satisfy the rule constraints. Each candidate evidence path consists of multiple triples:
[0040]
[0041] in, Indicate the path of candidate evidence; Indicates the degree of entity matching; Indicates the degree of relationship matching; As a key entity; The interaction relationships read from the structured question; and These represent the entity matching threshold and the relationship matching threshold, respectively. This indicates that the candidate evidence path meets the preset rule constraints; The normalized candidate evidence path length is obtained by dividing the actual length of the candidate evidence path by the maximum path length. Indicates the maximum allowed path length for retrieval;
[0042] S434. Sort the candidate evidence paths in the candidate evidence path set according to the matching score, select the top K candidate evidence paths with the highest matching scores as inference paths, and delete duplicate or irrelevant triples in the inference paths. The large language model organizes the triples retained in each inference path into structured evidence records containing subject, interaction relationship, object and source identification information. Then, according to the question type in the coal mining field, the structured evidence records are filled into the preset answer template to obtain the second candidate answer, where K is the number of inference paths.
[0043] As a preferred embodiment of the first aspect mentioned above, in S5, the summary-reflection dual-agent collaborative mechanism includes a summarizing agent and a reflecting agent, and the specific process for obtaining the coal mine intelligent question-and-answer results is as follows:
[0044] S51. Input the first and second candidate answers into the summarizing agent. The summarizing agent is responsible for merging the two candidate answers, deleting redundant context and repeated expressions in the two types of candidate answers, retaining key knowledge points, and outputting intermediate summary answers.
[0045] S52. Input the intermediate summary answer into the reflective agent. The reflective agent verifies and corrects conflicting facts, logical errors, duplicate content, illusory information introduced by the large coal mining model, and outdated information brought by the coal mining knowledge graph in the intermediate summary answer. The final coal mining intelligent question answering result is then output.
[0046] Secondly, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can realize the intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in any of the solutions of the first aspect above.
[0047] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models as described in any of the solutions of the first aspect above.
[0048] Fourthly, the present invention provides a computer electronic device, which includes a memory and a processor;
[0049] The memory is used to store computer programs;
[0050] The processor is configured to, when executing the computer program, implement the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models as described in any of the solutions of the first aspect above.
[0051] Compared with the prior art, the present invention has the following advantages:
[0052] This invention constructs a coal mine knowledge base by uniformly integrating multiple original documents, including those related to coal mine safety management, quality inspection, geological exploration, accident cases, policies and regulations, and equipment procedures, thereby improving the coverage and organizational efficiency of professional knowledge in coal mines.
[0053] This invention constructs a coal mine question-answering training dataset by combining question-answering generation with hierarchical quality filtering, thereby improving the problems of insufficient domain training data, a large number of duplicate samples, and inconsistent formats.
[0054] This invention constructs a coal mine knowledge graph through joint modeling of entities, relationships, and events, thereby enhancing the structured expression and interpretability of coal mine professional knowledge.
[0055] This invention adapts a pre-trained large language model to the coal mining field through efficient LoRA parameter fine-tuning, thereby improving the large language model's ability to understand and respond to coal mining terminology, regulations, and accident handling knowledge.
[0056] This invention effectively reduces redundant expressions and model illusions by fusing and cross-validating two candidate answers using a summarizing agent and a reflective agent, thereby improving the accuracy and reliability of intelligent question-answering results in coal mines. Attached Figure Description
[0057] Figure 1 This is a flowchart of the steps of the method of the present invention;
[0058] Figure 2 This is a system block diagram of the present invention;
[0059] Figure 3 This is a schematic diagram of a computer electronic device provided by the present invention. Detailed Implementation
[0060] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. Technical features in the various embodiments of the present invention can be combined accordingly without mutual conflict.
[0061] In the description of this invention, it should be understood that the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include at least one of those features.
[0062] In a preferred embodiment of the present invention, a coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model is provided. This method uses multi-source original documents in the coal mining field as the original knowledge source, a coal mine knowledge base as the basic data carrier, and a coal mine knowledge graph and a large coal mining field model as dual inference engines. It also establishes a result fusion and error correction closed loop through summarizing and reflecting agents, thereby achieving high-quality intelligent question answering for scenarios such as coal mine safety management, quality inspection, geological exploration, accident handling, policy and regulations, and equipment operation.
[0063] like Figure 1 As shown, in a preferred embodiment of the present invention, a coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model is provided. This method uses multi-source original documents in the coal mining field as the original knowledge source, a coal mine knowledge base as the basic data carrier, and a coal mine knowledge graph and a large coal mining field model as dual inference engines. It also establishes a result fusion and error correction closed loop through summarizing and reflecting agents, thereby achieving high-quality intelligent question answering for scenarios such as coal mine safety management, quality inspection, geological exploration, accident handling, policies and regulations, and equipment operation.
[0064] like Figure 1 As shown, the above-mentioned intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models includes the following steps S1 to S5. The specific implementation process of each step is described in detail below.
[0065] S1. Obtain multi-source original documents in the coal mining field and perform preprocessing processes including document classification, text extraction, layout cleaning, and document segmentation. The multi-source original documents are segmented into multiple document blocks with source identification information, thereby constructing a coal mining knowledge base.
[0066] It should be noted that the purpose of step S1 is to uniformly map the scattered, heterogeneous and unstructured original documents into processable document blocks, thereby constructing a coal mine knowledge base and providing a consistent data foundation for subsequent question-and-answer generation, knowledge extraction, knowledge graph construction and domain model training.
[0067] Furthermore, in step S1 of this invention, the specific process of constructing the coal mine knowledge base is as follows:
[0068] S11. Classify the acquired multi-source original documents according to the document topic, and divide the multi-source original documents into six categories: safety management documents, quality inspection documents, geological exploration documents, accident case analysis reports, policy and regulation documents, and equipment operation procedure documents.
[0069] In step S11 of this embodiment, the multi-source original document format includes at least one or more of PDF, DOCX, Markdown, and TXT.
[0070] S12. Extract text and clean the layout of the original documents from multiple sources, and delete invalid headers and footers, blank characters, garbled characters and non-text information.
[0071] S13. Based on the document title and chapter level, the text content of the original documents from multiple sources is divided into paragraphs and blocks to obtain multiple semantically complete document blocks. Source identification information is established for each document block. The text content and source identification information of all document blocks are organized in a unified manner to form a coal mine knowledge base.
[0072] In step S13 of this embodiment, since direct processing of long texts can easily lead to errors, this invention first divides the original document into multiple semantically relatively complete document blocks for subsequent processing. Furthermore, this embodiment establishes source identification information to indicate which original document the current document block originates from, enabling matching of the document block with its source document and facilitating source tracing. The source identification information includes at least the original document category, the original document filename (e.g., .PDF), the original document page number, the heading level, and the document block number. Specifically, for DOCX format original documents, the heading level is obtained by reading the heading style and outline level; for Markdown format original documents, the heading level is obtained by reading the # level; and for PDF format original documents, the heading level is identified by combining the table of contents, font size, and numbering pattern. After uniformly mapping the discrete original documents to processable document blocks with source identification information, this embodiment constructs a coal mine knowledge base based on this. , can be represented as:
[0073]
[0074] in, The first in the coal mine knowledge base The document block, which is composed of the first... Text content of a document block Source and origin identification information composition; Indicates the total number of document blocks.
[0075] S2. Generate original question-and-answer pairs for the coal mine domain based on document blocks in the coal mine knowledge base, and perform hierarchical quality filtering on the original question-and-answer pairs to obtain the coal mine question-and-answer training dataset; perform domain fine-tuning on the pre-trained large language model based on the coal mine question-and-answer training dataset, and use the fine-tuned large language model as the large model for the coal mine domain.
[0076] It should be noted that the hierarchical quality filtering performed in step S2 of this invention includes: additional prefix cleaning, duplicate content detection, prompt leakage detection, syntax format correction, and semantic similarity filtering.
[0077] It should be noted that the hierarchical quality filtering in step S2 is used to improve the quality and diversity of the coal mine question-answering training dataset, avoid problems such as duplication, hint leakage, semantic ambiguity and uneven data distribution introduced in the process of generating large language models, thereby enhancing the stability and effectiveness of subsequent domain model training.
[0078] It should be noted that, in step S2 of this invention, the process of constructing the coal mine question-and-answer training dataset is as follows:
[0079] S21. Input the pre-built prompt template for the coal mining field and the document block into one or more large language models, guide the large language models to generate original question-answer pairs around the text content of the document block, and store the original question-answer pairs in a structured manner.
[0080] In step S21 of this embodiment, when using a large language model, different temperatures are adjusted so that the large language model generates original question-and-answer pairs for each temperature; when using multiple large language models, the prompt template and document block are simultaneously input into each large language model so that these large language models generate original question-and-answer pairs in parallel.
[0081] S22. Perform hierarchical quality filtering on the original question-and-answer pairs, including: performing additional prefix cleanup on the original question-and-answer pairs, deleting non-question-and-answer text content containing JSON wrappers and additional tags; performing duplicate content detection on the original question-and-answer pairs, deleting original question-and-answer pairs containing duplicate text content; performing hint leakage detection on the original question-and-answer pairs, deleting or rewriting original question-and-answer pairs that retain hint template information; performing syntax format correction on the original question-and-answer pairs to ensure that each original question-and-answer pair meets the uniform structure requirements; and performing semantic similarity filtering on the original question-and-answer pairs, deleting, merging, or rewriting original question-and-answer pairs whose semantic similarity is greater than a preset similarity threshold.
[0082] In step S22 of this embodiment, in addition to the hierarchical quality filtering described above, this embodiment also performs a detailed alignment process on the original question-and-answer pairs, including context exposure correction, semantic ambiguity elimination, and question text rewriting. Manual review is performed on original question-and-answer pairs that are difficult for automatic rules to fully identify. Context exposure refers to an answer depending on a specific accident, chapter, or condition, but the question does not provide this background. Semantic ambiguity elimination refers to supplementing sentences lacking subject and object. For example, if the question in the original question-and-answer pair is "What untimely or non-standard behaviors exist in the accident information reporting process?", but the answer is "In a certain transportation accident, the on-duty personnel exhibited behaviors such as late reporting and omissions," then the answer is considered to expose a specific accident background not mentioned in the question. If the source document block belongs to that accident case, the question is corrected to "In this transportation accident, what untimely or non-standard behaviors exist in the accident information reporting process?"; if the source document block describes general reporting requirements, the specific accident background in the answer is deleted, and a general answer is formed based on the source document block. Question text rewriting refers to rewriting question-and-answer pairs where the question only asks for the cause, and the answer simultaneously provides the cause, measures, and conclusion. Original question-and-answer pairs that are difficult for automatic rules to fully identify refer to question-and-answer pairs with insufficient confidence, semantic ambiguity, conflict, and high-risk security knowledge, which require further manual review.
[0083] S23. The original question-answer pairs retained after hierarchical quality filtering in S22, along with the source identifier information of the document blocks corresponding to the original question-answer pairs, are used as a question-answer sample to construct a coal mine question-answer training dataset consisting of M question-answer samples. ; This represents the j-th question-and-answer sample; M is the number of question-and-answer samples in the coal mine question-and-answer training dataset; j is the index of the question-and-answer sample. The question text in the j-th question-and-answer sample is the question text in the original question-and-answer pair. This refers to the answer text in the j-th question-and-answer sample, i.e., the answer text in the original question-and-answer pair (i.e., the reference answer). This refers to the source identifier information in the j-th question-and-answer sample, which is the source identifier information of the document block that generated the original question-and-answer pair.
[0084] It should be noted that in step S2 of this invention, the purpose of domain fine-tuning is to inject knowledge of coal mine safety regulations, quality inspection, geological exploration, accident cases, policies and regulations, and equipment operation into the pre-trained large language model, enabling it to possess the ability to understand terminology, organize questions and answers, and express standardized ideas in a coal mine professional context. Specifically, the domain fine-tuning of this invention adopts the Parameter-Efficient Fine-Tuning (PEFT) method to obtain a large coal mine domain model.
[0085] In step S2 of this embodiment, the specific process of obtaining the large model in the coal mining field is as follows: a large language model with natural language understanding and generation capabilities is selected as the base model; the coal mining question-answering training dataset is organized into supervised fine-tuning samples and input into the base model for domain fine-tuning; coal mining domain knowledge is learned through a low-rank adaptation matrix to update the trainable parameters of the base model; after training is completed, the large model in the coal mining field is obtained.
[0086] Furthermore, the aforementioned low-rank adaptation process is specifically represented as follows:
[0087]
[0088] in, Indicates the output vector; The output dimension of the output vector; The parameter matrix representing the pre-trained large language model; The input dimension of the input vector; Represents the input vector; Represents a low-rank increment matrix; and This represents a trainable low-rank matrix; Represents a low-rank value that satisfies ; This represents the scaling hyperparameter.
[0089] S3. Extract entity and event information, as well as the interaction relationships between entities, between entities and events, and between events from the document blocks of the coal mine knowledge base, and construct a coal mine knowledge graph.
[0090] It should be noted that the purpose of step S3 is to transform the unstructured knowledge in the coal mine knowledge base into a structured knowledge representation, so as to facilitate subsequent knowledge retrieval, path analysis, and logical reasoning. By simultaneously modeling entities, relationships, and events, the ability to structurally express coal mine regulations, accident scenarios, and emergency response procedures can be enhanced.
[0091] It should be noted that the specific process of constructing the coal mine knowledge graph in step S3 of this invention is as follows:
[0092] S31. First, identify entities and events in the document block. The large language model identifies noun objects as entities and actions or state changes as events from the text content of the document block. The identified entities include legal and regulatory entities, equipment and facilities entities, job responsibility entities, disaster type entities, emergency measures entities, and detection indicator entities. The identified events include accident events, violation events, inspection process events, and emergency response events.
[0093] S32. Then input all document blocks into the large language model, which will identify the interaction relationships between entities, between entities and events, and between events. The identified interaction relationships include prescriptive relationships, applicable relationships, causal relationships, preventive relationships, inspection relationships, disposition relationships, belonging relationships, and corresponding relationships.
[0094] S34. Construct triples based on the identified entities, events, and interaction relationships; the subject and object of the triple are both entities or events; the relationship in the triple is an interaction relationship between entities, or an interaction relationship between events, or an interaction relationship between an entity and an event.
[0095] S35. For the triples extracted in step S34, perform schema induction to generalize the entities to be inducible into a unified type. During schema induction, contextual information of the neighbor set of the entities to be inducible is introduced to reduce induction bias caused by entity ambiguity.
[0096] Furthermore, in step S35, the abstract type induction process is specifically represented as follows:
[0097]
[0098] in, The optimal abstract type representing the entity to be summarized; The candidate abstract type with the highest probability; Indicates a candidate abstract type; Indicates entities to be categorized; Represents the set of neighbors of the entity to be classified; This indicates sampling of the neighbor set; This represents the contextual semantic information constructed based on sampled neighbors.
[0099] For example, the entity to be categorized is "fully mechanized mining face A". In the triple constructed in step S34, the knowledge related to "fully mechanized mining face A" includes: fully mechanized mining face A is equipped with a coal mining machine, fully mechanized mining face A is equipped with hydraulic supports, fully mechanized mining face A is equipped with a methane sensor, the detection index of fully mechanized mining face A includes gas concentration, and coal miners are working on fully mechanized mining face A. Therefore, the neighbor set of fully mechanized mining face A includes entities such as coal mining machine, hydraulic supports, methane sensor, gas concentration, and coal miners.
[0100] From the aforementioned neighbor set, a representative group of neighbors is selected, and considering the relationships between the entity to be summarized and each neighbor, the following contextual semantic information is constructed: Longwall face A is the location where coal mining machines, hydraulic supports, and methane sensors are installed, and where coal miners conduct mining operations. Based on this contextual semantic information, "production work site," "equipment and facilities," and "personnel" are considered as candidate abstract types for comparison. Since "longwall face A" has locational associations with various production equipment, safety monitoring equipment, and personnel, "production work site" has the most consistent contextual semantics with this entity and the highest probability of correspondence. Therefore, "production work site" is determined as the optimal abstract type for "longwall face A."
[0101] S36. Based on the optimal abstraction type of the entity to be summarized, the large language model performs a unified mapping of synonymous entities, similar relationships, and similar events to obtain a coal mine knowledge graph; the nodes in the coal mine knowledge graph are the identified entities or events, and the edges in the coal mine knowledge graph represent the interaction relationships between nodes.
[0102] S4. After performing semantic parsing and structured representation on the user-input coal mining domain question, input it into the coal mining domain big model and the coal mining knowledge graph reasoning module respectively, and generate the first candidate answer and the second candidate answer accordingly, forming a dual-path candidate answer.
[0103] It should be noted that, in step S4 of this invention, the specific process of generating dual-path candidate answers is as follows:
[0104] S41. Obtain the user-input coal mining-related questions, and use a large language model to perform word segmentation, keyword recognition, coal mining-related topic recognition, entity, event, interaction relationship recognition, and question type recognition in the coal mining-related questions to obtain structured questions.
[0105] Further, in step S41, keyword identification refers to extracting key content from the user's question that represents the object of the inquiry, the abnormal state, and the purpose of the inquiry. Coal mine-related topic identification refers to determining the coal mine professional field to which the question belongs based on the keywords, such as ventilation management, gas control, equipment operation, or emergency response. Question type identification refers to determining what form of answer the user hopes to obtain. Identified question types include: step-by-step questions, definition questions, conditional questions, cause questions, legal basis questions, judgment questions, and comparison questions. For example, for the question "What should on-site personnel do after a local ventilation fan stops operating?", the identified keywords include "local ventilation fan," "stop operating," "on-site personnel," and "do." Based on these keywords, the question is identified as a ventilation management and emergency response topic; based on the expression "how should they do it," it is identified as a step-by-step question. Therefore, subsequent modules should focus on retrieving the disposal measures after a local ventilation fan stops operating and organize the answer according to the operational steps.
[0106] S42. Input the structured question into the large model of the coal mining field. The large model of the coal mining field generates natural language based on the structured question to obtain the first candidate answer.
[0107] S43. Input the structured question into the coal mine knowledge graph reasoning module, which will generate a second candidate answer based on entity matching, relationship retrieval, path analysis, and rule constraints.
[0108] It should be noted that in step S43 of this invention, the process of generating the second candidate answer is as follows:
[0109] S431. The entities read from the structured question are used as key entities. Matching entity nodes or event nodes are retrieved in the coal mine knowledge graph through semantic similarity, and the retrieved nodes are used as target nodes.
[0110] S432. The problem intent in the structured question (e.g., "how to handle", "what caused it", "according to what regulations") is mapped to the interaction relationship in the coal mine knowledge graph through a large language model.
[0111] S433. After completing entity matching and relation retrieval, prioritize searching the coal mine knowledge graph. Nodes directly connected to the target node are retrieved as one-hop facts. When one-hop facts are insufficient to fully answer the user's input question about the coal mining field, multi-hop path expansion is performed within a preset maximum path length to obtain a candidate evidence path set consisting of candidate evidence paths that satisfy the rule constraints. Each candidate evidence path consists of multiple triples:
[0112]
[0113] in, Indicate the path of candidate evidence; Indicates the degree of entity matching; Indicates the degree of relationship matching; As a key entity; The interaction relationships read from the structured question; and These represent the entity matching threshold and the relationship matching threshold, respectively. This indicates that the candidate evidence path meets the preset rule constraints; The normalized candidate evidence path length is obtained by dividing the actual length of the candidate evidence path by the maximum path length. This indicates the maximum path length allowed for retrieval.
[0114] Furthermore, for a given candidate evidence path, whether it meets the rule constraints is determined by a large language model. These rule constraints include correct entity type, correct relation direction, consistent applicable scenarios, reasonable event sequence, no omissions of negation conditions, valid source, and valid regulatory version.
[0115] S434. Sort the candidate evidence paths in the candidate evidence path set according to the matching score, select the top K candidate evidence paths with the highest matching scores as inference paths, and delete duplicate or irrelevant triples in the inference paths. The large language model organizes the triples retained in each inference path into structured evidence records containing subject, interaction relationship, object and source identification information. Then, according to the question type in the coal mining field, the structured evidence records are filled into the preset answer template to obtain the second candidate answer.
[0116] In S434, the matching score The calculation method is as follows:
[0117]
[0118] in, The applicability matching degree is indicated by the large language model comparing entities and / or events in the structured question and reasoning path item by item. In this embodiment, entity names, aliases, and units are standardized before comparison. The applicability matching degree is determined based on the proportion of matching fields to valid condition fields in the structured question. If there is a conflict between entities and / or events in the structured question and reasoning path, the reasoning path is directly deleted. The source quality score corresponding to the inference path is composed of two parts: source reliability and source timeliness. Both source reliability and source timeliness are determined by the large language model based on metadata such as the source type of the original document, the publishing entity of the original document, the source identifier of the original document, the version information of the original document, and the validity status indicating whether the original document is in use or obsolete. Source reliability primarily reflects whether the retrieved triples come from a formal and traceable original document, while source timeliness primarily reflects whether the original document is a currently valid version. Inference paths with unknown sources, those that are outdated, or those that have been replaced by newer versions are not included in answer generation. When an inference path contains multiple sources, the lowest source quality score is used. All are weights.
[0119] Furthermore, in this embodiment, It is 0.30; It is 0.25; It is 0.20; It is 0.20; The value is 0.05. The above weights are example values in one optional implementation and do not constitute a limitation of the present invention. In practical applications, the weights can be adjusted based on verification data with correct evidence path annotations, using the retrieval accuracy of candidate evidence paths and the final question-answering accuracy as the basis for weight selection.
[0120] In S434, for step-by-step questions, evidence records are organized in the order of "direct conclusion, operational steps, applicable conditions, and source basis." For definition questions, cause questions, and judgment questions, content corresponding to their question type is selected to form evidence records; content without supporting evidence is not generated. After the structured organization of evidence records is completed, the user-input coal mining field question, question type, reasoning path, and answer template are input into a large language model with evidence constraint prompts. The large language model performs natural language conversion. The evidence constraint prompts require the large language model to only merge, sort, and express the input triples, and not to add facts, values, or conclusions that do not exist in the reasoning path, and to retain the corresponding source identification information after key conclusions. Therefore, the content and order of the answer are determined by the rules and evidence records; the large language model is only responsible for converting the evidence records into fluent natural language to obtain the second candidate answer.
[0121] It should be noted that in this invention, the first candidate answer is more inclined towards natural language expression and contextual organization, while the second candidate answer is more inclined towards structured knowledge support and traceable reasoning. The two are complementary in terms of knowledge source and expression method.
[0122] S5. A summary-reflection dual-agent collaborative mechanism is adopted to fuse, verify, and correct the two candidate answers to obtain the final intelligent question answering result for coal mines.
[0123] It should be noted that in step S5 of this invention, the summary-reflection dual-agent collaborative mechanism includes a summarizing agent and a reflecting agent, and the specific process for obtaining the coal mine intelligent question-and-answer results is as follows:
[0124] S51. Select the first candidate answer. Second candidate answer Input is a summarizing agent, which is responsible for fusing two candidate answers, removing redundant context and repetitive expressions from both types of candidate answers, retaining key knowledge points, and outputting an intermediate summary answer. .
[0125] In this invention, step S51 does not simply splice the two candidate answers together, but rather compresses and semantically fuses the two candidate answers to make the intermediate summary answer more concise and complete, and to facilitate subsequent reflection and error correction.
[0126] S52. Input the intermediate summary answer into the reflective agent. The reflective agent verifies and corrects conflicting facts, logical errors, duplicate content, illusory information introduced by the large coal mining model, and outdated information brought by the coal mining knowledge graph in the intermediate summary answer. The final coal mining intelligent question answering result is then output. .
[0127] In this invention, step S52 serves to perform final quality control on the intermediate summary answers output by the summarizing agent. Specifically, the reflecting agent checks for duplicate content, conflicting facts, and logical errors in the intermediate summary answers. It then identifies illusory information arising from the text generation process of the large-scale coal mine model and outdated information from the coal mine knowledge graph. Upon discovering these errors, it corrects them, thereby completing self-correction and improving the professionalism, accuracy, and reliability of the coal mine intelligent question-answering results. Conflicting facts in the intermediate summary answers refer to two conclusions that cannot be simultaneously valid for the same object and conditions. Logical errors refer to unreasonable causal relationships, applicable conditions, or operational sequences in the answers. Duplicate content refers to the repeated expression of the same fact or conclusion using different statements. Outdated information from the coal mine knowledge graph refers to the use of expired, replaced, or no longer applicable regulations, systems, and equipment operation knowledge in the answers. For example, when the knowledge graph simultaneously stores old and new versions of a regulation, the reflecting agent should delete the old version content based on the version date and validity status and correct the answer using the currently valid regulation.
[0128] To better demonstrate the specific implementation and technical effects of the present invention, the coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model shown in steps S1 to S5 of the above preferred implementation is applied to a specific example.
[0129] Example
[0130] The specific implementation process of the coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model used in this embodiment is as described above and will not be repeated here.
[0131] In this embodiment, firstly, multiple sources of original documents, including those related to coal mine safety management, quality inspection, geological exploration, accident cases, policies and regulations, and equipment operating procedures, are collected to construct a coal mine knowledge base. Based on this knowledge base, a coal mine question-and-answer training dataset is generated. High-quality question-and-answer samples are obtained through hierarchical quality filtering and used to fine-tune the pre-trained large language model to obtain a large coal mine domain model. Next, a coal mine knowledge graph is constructed based on the coal mine knowledge base. When a user inputs a coal mine domain question, the large coal mine domain language model and the coal mine knowledge graph reasoning module generate corresponding candidate answers. The results are then fused and verified through a summarizing agent and a reflecting agent, ultimately outputting the coal mine intelligent question-and-answer results.
[0132] In this embodiment, InternLM2.5-7B is preferably selected as the base model for domain fine-tuning. To improve the diversity of the coal mine question-answering training dataset, this embodiment introduces models such as GPT-5-Chat, Claude-3.7-Sonnet, DeepSeek-R1, Gemini-2.5-Pro-Preview, and Doubao-Seed-1.6 into the question-answering sample generation stage, and sets the temperature parameter to 0.9. To ensure the factual consistency and linguistic naturalness of the base model in the coal mine knowledge question-answering task, the temperature parameter of the base model is preferably set to 0.25. In the retrieval enhancement control experiment, Dmeta-embedding-zh is preferably used as the similarity retrieval model.
[0133] To comprehensively verify the performance of the method of this invention in coal mine knowledge question answering tasks, this embodiment uses text metrics to comprehensively evaluate the final generated intelligent question answering results (i.e., generated answers). These text metrics include BLEU, METEOR, CIDEr, and BERTScore. BLEU measures the degree of overlap between the generated answer and the reference answer at the word level; METEOR measures the consistency between the generated answer and the reference answer from the perspective of word form variation and semantic matching; CIDEr measures the degree of consensus between the generated answer and the reference answer; and BERTScore measures the similarity between the generated answer and the reference answer from the semantic representation level. These text metrics can be used to characterize the performance of this invention in terms of text generation quality and semantic consistency.
[0134] Furthermore, this embodiment employs evaluation metrics based on a large language model to further analyze the quality of the generated answers. These metrics include knowledge accuracy, logical coherence, content completeness, topic relevance, and overall score. Knowledge accuracy measures whether the generated answer accurately reflects factual knowledge in the coal mining field; logical coherence measures whether the generated answer has a consistent and clear logical structure; content completeness measures whether the generated answer covers the key content required for the question; topic relevance measures whether the generated answer revolves around the user's question topic; and the overall score reflects the overall performance across multiple dimensions. In the evaluation phase, GPT-5 is preferably used as the evaluation model. The score for each model is calculated three times and the average is taken, with the temperature parameter set to 0.0.
[0135] To compare the differences in text generation quality among different models, this embodiment statistically analyzes the experimental results of each model on four text metrics: BLEU, METEOR, CIDEr, and BERTScore. As shown in Table 1, the method of this invention performs exceptionally well on metrics such as BLEU, METEOR, and BERTScore, indicating that the intelligent question-answering results generated by this invention have high consistency and strong semantic matching ability with the reference answers.
[0136] Table 1. Comparison Results of Text Indicators
[0137]
[0138] To evaluate the performance of this invention in knowledge-based question answering in the coal mining field, this embodiment constructs a benchmark consisting of objective questions. The benchmark includes three question types: single-choice, multiple-choice, and true / false questions, with 343 single-choice questions, 29 multiple-choice questions, and 300 true / false questions. To further verify the effectiveness of the method, this embodiment compares the invention with several baseline models in terms of knowledge accuracy, logical coherence, content completeness, topic relevance, comprehensive score, and benchmark score. The comparison results are shown in Table 2. As can be seen from Table 2, the invention demonstrates superior performance in terms of accuracy across multiple indicators, including knowledge accuracy, logical coherence, content completeness, topic relevance, comprehensive score, and the constructed benchmark score, indicating that the method can effectively improve the accuracy and reliability of knowledge-based question answering in the coal mining field. In particular, the invention achieves a benchmark score of 88.39, significantly outperforming several general baseline models.
[0139] Table 2. Comparison results between the present invention and representative baseline models
[0140]
[0141] To further analyze the contribution of each innovative module of this invention to the overall performance, an ablation experiment was also conducted in this embodiment. Since text similarity metrics are not necessarily equivalent to content relevance, this embodiment preferably uses evaluation metrics and benchmark scores based on a large language model for verification in the ablation experiment. The results are shown in Table 3. As shown in Table 3, after removing the multi-agent mechanism, the coal mine knowledge graph, or the large coal mine domain model, all evaluation metrics and benchmark scores decreased to varying degrees, indicating that the summarizing and reflecting agents, the coal mine knowledge graph, and the large coal mine domain model all significantly contribute to the final performance of this invention. Specifically, the coal mine knowledge graph enhances the structured knowledge dependency capability during the reasoning process, the large coal mine domain model improves the professional expression and knowledge adaptation capability for coal mine scenarios, and the multi-agent mechanism further reduces redundant generation and knowledge illusion through summarization and verification.
[0142] Table 3. Ablation results of the present invention
[0143]
[0144] Furthermore, this embodiment also demonstrates that simply employing retrieval enhancement methods does not show a significant advantage in the task of this invention, and its performance is easily affected by the granularity of text segmentation and the choice of embedding model. In contrast, the overall framework constructed by this invention through a coal mine knowledge graph, a large model in the coal mine field, and a summary-reflection dual-agent collaborative mechanism can more stably improve the quality of coal mine knowledge question answering.
[0145] In summary, this invention not only enables high-quality organization and reasoning of coal mine expertise, but also achieves excellent results in multiple dimensions such as knowledge accuracy, logical coherence, topic relevance, content completeness, and benchmark scores, thus verifying the effectiveness and practical value of this invention in coal mine intelligent question-answering scenarios.
[0146] It should also be noted that the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models in the above embodiments can essentially be executed by computer programs or modules. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides an intelligent question-answering system for coal mines based on the collaboration of knowledge graphs and large language models, corresponding to the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models provided in the above embodiments. Figure 2 As shown, it includes:
[0147] The knowledge base construction module is used to acquire multi-source original documents in the coal mining field and perform preprocessing processes including document classification, text extraction, layout cleaning, and document segmentation. The multi-source original documents are segmented into multiple document blocks with source identification information, thereby constructing a coal mining knowledge base.
[0148] The model fine-tuning module is used to generate original question-answer pairs for the coal mining domain based on document blocks in the coal mine knowledge base, and to perform hierarchical quality filtering on the original question-answer pairs to obtain the coal mine question-answer training dataset; based on the coal mine question-answer training dataset, the pre-trained large language model is fine-tuned for the domain, and the fine-tuned large language model is used as the large model for the coal mining domain.
[0149] The knowledge graph construction module is used to extract entity and event information, as well as the interaction relationships between entities, between entities and events, and between events from the document blocks of the coal mine knowledge base, and to construct the coal mine knowledge graph.
[0150] The answer generation module performs semantic parsing and structured representation on the user-input coal mining field question, and then inputs it into the coal mining field big model and the coal mining knowledge graph reasoning module respectively to generate the first candidate answer and the second candidate answer, forming a dual-path candidate answer;
[0151] The results output module is used to fuse, verify, and correct the two candidate answers using a summary-reflection dual-agent collaborative mechanism to obtain the final intelligent question-answering result for coal mines.
[0152] It is understood that the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models described in S1-S5 above can essentially be implemented by a computer program. Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer program product corresponding to the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models provided in the above embodiments. This product includes a computer program / instruction, which, when executed by a processor, can implement the intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models as described in the above embodiments.
[0153] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the coal mine intelligent question-answering method based on knowledge graph and large language model collaboration provided in the above embodiments, such as... Figure 3 As shown, it includes a memory and a processor;
[0154] The memory is used to store computer programs;
[0155] The processor is configured to implement the intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model in the above embodiments when executing the computer program.
[0156] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0157] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model provided in the above embodiments. The storage medium stores a computer program, which, when executed by a processor, can realize the coal mine intelligent question answering method based on the collaboration of knowledge graph and large language model in the above embodiments.
[0158] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by a processor, which can perform the aforementioned steps S1 to S5.
[0159] It is understood that the aforementioned storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage media may also be various media capable of storing program code, such as USB flash drives, external hard drives, magnetic disks, or optical discs.
[0160] It is understood that the processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0161] It should also be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. In the embodiments provided in this application, the division of steps or modules in the system and method is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and a module or step may also be split.
[0162] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained through equivalent substitution or transformation fall within the protection scope of the present invention.
Claims
1. A coal mine intelligent question-answering method based on the collaboration of knowledge graph and large language model, characterized in that, Includes the following steps: S1. Obtain multi-source original documents in the coal mining field and perform preprocessing processes including document classification, text extraction, layout cleaning, and document segmentation. The multi-source original documents are segmented into multiple document blocks with source identification information, thereby constructing a coal mining knowledge base. S2. Generate original question-and-answer pairs for the coal mining field based on document blocks in the coal mine knowledge base, and perform hierarchical quality filtering on the original question-and-answer pairs to obtain the coal mine question-and-answer training dataset; Based on the coal mine question-answering training dataset, the pre-trained large language model is fine-tuned for the domain, and the fine-tuned large language model is used as the large model for the coal mine domain. S3. Extract entity and event information, as well as the interaction relationships between entities, between entities and events, and between events from the document blocks of the coal mine knowledge base, and construct a coal mine knowledge graph; S4. After performing semantic parsing and structured representation on the user-input coal mining domain question, input the results into the coal mining domain big model and the coal mining knowledge graph reasoning module respectively, and generate the first candidate answer and the second candidate answer accordingly, forming a dual-path candidate answer; S5. A summary-reflection dual-agent collaborative mechanism is adopted to fuse, verify, and correct the two candidate answers to obtain the final intelligent question answering result for coal mines.
2. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 1, characterized in that, In S1, the specific process of constructing the coal mine knowledge base is as follows: S11. Classify the acquired multi-source original documents according to the document topic, and divide the multi-source original documents into six categories: safety management documents, quality inspection documents, geological exploration documents, accident case analysis reports, policy and regulation documents, and equipment operation procedure documents; S12. Perform text extraction and layout cleaning on multi-source original documents, and delete invalid headers and footers, blank characters, garbled characters and non-text information; S13. Based on the document title and chapter level, the text content of the original documents from multiple sources is divided into paragraphs and blocks to obtain multiple semantically complete document blocks. Source identification information is established for each document block. The text content and source identification information of all document blocks are organized in a unified manner to form a coal mine knowledge base.
3. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 1, characterized in that, In S2, the hierarchical quality filtering performed includes: extra prefix cleanup, duplicate content detection, hint leakage detection, syntax correction, and semantic similarity filtering.
4. The intelligent question-answering method for coal mines based on the collaboration of knowledge graphs and large language models as described in claim 3, characterized in that, In S2, the construction process of the coal mine question-answering training dataset is as follows: S21. Input the pre-built prompt template for the coal mining field and the document block into one or more large language models, guide the large language models to generate original question-answer pairs around the text content of the document block, and store the original question-answer pairs in a structured manner. S22. Perform hierarchical quality filtering on the original question-answer pairs, including: performing additional prefix cleanup on the original question-answer pairs, and removing non-question-answer text content containing JSON wrappers and additional tags; The system performs duplicate content detection on the original question-and-answer pairs and deletes those containing duplicate text. It also performs hint leakage detection on the original question-and-answer pairs and deletes or rewrites those that retain the hint template information. Furthermore, it performs grammatical format correction on the original question-and-answer pairs to ensure that each pair meets the uniform structural requirements. Finally, it performs semantic similarity filtering on the original question-and-answer pairs and deletes, merges, or rewrites those with semantic similarity greater than a preset similarity threshold. S23. The original question-answer pairs retained after hierarchical quality filtering in S22, along with the source identifier information of the document blocks corresponding to the original question-answer pairs, are used as a question-answer sample to construct a coal mine question-answer training dataset consisting of multiple question-answer samples.
5. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 1, characterized in that, In S2, the field fine-tuning of the present invention adopts a parameter-efficient fine-tuning method to obtain a large model of the coal mine field.
6. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 1, characterized in that, In S3, the specific process of constructing a coal mine knowledge graph is as follows: S31. First, identify entities and events in the document block. The large language model identifies noun objects as entities and actions or state changes as events from the text content of the document block. The identified entities include legal and regulatory entities, equipment and facilities entities, job responsibility entities, disaster type entities, emergency measures entities, and detection indicator entities. The identified events include accident occurrence events, violation events, inspection process events, and emergency response events. S32. Then input all document blocks into the large language model, which will identify the interaction relationships between entities, between entities and events, and between events. The identified interaction relationships include prescriptive relationships, applicable relationships, causal relationships, preventive relationships, inspection relationships, disposition relationships, belonging relationships, and corresponding relationships. S34. Construct triples based on the identified entities, events, and interaction relationships; the subject and object of the triple are both entities or events; the relationship in the triple is an interaction relationship between entities, or an interaction relationship between events, or an interaction relationship between an entity and an event; S35. For the triples extracted in step S34, perform abstract type induction to generalize the entities to be inducible into a unified type; In the process of abstract type induction, contextual information about the neighbor set of the entity to be induced is introduced; S36. Based on the optimal abstraction type of the entity to be summarized, the large language model performs a unified mapping of synonymous entities, similar relationships, and similar events to obtain a coal mine knowledge graph; the nodes in the coal mine knowledge graph are the identified entities or events, and the edges in the coal mine knowledge graph represent the interaction relationships between nodes.
7. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 6, characterized in that, In S4, the specific process of generating dual-path candidate answers is as follows: S41. Obtain the user-input coal mining-related questions, and use a large language model to perform word segmentation, keyword recognition, coal mining-related topic recognition, entity, event, interaction relationship recognition, and question type recognition in the coal mining-related questions to obtain structured questions; S42. Input the structured question into the large model of the coal mining field, and the large model of the coal mining field generates natural language based on the structured question to obtain the first candidate answer; S43. Input the structured question into the coal mine knowledge graph reasoning module, which will generate a second candidate answer based on entity matching, relationship retrieval, path analysis, and rule constraints.
8. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 7, characterized in that, In S43, the process of generating the second candidate answer is as follows: S431. The entities read from the structured question are used as key entities. Matching entity nodes or event nodes are retrieved in the coal mine knowledge graph through semantic similarity, and the retrieved nodes are used as target nodes. S432. The question intent in the structured question is mapped to the interaction relationship in the coal mine knowledge graph through a large language model; S433. After completing entity matching and relation retrieval, prioritize searching the coal mine knowledge graph. Nodes directly connected to the target node are retrieved as one-hop facts. When one-hop facts are insufficient to fully answer the user's input question about the coal mining field, multi-hop path expansion is performed within a preset maximum path length to obtain a candidate evidence path set consisting of candidate evidence paths that satisfy the rule constraints. Each candidate evidence path consists of multiple triples: ; in, Indicate the path of candidate evidence; Indicates the degree of entity matching; Indicates the degree of relationship matching; As a key entity; The interaction relationships read from the structured question; and These represent the entity matching threshold and the relationship matching threshold, respectively. This indicates that the candidate evidence path meets the preset rule constraints; The normalized candidate evidence path length is obtained by dividing the actual length of the candidate evidence path by the maximum path length. Indicates the maximum allowed path length for retrieval; S434. Sort the candidate evidence paths in the candidate evidence path set according to the matching score, select the top K candidate evidence paths with the highest matching scores as inference paths, and delete duplicate or irrelevant triples in the inference paths. The large language model organizes the triples retained in each inference path into structured evidence records containing subject, interaction relationship, object and source identification information. Then, according to the question type in the coal mining field, the structured evidence records are filled into the preset answer template to obtain the second candidate answer, where K is the number of inference paths.
9. The intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in claim 1, characterized in that, In S5, the summary-reflection dual-agent collaborative mechanism includes a summarizing agent and a reflecting agent. The specific process for obtaining the coal mine intelligent question-and-answer results is as follows: S51. Input the first and second candidate answers into the summarizing agent. The summarizing agent is responsible for merging the two candidate answers, deleting redundant context and repeated expressions in the two types of candidate answers, retaining key knowledge points, and outputting intermediate summary answers. S52. Input the intermediate summary answer into the reflective agent. The reflective agent verifies and corrects conflicting facts, logical errors, duplicate content, illusory information introduced by the large coal mining model, and outdated information brought by the coal mining knowledge graph in the intermediate summary answer. The final coal mining intelligent question answering result is then output.
10. A computer electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the intelligent question-answering method for coal mines based on the collaboration of knowledge graph and large language model as described in any one of claims 1 to 9.