A chemical safety production knowledge graph completion method based on structure enhancement

By combining dual-projection structure encoding and explicit semantic evidence, the sparsity and incompleteness of the knowledge graph of chemical safety production are solved, achieving high-precision and high-reliability graph completion and improving the ability to mine implicit facts in the chemical production process.

CN122154871APending Publication Date: 2026-06-05DALIAN UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DALIAN UNIV OF TECH
Filing Date
2026-03-04
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies suffer from sparsity and incompleteness in chemical safety production knowledge graphs. Traditional methods ignore the semantic information of chemical entities, resulting in a decline in the inference ability of the model when there are zero or few samples. Large language models lack the ability to perceive the complex topological structure of chemical systems, and cross-modal feature alignment is difficult, making it difficult to achieve high-precision and high-reliability graph completion.

Method used

We employ a dual-projection structure encoding mechanism to extract implicit structural information from the chemical engineering knowledge graph. Combined with explicit local semantic evidence, we use a lightweight adapter network and a large language model for joint fine-tuning to construct a dual-structure enhancement mechanism, thereby achieving accurate completion of the chemical safety production knowledge graph.

Benefits of technology

It significantly improves the accuracy of knowledge graph completion in chemical safety production, reduces the risk of illusion generation in large language models, achieves efficient parameter fine-tuning and credibility assessment, and ensures the reliability of knowledge completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122154871A_ABST
    Figure CN122154871A_ABST
Patent Text Reader

Abstract

The application discloses a chemical safety production knowledge graph completion method based on structure enhancement, and belongs to the cross field of artificial intelligence and chemical safety production management.The steps of the application are as follows: constructing a chemical safety production knowledge graph and extracting implicit structure information; searching for explicit local semantic evidence and constructing enhanced context; constructing a structure adapter to fuse implicit and explicit structure features; LoRA-based joint fine-tuning and calibration; and graph completion for chemical production data.The application innovatively fuses implicit geometric structure and explicit semantic evidence, significantly improves the completion accuracy, effectively suppresses the hallucination risk of a large model by using structured prior, and is more suitable for the actual application requirements of chemical safety production by virtue of light-weight training and a high-reliability discrimination mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the interdisciplinary field of artificial intelligence and chemical safety production, specifically involving a method for completing a chemical safety production knowledge graph by combining Knowledge Graph Representation Learning (KGE) and Large Language Model (LLM) fine-tuning techniques. This invention is particularly suitable for the automated discovery of hidden facts in chemical production processes and the incremental updating of incomplete knowledge graphs. Background Technology

[0002] Chemical safety production processes involve a vast amount of production equipment, process parameters, monitoring sites, and emergency response plans, among which there are extremely complex coupling relationships. Knowledge graphs (KG), as a structured knowledge management tool, are widely used to organize these relationships. However, in practical applications, due to the lag in data acquisition and the limitations of manual construction, chemical safety production knowledge graphs often suffer from severe sparsity and incompleteness (e.g., missing key triples between a "failure mode" and "potential consequences"), which greatly limits the reliability of downstream intelligent decision-making systems. Therefore, knowledge graph completion (KGC) has become a key technology in this field.

[0003] Existing technologies face three main bottlenecks in solving this problem: 1. Semantic Gaps in Traditional Embedded Models: Traditional knowledge graph completion methods (such as TransE and RotatE) primarily rely on geometric distance to model entities and relationships. While they can capture the global topological structure of the graph well (such as the symmetry and inverseness of relationships), they treat entities as meaningless IDs or vectors, ignoring the rich semantic information of the entities themselves (such as the functional description of equipment and the physical mechanism of failure). This leads to a significant decrease in the model's reasoning ability when faced with zero or few sample nodes.

[0004] 2. The "Structural Blind Spot" and Illusory Risks of Large Language Models: With the development of Large Language Models (LLMs), LLM-based generative reasoning has been introduced into graph completion. However, while general-purpose LLMs possess powerful text understanding capabilities, they lack the ability to perceive the complex topological structures of chemical engineering graphs. LLMs often rely solely on literal meaning for probabilistic predictions, failing to grasp the strict physical constraints and logical transitivity in chemical systems (e.g., A connects to B, B controls C, therefore A affects C). This "structural blind spot" can easily lead to the generation of seemingly logical but illusory links that violate chemical engineering logic, posing a potential threat to safe production.

[0005] 3. Difficulty in cross-modal feature alignment: Existing fusion methods often simply combine graph vectors with text vectors. This vector concatenation lacks a deep modal alignment mechanism. A significant semantic gap exists between implicit global structural features (mathematical vectors extracted by the KGE model) and explicit local semantic evidence (natural language obtained from text retrieval). Without effectively mapping these two types of information to the same space for complementary enhancement, the dual advantages of "structure + semantics" cannot be fully realized.

[0006] Therefore, there is an urgent need for a chemical safety knowledge graph completion method that can simultaneously utilize global topological constraints and local semantic evidence of the graph, and can be adapted to large language models through lightweight means, so as to achieve high-precision and high-reliability graph completion. Summary of the Invention

[0007] The purpose of this invention is to address the shortcomings of existing technologies by proposing a structure-enhanced method for completing a knowledge graph of chemical safety production. This invention aims to solve the problems of missing structural constraints and insufficient semantic understanding in chemical safety graph completion by constructing a dual structure enhancement mechanism of "implicit vectors + explicit text," thereby achieving accurate completion of hidden facts in chemical production processes.

[0008] To achieve the above objectives, the present invention adopts the following technical solution: A method for completing a knowledge graph of chemical safety production based on structure enhancement includes the following steps: Step 1: Construct a knowledge graph of chemical safety production and extract implicit structural information. Step 1.1: Organize multi-source heterogeneous data from chemical production processes to construct a chemical safety production knowledge graph that includes production equipment, monitoring sites, process parameters, failure modes, and emergency response plans. Chemical Engineering Knowledge Graph (abbreviated as Chemical Engineering Knowledge Graph)

[0009] Step 1.2: Pre-train the chemical engineering knowledge graph using a dual-projection structure encoding mechanism. This step models each relation in the chemical engineering knowledge graph as a head and tail dual-projection vector, thereby extracting the implicit structural information of the chemical engineering knowledge graph. Specifically, this mechanism changes the limitation of traditional knowledge graphs that treat relations as a single translation vector, and decouples each relation into a head projection vector that specifically acts on the head entity. ) and the tail projection vector acting on the tail entity ( This dual-projection structure can accurately capture the specific roles of entities in different interactions (for example, the semantic emphasis of the same device is completely different in the "controlling" and "controlled" relationships). At the same time, it has a stronger high-dimensional expressive capability and can effectively model the complex logical structures such as "one-to-many" and "many-to-one" relationships that exist in large numbers in chemical production.

[0010] For any real triplet existing in the chemical engineering knowledge graph Define the scoring function To measure its rationality in the chemical logic space, as shown in formula (1): in, For boundary hyperparameters, , These are the head entity vector and the tail entity vector. , Relationship The head projection vector and the tail projection vector. It represents the Hadamah accumulation. Indicates the dimension of the vector; By minimizing the self-adversarial negative sampling loss function Optimize the entity and relation embedding matrix, where the entity embedding matrix consists of a dimension corresponding to each entity in the graph. Learnable continuous vectors (i.e., head entity vectors) With tail entity vector The relation embedding matrix is ​​composed of representations of each relation. Represented as having dimension vector This vector is composed of the head projection vector. Tail projection vector spliced ​​together (i.e.) ).

[0011] Self-adversarial negative sampling loss function Its definition is shown in formula (2): in, For the set of positive sample triples, For its total number, It is the Sigmoid activation function. To address the issue of generating the first [unit] after entity replacement from the current real triplet. One negative sample, This represents the total number of negative samples. To be assigned to the The self-adversarial weights of each negative sample are calculated according to the Softmax distribution, as shown in Equation (3): in To counteract the temperature coefficient, this weighting mechanism dynamically adjusts the level of attention given to negative samples based on their scores under the current parameters, assigning greater weight to high-scoring negative samples (i.e., difficult samples that are easily confused with real chemical engineering logic). This self-adversarial characteristic forces the model parameters to focus on distinguishing highly similar chemical engineering concept boundaries during iterations, thereby significantly enhancing the discrimination accuracy of the extracted implicit structural information.

[0012] Step 1.3: Freeze and save all the vectors that have been pre-trained. These saved entity vectors and relation vectors are the implicit structural information of the chemical knowledge graph, which will be used to provide structural priors for the large language model in the future.

[0013] Step 2: Retrieve explicit local semantic evidence and construct enhanced context. For the chemical engineering knowledge graph ternary set to be judged Constructing textual context using graph structure information: Step 2.1: Calculate any two relationships in the chemical engineering knowledge graph. The global co-occurrence probability is shown in Equation (4): in, Representing relations The total frequency of occurrence in the entire chemical engineering knowledge graph, i.e., the relationships contained in the graph. The total number of triples; Representing relations With Relationship The frequency of global co-occurrence in the graph, i.e., the total number of times these two relationships are directly adjacent in the graph's topology, is used as a counting function to quantify the statistical correlation strength between interactions of different chemical elements. This provides objective data support for subsequent probability-based selection of the most relevant and interpretable explicit local semantic evidence.

[0014] Step 2.2: Retrieve the head entities separately. Tail-end entity The neighbor facts, based on the relationships and query relationships within the neighbor facts. The co-occurrence probabilities are sorted in descending order, and the Top-K most explanatory neighbors are selected. During the selection process, leakage prevention filtering is performed, meaning that for any neighbor facts retrieved... If a condition is completely identical to a candidate triple, it is forcibly removed from the context; finally, the filtered and leak-proof neighbor facts are serialized into explicit structural evidence in the form of natural language text. The aim is to provide concrete and readable local reasoning basis for large language models.

[0015] Step 3: Construct a structural adapter to integrate implicit and explicit structural features. Construct an adapter network that connects the structured vector space to the semantic space of a large language model: Step 3.1: Read the 2D relation vector pre-trained in Step 1. Perform a dimension splitting operation on it to obtain two independent d-dimensional vectors. .

[0016] Step 3.2: Using a mapping layer containing layer normalization (LayerNorm) and activation function (GELU), the query header entity vector is respectively... Query tail entity vector and the relational projection vector after segmentation Mapped to structured soft hints aligned with large model dimensions As shown in formula (5): Where the mapping function The definition is shown in formula (6): in The weight matrix is ​​a learnable matrix. For bias vectors, Represents any one of the four types of pre-trained vectors: query head entity vector Query tail entity vector The relationship head projection vector obtained by segmentation Or relation tail projection vector .

[0017] Step 3.3, will With task instructions The text context constructed in step 2 And query chemical knowledge graph ternary text Sequence concatenation is performed to construct a dual-structured input sequence consisting of "implicit vectors + explicit text". As shown in formula (7): in This represents the concatenation operation of vector sequences. This indicates the operation of converting discrete text into a dense embedding vector. The task instruction... The pre-defined natural language prompt text is used to assign the role of a fine chemical industry expert to the large language model, and to clearly define its working objectives and output format for performing the current triplet truth / falseness judgment task by combining contextual neighbor factual evidence.

[0018] Step 4: LoRA-based joint fine-tuning and calibration The base parameters of the large language model are frozen, and joint training is performed using only LoRA and adapter parameters to calibrate the large language model's ability to comprehensively utilize both implicit and explicit structural information. The chemical engineering knowledge graph completion task is modeled as a triplet binary classification task, and the large language model outputs labels. The optimization objective is to minimize the cross-entropy loss function, as shown in Equation (8): in, Indicates the first To query the real labels of ternary samples in real chemical production scenarios. This represents a dual-structured augmentation sequence input to a large language model; Through this step, the large language model learns how to... The implicit structural information provided and The provided explicit semantic evidence is used to perform high-confidence triple classification.

[0019] Step 5: Graph Completion for Chemical Production Data The trained large language model is used to check and complete the new triples extracted from the chemical production data, and the newly generated query triples are then processed. Convert the text into an implicit structure vector and generate the corresponding explicit neighbor text. Input the text into a large language model to calculate the confidence probability of it being True. If satisfied > ( If the threshold is set to safety, then the query triple is deemed to be reasonable in both structure and semantics, and it is formally added to the chemical safety production knowledge graph to complete the graph's completion.

[0020] Beneficial results of the present invention: (1) Dual structure enhancement improves reasoning accuracy This invention innovatively combines implicit global topological features extracted by dual-projection structure encoding (as soft cues) with explicit local semantic evidence provided by neighbor retrieval (as hard cues). The former gives the model an "intuition" about the graph geometry, while the latter provides the model with concrete "evidence," effectively overcoming the limitations of traditional methods that rely solely on a single modality and significantly improving the accuracy of completion.

[0021] (2) Effectively suppresses large model hallucinations By introducing pre-trained knowledge graph vectors as structure prefixes, strong physical / logical constraints are imposed on the generation process of the large language model. This allows the model to be "anchored" in the correct logical space when facing complex reasoning in the chemical industry, significantly reducing the risk of generating illusions that defy common sense.

[0022] (3) Efficient parameter fine-tuning strategy This invention employs LoRA technology combined with a lightweight Split-Adapter, eliminating the need for full fine-tuning of a large model with billions of parameters. Cross-modal alignment can be achieved by training only a very small number of parameters. This not only reduces training costs but also preserves the original general semantic capabilities of the large model, avoiding catastrophic forgetting.

[0023] (4) It conforms to the judgment mechanism for safe production. To address the high reliability requirements for chemical safety, this invention introduces a method based on Logits normalization and safety thresholds during the inference phase. Compared to simple text generation, its discrimination mechanism provides a more controllable and rigorous confidence assessment method, ensuring that the knowledge added to the graph has a high degree of credibility. Attached Figure Description

[0024] Figure 1 This is a diagram of the algorithm structure of the present invention. Detailed Implementation

[0025] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.

[0026] The data in this embodiment comes from the actual production database of a large chemical enterprise, covering three core production lines: DMC (dimethyl carbonate), EO (ethylene oxide), and EOD (ethylene oxide derivatives). The dataset construction process is as follows: First, the process flow diagrams (PIDs), operating procedures, historical alarm records, and emergency response plan texts of the three production lines were extracted in a structured manner. This resulted in the construction of various types of entities, including production equipment (such as reactors and distillation columns), process parameters (such as temperature, pressure, and liquid level), monitoring points (such as tag numbers T-201 and P-105), and emergency response plans. The extremely complex coupling relationships between them (such as "connection," "control," "cause," and "belong to") were also identified. The final chemical safety production knowledge graph dataset contains a total of 1846 entities and 3034 relationships between them, accurately covering the production process knowledge and safety management knowledge of the EO, EOD, and DMC production lines.

[0027] In the evaluation system of this method, a multi-dimensional performance evaluation framework is constructed, including four core indicators: accuracy, precision, recall, and F1 score. The design of this indicator system follows the principles below: Accuracy: Measures the proportion of times a model correctly identifies all samples (including positive and negative samples). The formula is: This provides a global performance benchmark for the model, where, This represents the true positive cases, i.e., the number of samples that are actually positive and correctly predicted as positive by the model. This represents true negative examples, i.e., the number of samples that are actually negative but were correctly predicted as negative by the model. This represents false positives, i.e., the number of samples that are actually negative but are incorrectly predicted as positive by the model. This represents false negatives, which are actually positive samples but were incorrectly predicted as negative samples by the model.

[0028] Precision: Measures the proportion of samples that the model predicts as "true" but are actually "true". The formula is... In chemical safety scenarios, high accuracy means that false alarms can be effectively reduced and interference with operators can be minimized.

[0029] Recall: Measures the proportion of actual "true" samples that are successfully predicted by the model. The formula is... High recall means that the model can discover as many potential triplet facts as possible, avoiding false negatives.

[0030] F1 score: The harmonic mean of precision and recall, calculated using the formula... .in, Indicates precision. This represents recall. Since abnormal samples in the chemical industry are usually fewer than normal samples, the F1 score can more comprehensively reflect the overall performance of the model in scenarios with uneven data distribution, effectively balancing the risks of false positives and false negatives.

[0031] This embodiment uses the Llama-7B large language model platform. To adapt to the complex structures in the chemical engineering field, we set the entity embedding dimension to 512 and the relation embedding dimension to 1024 during the pre-training stage to ensure sufficient encoding of complex topological logic. In the neighbor fact retrieval stage, to balance context richness and computational efficiency, the neighbor fact retrieval quantity for the head entity and tail entity is set to 10 each (i.e., 20 neighbor evidences are retrieved for each query triple).

[0032] The hardware environment configuration for running the method of this invention is as follows: operating system is Ubuntu 16.04, CPU model is Intel Xeon CPU E5-2650 v4 @ 2.20GHz, GPU is NVIDIA GeForce 4090 with 24G of video memory. The deep learning framework used is PyTorch 2.0.

[0033] Taking a specific task in the EO production line as an example, the five steps of this invention will be explained in detail. Assume the query triple to be judged is: Step 1: Extract implicit global topological features First, a pre-trained dual-projection encoder is used to perform vectorized lookup of entities and relations in the query triples. The model maps "oxidation reactor R-101" into a 512-dimensional entity vector. Mapping "emergency interlocking stop" as a 512-dimensional entity vector. The relationship is then mapped to two independent projection vectors. These vectors are trained on the graph and implicitly contain the geometric location information of R-101 as a core device in the graph (such as its typical location at the front end of the process flow and its connection to multiple safety instrumented systems), thus providing global structural priors.

[0034] Step 2: Retrieve explicit local semantic evidence Starting with R-101 and the emergency interlock shutdown, a relationship co-occurrence neighbor fact retrieval is performed in the graph. The top 10 neighbors of R-101 are retrieved, such as "R-101 is connected to temperature transmitter TE-101" and "R-101 contains ethylene material." The top 10 neighbors of the emergency interlock shutdown are retrieved, such as "The emergency interlock shutdown is triggered by a high-high alarm from TE-101" and "The emergency interlock shutdown is an action of the SIS system." The system serializes these 20 neighbor facts into natural language text. As explicit semantic evidence, it provides specific reasoning clues for the model.

[0035] Step 3: Construct the adapter and input sequence The implicit vectors R-101 extracted in step 1 are projected and mapped to structured soft hints in the semantic space of the large model. Subsequently, the input sequence is constructed by concatenating the following elements in the order of "soft hints + task instructions + explicit evidence + query triples". : [vector sequence...]; "You are an expert in the field of fine chemicals. Given a triple from the knowledge graph of this field, please determine the correctness of this triple based on the following neighboring facts, and you can only answer true or false." "Neighboring facts: R-101 is connected to TE-101; TE-101 high-voltage alarm triggers shutdown..." "Input: Oxidation reactor R-101 caused emergency interlock shutdown."

[0036] Step 4: Mapping completion for chemical production processes The above The trained model is input, and the model calculates confidence scores through normalization: Set a security threshold. =0.85. Since 0.96 > 0.85, the system determines that the triplet is highly reasonable in both global topology and local semantics, and the prediction result is "true". Finally, the triplet (oxidation reactor R-101, leading to emergency interlock shutdown) was officially added to the chemical knowledge graph of the EO production line, completing the graph and providing key data support for subsequent safe production.

[0037] Table 1 shows the completion effect of the embodiments of the present invention. As can be clearly seen from the experimental results in Table 1, the method proposed in this invention outperforms existing benchmark models in all evaluation metrics on the three core production line datasets: DMC, EO, and EOD. Compared to the best-performing traditional embedding model (RotatE) and the large model fine-tuning baseline (KoPA), this invention achieves the highest scores in the comprehensive index F1 (82.85, 81.15, and 81.86, respectively). This fully demonstrates that the "implicit vector + explicit text" dual structure enhancement mechanism of this invention effectively compensates for the semantic deficiencies of traditional models. At the same time, compared with the untrained large model whose accuracy hovers around 50%, this invention, through a joint fine-tuning strategy based on LoRA and the introduction of pre-trained graph features as topological constraints, not only activates the model's reasoning ability for this task but also successfully overcomes the "structural blind spot" and "illusion" risks of general-purpose large language models when dealing with complex chemical logic. Ultimately, it achieves high-precision and high-reliability knowledge completion of chemical safety production graphs.

Claims

1. A method for completing a knowledge graph of chemical safety production based on structure enhancement, characterized in that, Includes the following steps: Step 1: Construct a knowledge graph of chemical safety production and extract implicit structural information; Step 2: Retrieve explicit local semantic evidence and construct enhanced context; Step 3: Construct a structural adapter to integrate implicit and explicit structural features; Step 4: LoRA-based joint fine-tuning and calibration; Step 5: Complete the graphs for chemical production data.

2. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 1, characterized in that, Step 1 includes: Step 1.1: Organize multi-source heterogeneous data from chemical production processes to construct a chemical safety production knowledge graph that includes production equipment, monitoring sites, process parameters, failure modes, and emergency response plans. Chemical Engineering Knowledge Graph (abbreviated as Chemical Engineering Knowledge Graph) Step 1.2: Pre-train the chemical engineering knowledge graph using a dual-projection structure encoding mechanism. This step involves modeling each relationship in the chemical engineering knowledge graph as a head and tail dual-projection vector, thereby extracting the implicit structural information of the chemical engineering knowledge graph. Step 1.3: Freeze and save all the vectors that have been pre-trained. These saved entity vectors and relation vectors are the implicit structural information of the chemical knowledge graph, which will be used to provide structural priors for the large language model in the future.

3. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 2, characterized in that, Step 1.2 is as follows: For any real triplet existing in the chemical engineering knowledge graph Define the scoring function To measure its rationality in the chemical logic space, as shown in formula (1): in, For boundary hyperparameters, , These are the head entity vector and the tail entity vector. , Relationship The head projection vector and the tail projection vector. It represents the Hadamah accumulation. Indicates the dimension of the vector; By minimizing the self-adversarial negative sampling loss function Optimize the entity and relation embedding matrix, where the entity embedding matrix consists of a dimension corresponding to each entity in the graph. The learnable continuous vectors constitute the relation embedding matrix, which is composed of representations of each relation. Represented as having dimension vector This vector is composed of the head projection vector. Tail projection vector It is pieced together, that is ; Self-adversarial negative sampling loss function Its definition is shown in formula (2): in, For the set of positive sample triples, For its total number, It is the Sigmoid activation function. To address the issue of generating the first [unit] after entity replacement from the current real triplet. One negative sample, The total number of negative samples; To be assigned to the The self-adversarial weights of each negative sample are calculated according to the Softmax distribution, as shown in Equation (3): in To counteract the temperature coefficient.

4. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 3, characterized in that, Step 2 includes: For the chemical engineering knowledge graph ternary set to be judged Constructing textual context using graph structure information: Step 2.1: Calculate any two relationships in the chemical engineering knowledge graph. The global co-occurrence probability is shown in Equation (4): in, Representing relations The total frequency of occurrence in the entire chemical engineering knowledge graph, i.e., the relationships contained in the graph. The total number of triples; Representing relations With Relationship The frequency of global co-occurrence in the graph, that is, the total number of times these two relationships are directly adjacent in the graph topology; Step 2.2: Retrieve the head entities separately. Tail-end entity The neighbor facts, based on the relationships and query relationships within the neighbor facts. The co-occurrence probabilities are sorted in descending order, and the Top-K most explanatory neighbors are selected. During the selection process, leakage prevention filtering is performed, meaning that for any neighbor facts retrieved... If a condition is completely identical to a candidate triple, it is forcibly removed from the context; finally, the filtered and leak-proof neighbor facts are serialized into explicit structural evidence in the form of natural language text. The aim is to provide concrete and readable local reasoning basis for large language models.

5. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 4, characterized in that, Step 3 includes: Construct an adapter network that connects the structured vector space to the semantic space of a large language model: Step 3.1: Read the 2D relation vector pre-trained in Step 1. Perform a dimension splitting operation on it to obtain two independent d-dimensional vectors. ; Step 3.2: Using the mapping layer of the inclusion layer normalization and activation function, respectively, the query head entity vector is... Query tail entity vector and the relational projection vector after segmentation Mapped to structured soft hints aligned with large model dimensions As shown in formula (5): Where the mapping function The definition is shown in formula (6): in The weight matrix is ​​a learnable matrix. For bias vectors, Represents any one of the four types of pre-trained vectors: query head entity vector Query tail entity vector The relationship head projection vector obtained by segmentation Or relation tail projection vector ; Step 3.3, will With task instructions The text context constructed in step 2 And query chemical knowledge graph ternary text Sequence concatenation is performed to construct a dual-structured input sequence consisting of "implicit vectors + explicit text". As shown in formula (7): in This represents the concatenation operation of vector sequences. This represents the operation of converting discrete text into densely embedded vectors; the task instruction The pre-defined natural language prompt text is used to assign the role of a fine chemical industry expert to the large language model, and to clearly define its working objectives and output format for performing the current triplet truth / falseness judgment task by combining contextual neighbor factual evidence.

6. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 5, characterized in that, Step 4 includes: The base parameters of the large language model are frozen, and joint training is performed using only LoRA and adapter parameters to calibrate the large language model's ability to comprehensively utilize both implicit and explicit structural information. The chemical knowledge graph completion task is modeled as a triplet binary classification task, and the large language model outputs labels. The optimization objective is to minimize the cross-entropy loss function, as shown in Equation (8): in, Indicates the first To query the real labels of ternary samples in real chemical production scenarios. This represents a dual-structured augmentation sequence input to a large language model; Through this step, the large language model learns how to... The implicit structural information provided and The provided explicit semantic evidence is used to perform high-confidence triple classification.

7. The method for completing a chemical safety production knowledge graph based on structure enhancement according to claim 6, characterized in that, Step 5 includes: The trained large language model is used to check and complete the new triples extracted from the chemical production data, and the newly generated query triples are then processed. Convert the text into an implicit structure vector and generate the corresponding explicit neighbor text. Input the text into a large language model to calculate the confidence probability of the text being true. If satisfied > Safety threshold If the query triple is deemed to be structurally and semantically valid, it will be formally added to the chemical safety production knowledge graph to complete the graph's completion.