Regulation query method and device based on coal mine regulation knowledge graph

By using a knowledge graph-based regulatory query method for coal mine regulations, combining semantic similarity and graph similarity, the problems of terminology differences and citation relationships in coal mine regulation queries are solved, achieving accuracy and completeness in regulation queries and improving the efficiency of coal mine safety supervision.

CN121935368BActive Publication Date: 2026-06-23CHINA COAL TECH GRP INFORMATION TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA COAL TECH GRP INFORMATION TECH CO LTD
Filing Date
2026-03-30
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies for coal mine safety supervision suffer from problems such as complex regulations, significant differences in terminology, and difficulty in tracing citation relationships. This leads to inaccurate regulatory searches, an inability to effectively identify variant or synonymous expressions and indirect citations, and ultimately affects regulatory efficiency.

Method used

A regulatory query method based on coal mine regulations knowledge graph is adopted. Through a two-dimensional retrieval mechanism of semantic similarity and graph similarity, combined with depth-first search, a complete chain containing direct and indirect reference clauses is generated, and a large language model is used to generate the response text.

Benefits of technology

It has improved the accuracy of regulatory searches, can identify variant and synonymous expressions, and fully trace the relationship of regulatory citations, thereby improving the accuracy and completeness of obtaining regulatory basis and significantly improving the efficiency of coal mine safety supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935368B_ABST
    Figure CN121935368B_ABST
Patent Text Reader

Abstract

The disclosure provides a regulation query method and device based on a coal mine regulation knowledge graph, and relates to the technical field of coal mine safety. The method comprises the following steps: obtaining a coal mine case text to be queried, a coal mine case set and a coal mine regulation knowledge graph; calculating the semantic similarity of the case text and each historical case, and taking the obtained semantic similarity as the semantic similarity component of the corresponding regulation; calculating the graph similarity of the case text and each node of the knowledge graph to obtain the graph similarity component of each regulation; and fusing the semantic and graph similarity components to select a target regulation and generate a reply text. Through the fusion of semantic matching and graph structure association, the disclosure can accurately screen the target clauses that are closely related to the semantic of the case text and the structure from the overall regulation system, realizes end-to-end accurate query from case description to regulation matching, and significantly improves the accuracy and completeness of the regulation basis obtained in the coal mine safety supervision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of coal mine safety technology, and in particular to a method and apparatus for querying regulations based on a coal mine regulations knowledge graph. Background Technology

[0002] In coal mine safety supervision, regulations and ordinances are the core basis for judging whether production activities are compliant. The coal mine regulatory system is characterized by its complex hierarchy, close interrelationships, and dense concentration of technical terminology, posing significant limitations to existing technologies in practical applications. Keyword-based full-text search technologies (such as Elasticsearch) rely solely on literal text matching, making it difficult to handle the differences in terminology used in the coal mine field. For example, the common description of "overproduction" in actual supervision cannot be accurately matched with the regulatory text's expression of "organizing production beyond capacity" using keywords, leading to prominent issues of missed or incorrect matches. Furthermore, multi-level referencing relationships are common among coal mine regulations, such as clause A referencing clause B, and clause B referencing clause C. Traditional search methods cannot trace such indirect references, making it easy for regulators to overlook violations. Therefore, a new regulatory search method is urgently needed to address the difficulties in terminology matching and the lack of traceability of cited clauses in existing technologies, thereby improving the accuracy and efficiency of coal mine safety supervision. Summary of the Invention

[0003] This disclosure aims to at least partially address one of the technical problems in the related art.

[0004] Therefore, the first aspect of this disclosure proposes a regulatory query method based on a coal mine regulatory knowledge graph, comprising the following steps:

[0005] The system determines the text of the coal mine case to be queried, a pre-constructed set of coal mine cases, and a pre-constructed knowledge graph of coal mine regulations. The set of coal mine cases includes multiple historical coal mine cases, each of which has its corresponding coal mine regulations. The knowledge graph of coal mine regulations uses coal mine regulations as nodes and the relationships between coal mine regulations as edges.

[0006] Semantic similarity calculations are performed on the coal mine case text and the multiple historical coal mine cases respectively, and the semantic similarity component corresponding to each historical coal mine case is used as the semantic similarity component of its corresponding coal mine regulations.

[0007] Determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph to obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph;

[0008] Based on the semantic similarity component and the graph similarity component of the coal mine regulations, a relevance score is determined between each coal mine regulation and the coal mine case text;

[0009] Based on the relevance score, a target coal mine regulation is selected from among the multiple coal mine regulations, and a response text corresponding to the coal mine case text is generated based on the target coal mine regulation.

[0010] In some embodiments of this disclosure, the semantic similarity between the coal mine case text and the plurality of historical coal mine cases is calculated using the following formula:

[0011]

[0012] in, The text refers to the coal mine case study. Historical coal mine case studies Historical coal mine case studies The corresponding semantic similarity components.

[0013] In some embodiments of this disclosure, the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph is determined by the following formula, thereby obtaining the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph:

[0014]

[0015] in, Coal Mine Case Text Coal Mine Regulations in the Knowledge Graph The similarity between the graphs This is a computational function based on the graph attention mechanism. To comply with coal mine regulations The triggered k-hop neighborhood subgraph.

[0016] In some embodiments of this disclosure, determining a relevance score between the coal mine regulations and the coal mine case text based on the semantic similarity component and the graph similarity component includes: determining a first weight for the semantic similarity component and a second weight for the graph similarity component; and performing weighted processing on the semantic similarity component and the graph similarity component based on the first weight and the second weight to obtain a relevance score between the coal mine regulations and the coal mine case text.

[0017] In some embodiments of this disclosure, the step of selecting a target coal mine regulation from among multiple coal mine regulations based on the relevance score, and generating a response text corresponding to the coal mine case text based on the target coal mine regulation, includes: selecting coal mine regulations with a relevance score greater than a preset score threshold as the target coal mine regulations; recursively tracing the target coal mine regulations using depth-first search (DFS) based on the relationships in the coal mine regulation knowledge graph to obtain a complete citation chain containing direct and indirect citation clauses; and inputting the target coal mine regulations and the complete citation chain into a large language model to generate the response text containing the regulatory basis.

[0018] In some embodiments of this disclosure, the coal mine regulations in the coal mine regulations knowledge graph include at least one of the following: regulations, clauses, and feature indicators; the relationships between the coal mine regulations include at least one of the following: reference relationships between regulations, attribution relationships between clauses and regulations, attribution relationships between feature indicators and clauses, and logical relationships between multiple features.

[0019] The second aspect of this disclosure provides a regulatory query device based on a coal mine regulatory knowledge graph, comprising:

[0020] The determination module is used to determine the coal mine case text to be queried, the pre-constructed coal mine case set, and the pre-constructed coal mine regulation knowledge graph. The coal mine case set includes multiple historical coal mine cases, each of which has its corresponding coal mine regulation. The coal mine regulation knowledge graph uses coal mine regulations as nodes and the relationships between coal mine regulations as edges.

[0021] The semantic similarity calculation module is used to perform semantic similarity calculation on the coal mine case text and the multiple historical coal mine cases respectively, and take the semantic similarity component corresponding to each historical coal mine case as the semantic similarity component of its corresponding coal mine regulations.

[0022] The graph similarity calculation module is used to determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph, and to obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph.

[0023] The scoring module is used to determine the relevance score between each coal mine regulation and the coal mine case text based on the semantic similarity component and the graph similarity component of the coal mine regulations.

[0024] The generation module is used to select a target coal mine regulation from among multiple coal mine regulations based on the relevance score, and generate a response text corresponding to the coal mine case text based on the target coal mine regulation.

[0025] In some embodiments of this disclosure, the generation module is specifically used to: select coal mine regulations whose relevance scores are greater than a preset score threshold from among the multiple coal mine regulations as the target coal mine regulations; based on the relationships in the coal mine regulations knowledge graph, use depth-first search (DFS) to recursively trace the target coal mine regulations to obtain a complete citation chain containing direct and indirect citation clauses; input the target coal mine regulations and the complete citation chain into a large language model to generate the response text containing the legal basis.

[0026] A third aspect of this disclosure provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0027] The memory stores computer-executed instructions;

[0028] The processor executes computer execution instructions stored in the memory to implement the method described in the first aspect above.

[0029] A fourth aspect of this disclosure provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect above.

[0030] The regulatory query method based on a coal mine regulatory knowledge graph disclosed herein significantly improves the accuracy of coal mine regulatory queries by integrating a two-dimensional retrieval mechanism that combines semantic similarity and graph similarity. Addressing the matching challenges caused by differences in professional terminology within the coal mining field, semantic similarity calculation effectively identifies heterogeneous synonyms, avoiding missed matches in keyword searches. Simultaneously, graph similarity calculation incorporates structured relational information from the regulatory knowledge graph, enabling the retrieval process to fully consider logical relationships such as citation and attribution between clauses, overcoming the shortcomings of traditional semantic retrieval which relies solely on textual similarity while neglecting structural connections within regulations. The resulting relevance score accurately filters target clauses from the overall regulatory system that are semantically relevant and structurally interconnected with the case text, generating response text based on this. This achieves end-to-end accurate querying from case description to regulatory matching, significantly improving the accuracy and completeness of regulatory basis acquisition in coal mine safety supervision.

[0031] Additional aspects and advantages of this disclosure 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 this disclosure. Attached Figure Description

[0032] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:

[0033] Figure 1 A flowchart illustrating a regulatory query method based on a coal mine regulatory knowledge graph, provided as an embodiment of this disclosure;

[0034] Figure 2 This is a schematic diagram of a regulatory query device based on a coal mine regulatory knowledge graph, provided as an embodiment of the present disclosure. Detailed Implementation

[0035] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0036] Specifically, the following describes, with reference to the accompanying drawings, a regulatory query method and apparatus based on a coal mine regulatory knowledge graph according to embodiments of this disclosure.

[0037] Figure 1 This is a flowchart illustrating a regulatory query method based on a coal mine regulatory knowledge graph, provided as an embodiment of this disclosure. Figure 1 As shown, the regulatory query method based on the coal mine regulatory knowledge graph may include the following steps:

[0038] Step 101: Determine the coal mine case text to be queried, the pre-constructed coal mine case set, and the pre-constructed coal mine regulation knowledge graph. The coal mine case set includes multiple historical coal mine cases, each of which has its corresponding coal mine regulation. The coal mine regulation knowledge graph uses coal mine regulations as nodes and the relationships between coal mine regulations as edges.

[0039] In some embodiments of this disclosure, the coal mine regulations knowledge graph can be pre-built based on a coal mine regulations database. It is a set of structured legal provisions. Each legal provision... Include:

[0040] : Structured metadata of regulations, including the legal document to which it belongs, chapter number, and clause number;

[0041] : The specific content of the terms and conditions;

[0042] Clause constraint features (optional) include one or more structured numerical or logical rules.

[0043] In some embodiments of this disclosure, the coal mine regulations in the coal mine regulations knowledge graph include at least one of the following: regulations, clauses, and feature indicators. The relationships between coal mine regulations include at least one of the following: reference relationships between regulations, attribution relationships between clauses and regulations, attribution relationships between feature indicators and clauses, and logical relationships between multiple features.

[0044] Among them, the coal mine regulations knowledge graph Expanding the general graph to include node and relationship types specific to the coal mining sector:

[0045] Vertex set :

[0046] : Regulatory document node, attributes include file name and category;

[0047] : Specific clause nodes, with attributes including clause number and clause text content;

[0048] : Feature indicator node, attributes include feature name.

[0049] Edge set E contains the core relation r∈R of the coal mining domain, including:

[0050] The relationship of citation between legal provisions;

[0051] The relationship between clauses and regulations or features and their attribution;

[0052] The binding relationship between clauses and features;

[0053] Logical relationships between multiple features.

[0054] Attribute set A: Attributes unique to nodes or edges (e.g., ...) The node's file name and category attributes.

[0055] Coal Mine Case Studies It can cover coal mine ledgers, inspection records, etc., for each historical coal mine case. Distinguishing between text and structured data:

[0056] Case content;

[0057] Case structure characteristics (such as production data, monthly output of 87,000 tons, approved capacity of 75,000 tons).

[0058] Furthermore, each historical coal mine case corresponds to a specific coal mine regulation.

[0059] Step 102: Perform semantic similarity calculations on the coal mine case text and multiple historical coal mine cases respectively, and use the semantic similarity component corresponding to each historical coal mine case as the semantic similarity component of its corresponding coal mine regulations.

[0060] In some embodiments of this disclosure, the cosine similarity between the semantic vectors of historical coal mine cases and the text vectors of coal mine cases can be calculated to determine the semantic similarity components. As an example, the semantic similarity between the coal mine case text and multiple historical coal mine cases can be calculated using the following formula:

[0061]

[0062] in, This is a case study text related to a coal mine. Historical coal mine case studies Historical coal mine case studies The corresponding semantic similarity components. Once the semantic similarity components for each historical coal mine case are determined, the corresponding coal mine regulations for that historical coal mine case are also determined. semantic similarity components .

[0063] Step 103: Determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph, and obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph.

[0064] In some embodiments of this disclosure, the relevance is calculated using the association information of provisions in the regulatory knowledge graph. The graph similarity between the coal mine case text and each node in the coal mine regulatory knowledge graph can be determined by the following formula, thus obtaining the graph similarity component of each coal mine regulation in the coal mine regulatory knowledge graph:

[0065]

[0066] in, Coal Mine Case Text Coal Mine Regulations in the Knowledge Graph The similarity of the graphs between them is important for coal mine regulations. definition To comply with coal mine regulations The triggered k-hop neighborhood subgraph first finds the neighbor nodes of the text, and takes a total of K multi-hop neighborhood subgraphs from which the text originates. This is a computational function based on a graph attention mechanism. It calculates the importance of each neighbor node using graph attention: assigning higher attention weights to neighbors more relevant to the case, and then summing these weights together with the edge weights.

[0067]

[0068] in, These are the edge weight parameters. The attention weight calculation function is as follows:

[0069]

[0070] in, This is a vector representation of the case text. Let be the vector representation of the regulatory node e. The vector representation of the neighbor node v. For attention transformation matrix, This is the attention weight vector. This represents vector concatenation, with LeakyReLU being a non-linear activation function, and the denominator being a subset of all neighboring nodes. Normalization ensures that the sum of the weights is 1.

[0071] Step 104: Determine the relevance score between each coal mine regulation and the coal mine case text based on the semantic similarity component and the graph similarity component of the coal mine regulations.

[0072] In some embodiments of this disclosure, a first weight for the semantic similarity component and a second weight for the graph similarity component can be determined; the semantic similarity component and the graph similarity component are weighted based on the first weight and the second weight to obtain a correlation score between coal mine regulations and coal mine case texts.

[0073] As an example, the relevance score between coal mine regulations and coal mine case texts can be determined using the following formula:

[0074]

[0075] in, Coal Mine Regulations Coal Mine Case Text Correlation score between them The first weight of the semantic similarity component. Coal Mine Regulations semantic similarity components, This is the second weight of the graph similarity component. Coal Mine Case Text Coal Mine Regulations in the Knowledge Graph The similarity of the graphs between them.

[0076] The constraints on the relevance scoring formula may include:

[0077] (Component weight normalization);

[0078] (Embedding vector normalization);

[0079] It can be dynamically adjusted based on the balance between recall and precision.

[0080] Step 105: Select the target coal mine regulation from multiple coal mine regulations based on the relevance score, and generate the response text corresponding to the coal mine case text based on the target coal mine regulation.

[0081] In some embodiments of this disclosure, a retrieval function may be defined. satisfy:

[0082] The text relevance score of coal mine case studies used for selection from multiple coal mine regulations and user queries is greater than or equal to a preset score threshold. The coal mine regulations are used as the target coal mine regulations, and a preset scoring threshold is set. It can be dynamically adjusted based on a trade-off between recall and precision. Among them:

[0083] for power set ;

[0084] ;

[0085] (Embedding vector normalization);

[0086] τ∈[0,1].

[0087] In some embodiments of this disclosure, to improve the comprehensiveness of the query regulations and deeply mine relevant legal provisions, coal mine regulations with a relevance score greater than a preset score threshold can be selected as target coal mine regulations. Based on the relationships in the coal mine regulation knowledge graph, a depth-first search (DFS) is used to recursively trace the target coal mine regulations to obtain a complete citation chain containing both direct and indirect citations. The target coal mine regulations and the complete citation chain are then input into a large language model to generate a response text containing the legal basis. This constructs a full-link tracing path extending from the target clauses to the indirect citations. This mechanism is based on... The Depth-First Search (DFS) traversal of the knowledge graph automatically locates the upstream basic clauses, parallel related clauses, and derived explanatory clauses referenced by the target clause, forming a complete "target clause - directly referenced clause - indirectly referenced clause" citation chain. This ensures that no indirectly referenced clauses are omitted, achieving a citation chain completeness of 98% and preventing regulators from overlooking any grounds for violation.

[0088] This disclosure proposes a retrieval-augmented generation (RAG) regulatory query method based on a coal mine regulations knowledge graph. This framework combines knowledge graphs and text vectorization techniques for retrieval enhancement, taking into account the domain characteristics of coal mine regulations and cases. It is suitable for texts with extremely high semantic complexity in coal mine legal knowledge bases. In another embodiment, the Graph RAG regulatory query method based on a coal mine regulations knowledge graph may include three stages: an index building stage, a pipeline processing stage, and a query stage.

[0089] (1) Index building stage

[0090] Source document (original regulatory document, such as the full text of the "Coal Mine Safety Regulations" or a lengthy case report) → Text blocks: First, extract the text from the source document and divide it into smaller text blocks, such as by clause or by paragraph.

[0091] Text Block → Element Instance: Large-scale language models (LLMs) such as Qwen / QVQ-72B-Preview are used to extract entity, relation, and attribute information from each text block to form element instances. This process is achieved by customizing LLM prompts, such as providing a small number of examples for contextual learning. For example, from regulatory texts, entities (e.g., clause "Article 81"), relations (e.g., "reference" to Article 3 of the Special Provisions), and attributes (e.g., clause content: ......, document category: departmental regulations) are extracted; from case text blocks, characteristic indicators (e.g., "overproduction", "monthly output 87,000 tons") and the potential violations corresponding to these indicators are extracted.

[0092] Element Instance → Element Summary: This step summarizes different instances of the same element / entity, generating a unified description of the element, such as "designed capacity" and "approved capacity," or "overproduction" and "excess production." This step uses LLM to extract information and further abstract and integrate it, eliminating terminological differences.

[0093] Element Summary → Graph Community: Element instances are constructed into a graph structure, where nodes represent entities and edges represent relationships. Then, a community detection algorithm (e.g., Leiden's algorithm) is used to divide the graph into different communities, each containing closely related entities. The extracted entities are used as nodes (V) and relationships as edges (E), constructing a complete knowledge graph of coal mine regulations. ).

[0094] (2) Assembly line processing stage

[0095] This stage primarily involves embedding and vectorization processing. (For the coal mine regulations database...) Each clause Embedded vectorization processing is For the coal mine case study set Each case Embedded vectorization processing is .

[0096] (3) Query stage

[0097] The query phase can employ any of the above embodiments of the regulatory query method based on a coal mine regulatory knowledge graph.

[0098] By implementing the embodiments of this disclosure, a significant improvement in the accuracy of coal mine regulation queries is achieved through a two-dimensional retrieval mechanism that integrates semantic similarity and graph similarity. Addressing the matching challenges caused by differences in professional terminology within the coal mining field, semantic similarity calculation effectively identifies heterogeneous synonyms, avoiding missed matches in keyword retrieval. Simultaneously, graph similarity calculation introduces structured relational information from the regulatory knowledge graph, enabling the retrieval process to fully consider logical relationships such as citations and attribution between clauses, overcoming the shortcomings of traditional semantic retrieval which relies solely on textual similarity while ignoring structural connections within regulations. The resulting relevance score accurately filters target clauses from the overall regulatory system that are semantically relevant and structurally interconnected with the case text, generating response text based on this. This achieves end-to-end accurate querying from case description to regulation matching, significantly improving the accuracy and completeness of regulatory basis acquisition in coal mine safety supervision.

[0099] This invention achieves a fusion retrieval of semantic similarity and structural relevance through a dual-driven mechanism of semantic embedding and knowledge graph structural reasoning in the coal mining field. Tested on a self-made dataset, the accuracy rate of traditional Elasticsearch retrieval is 75.3%, while the accuracy rate of semantic retrieval alone is 82.1%. The accuracy rate of the proposed method is improved to 92.7%, significantly enhancing precision.

[0100] Figure 2 This is a schematic diagram of a regulatory query device based on a coal mine regulatory knowledge graph, provided as an embodiment of this disclosure. Figure 2 As shown, the regulatory query device based on the coal mine regulations knowledge graph may include: a determination module 201, a semantic similarity calculation module 202, a graph similarity calculation module 203, a scoring module 204, and a generation module 205.

[0101] The determination module 201 is used to determine the coal mine case text to be queried, the pre-built coal mine case set, and the pre-built coal mine regulation knowledge graph. The coal mine case set includes multiple historical coal mine cases, each of which has its corresponding coal mine regulation. The coal mine regulation knowledge graph uses coal mine regulations as nodes and the relationships between coal mine regulations as edges.

[0102] The semantic similarity calculation module 202 is used to calculate the semantic similarity between the coal mine case text and multiple historical coal mine cases, and to use the semantic similarity component corresponding to each historical coal mine case as the semantic similarity component of its corresponding coal mine regulations.

[0103] The graph similarity calculation module 203 is used to determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph, and to obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph.

[0104] The scoring module 204 is used to determine the relevance score between each coal mine regulation and the coal mine case text based on the semantic similarity component and the graph similarity component of the coal mine regulations.

[0105] The generation module 205 is used to select a target coal mine regulation from multiple coal mine regulations based on the relevance score, and generate a response text corresponding to the coal mine case text based on the target coal mine regulation.

[0106] In some embodiments of this disclosure, the generation module 205 is specifically used to: select coal mine regulations with a relevance score greater than a preset score threshold from among multiple coal mine regulations as target coal mine regulations; based on the relationships in the coal mine regulations knowledge graph, use depth-first search (DFS) to recursively trace the target coal mine regulations to obtain a complete citation chain containing direct and indirect citation clauses; input the target coal mine regulations and the complete citation chain into a large language model to generate a response text containing the legal basis.

[0107] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0108] To implement the above embodiments, this disclosure also proposes an electronic device, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0109] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.

[0110] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0111] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0112] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.

[0113] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0114] It should be understood that various parts of this disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0115] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0116] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0117] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A regulatory query method based on a coal mine regulatory knowledge graph, characterized in that, Includes the following steps: The system determines the text of the coal mine case to be queried, a pre-constructed set of coal mine cases, and a pre-constructed knowledge graph of coal mine regulations. The set of coal mine cases includes multiple historical coal mine cases, each of which has its corresponding coal mine regulations. The knowledge graph of coal mine regulations uses coal mine regulations as nodes and the relationships between coal mine regulations as edges. Semantic similarity calculations are performed on the coal mine case text and the multiple historical coal mine cases respectively, and the semantic similarity component corresponding to each historical coal mine case is used as the semantic similarity component of its corresponding coal mine regulations. Determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph to obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph; Based on the semantic similarity component and the graph similarity component of the coal mine regulations, a relevance score is determined between each coal mine regulation and the coal mine case text; Based on the relevance score, a target coal mine regulation is selected from among multiple coal mine regulations, and a response text corresponding to the coal mine case text is generated based on the target coal mine regulation. Based on the semantic similarity component and the graph similarity component of the coal mine regulations, a relevance score is determined between the coal mine regulations and the coal mine case text, including: Determine the first weight of the semantic similarity component and the second weight of the graph similarity component; The semantic similarity component and the graph similarity component are weighted based on the first weight and the second weight to obtain the relevance score between the coal mine regulations and the coal mine case text.

2. The method according to claim 1, characterized in that, The semantic similarity between the coal mine case text and the multiple historical coal mine cases is calculated using the following formula: in, The text refers to the coal mine case study. Historical coal mine case studies Historical coal mine case studies The corresponding semantic similarity components.

3. The method according to claim 1, characterized in that, The graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph is determined by the following formula, thus obtaining the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph: in, Coal Mine Case Text Coal Mine Regulations in the Knowledge Graph The similarity between the graphs This is a computational function based on the graph attention mechanism. To comply with coal mine regulations The triggered k-hop neighborhood subgraph, Attn() is the attention weight calculation function, and w(v,l) is the edge weight parameter. This is a vector representation of the case text. Let be the vector representation of the regulatory node e. The vector representation of the neighbor node v. For attention transformation matrix, For attention weight vectors, This represents vector concatenation, where LeakyReLU is a non-linear activation function, and the denominator is the sum of all neighboring nodes. Normalization ensures that the sum of the weights is 1.

4. The method according to claim 1, characterized in that, The step of selecting a target coal mine regulation from among multiple coal mine regulations based on the relevance score, and generating a response text corresponding to the coal mine case text based on the target coal mine regulation, includes: The coal mine regulations whose relevance scores are greater than a preset score threshold among the multiple coal mine regulations are selected as the target coal mine regulations. Based on the relationships in the coal mine regulations knowledge graph, depth-first search (DFS) is used to recursively trace the target coal mine regulations to obtain a complete reference chain containing both directly and indirectly referenced clauses. The target coal mine regulations and the complete citation chain are input into the large language model to generate the response text containing the regulatory basis.

5. The method according to any one of claims 1-4, characterized in that, The coal mine regulations in the coal mine regulations knowledge graph include at least one of the following: regulations, clauses, and characteristic indicators; The relationships between the coal mine regulations include at least one of the following: the citation relationship between regulations, the attribution relationship between clauses and regulations, the attribution relationship between characteristic indicators and clauses, and the logical relationship between multiple characteristics.

6. A regulatory query device based on a coal mine regulatory knowledge graph, characterized in that, include: The determination module is used to determine the coal mine case text to be queried, the pre-constructed coal mine case set, and the pre-constructed coal mine regulation knowledge graph. The coal mine case set includes multiple historical coal mine cases, each of which has its corresponding coal mine regulation. The coal mine regulation knowledge graph uses coal mine regulations as nodes and the relationships between coal mine regulations as edges. The semantic similarity calculation module is used to perform semantic similarity calculation on the coal mine case text and the multiple historical coal mine cases respectively, and take the semantic similarity component corresponding to each historical coal mine case as the semantic similarity component of its corresponding coal mine regulations. The graph similarity calculation module is used to determine the graph similarity between the coal mine case text and each node in the coal mine regulations knowledge graph, and to obtain the graph similarity component of each coal mine regulation in the coal mine regulations knowledge graph. The scoring module is used to determine the relevance score between each coal mine regulation and the coal mine case text based on the semantic similarity component and the graph similarity component of the coal mine regulations. The generation module is used to select a target coal mine regulation from among multiple coal mine regulations based on the relevance score, and generate a response text corresponding to the coal mine case text based on the target coal mine regulation; Based on the semantic similarity component and the graph similarity component of the coal mine regulations, a relevance score is determined between the coal mine regulations and the coal mine case text, including: Determine the first weight of the semantic similarity component and the second weight of the graph similarity component; The semantic similarity component and the graph similarity component are weighted based on the first weight and the second weight to obtain the relevance score between the coal mine regulations and the coal mine case text.

7. The apparatus according to claim 6, characterized in that, The generation module is specifically used for: The coal mine regulations whose relevance scores are greater than a preset score threshold among the multiple coal mine regulations are selected as the target coal mine regulations. Based on the relationships in the coal mine regulations knowledge graph, depth-first search (DFS) is used to recursively trace the target coal mine regulations to obtain a complete reference chain containing both directly and indirectly referenced clauses. The target coal mine regulations and the complete citation chain are input into the large language model to generate the response text containing the regulatory basis.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-5.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.