A continuous casting billet defect knowledge retrieval method based on double retrieval graphs and related devices

By constructing direct and supplementary retrieval graphs, combining a large language model and a continuous casting quality knowledge graph, the knowledge retrieval process is optimized, solving the accuracy and completeness issues of knowledge graph retrieval enhancement tasks in the continuous casting field, and achieving efficient and accurate retrieval of billet defect knowledge.

CN122364247APending Publication Date: 2026-07-10XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610437837.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-03
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing methods in the field of continuous casting suffer from limitations in knowledge graph retrieval enhancement tasks due to their specialized nature. This results in insufficient understanding of technical terms and multi-level concepts by large language models, making it difficult to retrieve accurate answers from generated queries. Furthermore, the short-path feature of the continuous casting quality knowledge graph introduces noise and unnecessary computational overhead, making it difficult to meet accuracy requirements.

Method used

By constructing direct retrieval graphs and supplementary retrieval graphs, and combining a large language model and a continuous casting quality knowledge graph, the knowledge retrieval process is optimized using entity constraints and relational constraints. The direct retrieval graph locates relevant knowledge paths, while the supplementary retrieval graph fills in missing knowledge, thereby improving the accuracy and completeness of the retrieval.

Benefits of technology

It significantly improves the accuracy and completeness of billet defect knowledge retrieval, overcomes the limitations of large language models in understanding professional terms and knowledge graph structural features, and generates answers that conform to the professional semantics of the continuous casting field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention provides a method and related apparatus for retrieving knowledge about defects in continuously cast billets based on a dual-retrieval graph. The method includes the following steps: using a direct retrieval graph, a supplementary retrieval graph, and a continuous casting problem as input to a large language model; and using the large language model to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. Specifically, the direct retrieval graph is configured to locate knowledge paths related to the continuous casting problem; the supplementary retrieval graph is configured to supplement any related knowledge that the direct retrieval graph may have missed. This invention constructs a constraint-driven dual-retrieval graph mechanism. The direct retrieval graph ensures accurate location of defect knowledge, while the supplementary retrieval graph provides broader support for related knowledge. This effectively adapts to the structural characteristics of the continuous casting quality knowledge graph, which is dominated by short-path entity chains, avoiding the introduction of noise and redundant paths. This significantly improves the accuracy and relevance of billet defect knowledge retrieval and guides the large language model to generate answers that conform to the professional semantics of the continuous casting field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of continuous casting steel defect knowledge question answering, specifically involving a continuous casting billet defect knowledge retrieval method and related device based on dual retrieval graphs. Background Technology

[0002] The extensive specialized knowledge involved in continuous casting production necessitates that operators frequently require timely access to information regarding defects in continuously cast billets to optimize production processes and resolve quality issues. Knowledge graph reasoning technology fills in the gaps in the continuous casting knowledge graph, enriching it with more knowledge to meet the knowledge needs of continuous casting production. However, the structured representation of the continuous casting quality knowledge graph limits the flexibility of operator interaction, resulting in retrieval results that are often rigid and lack contextual coherence, reducing operator comprehension efficiency. While large language models possess natural language processing capabilities, their understanding of specialized knowledge in the billet domain is insufficient, preventing direct application in continuous casting production.

[0003] A retrieval enhancement method combining knowledge graphs and large-scale language models offers new possibilities for solving these problems in the continuous casting field. On one hand, leveraging the natural language generation and contextual understanding capabilities of the large-scale language model, operator questions are transformed into structured knowledge representations for knowledge retrieval within the continuous casting quality knowledge graph. The retrieval results are then converted into fluent and easily understandable natural language expressions, improving the readability and interactive experience of the answers. On the other hand, the professional knowledge of the continuous casting quality knowledge graph provides precise domain knowledge support for the large-scale language model. By constructing a constraint retrieval graph, the knowledge retrieval enhancement process is optimized to better align with the multi-path entity chain characteristics of the continuous casting quality knowledge graph. Through the synergistic effect of both methods, the readability of billet defect knowledge and the accuracy of knowledge retrieval enhancement are improved.

[0004] However, existing methods mostly focus on general domains. When faced with knowledge graph retrieval enhancement tasks in the continuous casting field, they are often limited by the specialized nature of continuous casting knowledge, leading to a decrease in the accuracy of retrieval enhancement tasks. Because the continuous casting field involves complex conceptual systems, rigorous logical relationships, and a large number of specific continuous casting terms, while the training data of large language models mainly comes from general text corpora, the performance of semantic parsing-based methods is limited by the understanding capabilities of large language models, making it difficult to accurately parse these specialized terms and their interrelationships. This comprehension bias is particularly pronounced when the question involves multi-level specialized continuous casting concepts, resulting in the generated query statements failing to retrieve accurate answers. Therefore, although semantic parsing methods have good interpretability in knowledge graph retrieval enhancement tasks, their applicability in highly specialized domains still has certain limitations.

[0005] Furthermore, since the entity relationship network in the continuous casting quality knowledge graph is typically dominated by short paths within three hops, information retrieval-based methods are affected by the structural characteristics of the continuous casting quality knowledge graph, introducing noise and unnecessary computational overhead. Moreover, unrestricted retrieval scope may lead to irrelevant entities and relationships being included in candidate answers, making it difficult to meet accuracy requirements. Therefore, the application of existing retrieval enhancement methods combining knowledge graphs and large language models in the continuous casting field still faces significant challenges. Summary of the Invention

[0006] The purpose of this invention is to provide a method and related apparatus for retrieving knowledge about defects in continuously cast billets based on a dual-retrieval graph, which solves the above-mentioned shortcomings in the prior art. This invention combines a large amount of structured domain knowledge from the continuous casting quality knowledge graph with the natural language generation capabilities of a large language model, designs and generates continuous casting constraints, and optimizes the knowledge retrieval enhancement process using a dual-retrieval graph. It effectively retrieves knowledge related to the production problems of continuous casting defects from the reasoned continuous casting quality knowledge graph, guides the large language model to generate answers that conform to the professional semantics of the continuous casting field, and improves the readability of billet defect knowledge and the accuracy of knowledge retrieval enhancement.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for retrieving knowledge about defects in continuously cast billets based on a dual-retrieval graph, comprising the following steps: The direct retrieval graph, supplementary retrieval graph, and continuous casting problem are used as inputs to a large language model. The large language model is then used to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. Specifically: The direct retrieval graph is configured to locate knowledge paths related to continuous casting problems. The supplementary search graph is configured to supplement related knowledge that may be missed by the direct search graph.

[0008] Preferably, the method for constructing the direct retrieval map and the supplementary retrieval map is as follows: Extract the head entity keywords, tail entity keywords, and continuous casting relationship keywords from historical continuous casting problems to form a set of keyword triplets; Based on the obtained set of keyword triples, the query entity set and query relation set are obtained; The obtained query entity set and query relation set are semantically matched with the existing continuous casting quality knowledge graph to obtain the best matching entity set and the best matching relation set. Based on the obtained set of best-matching entities and set of best-matching relationships, construct a direct retrieval graph and a supplementary retrieval graph.

[0009] Preferably, the obtained query entity set and query relation set are semantically matched with the existing continuous casting quality knowledge graph to obtain the best matching entity set and the best matching relation set. The specific method is as follows: The query entity set, query relation set, and standard entities and standard relations in the existing continuous casting quality knowledge graph are respectively encoded into query entity semantic embedding vectors, query relation semantic embedding vectors, standard entity semantic embedding vectors, and standard relation semantic embedding vectors; Calculate the similarity between the query entity semantic embedding vector and the standard entity semantic embedding vector to obtain the entity cosine similarity score; Calculate the similarity between the query relation semantic embedding vector and the standard relation semantic embedding vector to obtain the relation cosine similarity score; Based on the obtained entity cosine similarity score and relation cosine similarity score, the corresponding query entities and query relations are selected to obtain the best matching query entity set and the best matching query relation set.

[0010] Preferably, a direct retrieval graph and a supplementary retrieval graph are constructed based on the obtained best matching entity set and best matching relationship set. The specific method is as follows: Based on the classification of standard entities and standard relationships in the existing continuous casting knowledge graph, entity constraints and relationship constraints are defined respectively. Entity constraints include defect name, defect characteristics, defect phenomenon, and solution measures; relationship constraints include impact consequences, feature description, and solution methods. The entity constraints and relational constraints are bound to each standard entity and each standard relation in the existing continuous casting quality knowledge graph to obtain the standard continuous casting quality knowledge graph. Starting with each best-matching query entity in the best-matching query entity set, standard relationships connected to the best-matching query entities are selected from the standard continuous casting quality knowledge graph to form a standard relationship subset. Select standard relations from the standard relation subset that have the same constraint type as all query relations in the best matching query relation set, and use the selected standard relations as the expansion path; Constrained neighborhood expansion is performed along each expansion path to its connected neighboring nodes to construct a direct retrieval graph; A supplementary retrieval graph is constructed by multi-hop neighborhood expansion starting from each best-matching query entity in the best-matching query entity set.

[0011] Preferably, constrained neighborhood expansion is performed along each expansion path to its connected neighboring nodes to construct a direct retrieval graph. The specific method is as follows: Each expansion path is extended one hop to its connected neighboring nodes to obtain one-hop neighboring nodes. It is then determined whether each one-hop neighboring node is any of the remaining best-matching query entities in the best-matching query entity set. If the 1-hop neighbor node belongs to any of the remaining best-matching query entities in the best-matching query entity set, then the expansion stops; If the 1-hop neighbor node does not belong to any of the remaining best matching query entities in the best matching query entity set, then the obtained neighbor node is used as a new starting point to continue expansion until the expanded neighbor node is any of the remaining best matching query entities in the best matching query entity set. When the farthest expansion path reaches the preset path number threshold and the obtained termination neighbor node does not belong to any of the remaining best matching query entities in the best matching query entity set, then the expansion stops. An initial direct retrieval graph is constructed based on the expanded n-hop neighbor nodes and the expanded paths between the neighbor nodes; Constraints are applied to each neighboring node in the initial direct retrieval graph, where: If the constraint type bound to each neighboring node is different from the constraint type bound to all best-matching query entities in the best-matching query entity set, then the neighboring node is determined to be invalid, and the neighboring node and the extension path from the starting neighboring node to the neighboring node are removed from the initial direct retrieval graph. If the constraint type bound to each neighboring node is the same as the constraint type bound to any best matching query entity in the best matching query entity set, then the neighboring node is determined to be valid. The initial direct retrieval graph retains the neighboring node and the expansion path from the starting neighboring node to the neighboring node, thus obtaining the intermediate direct retrieval graph. The obtained set of keyword triples is encoded to obtain a semantic embedding vector; Each complete path in the intermediate direct retrieval graph is scored based on the obtained semantic embedding vector, and the corresponding score value is obtained. The final direct retrieval graph is obtained by removing the complete path with a score less than or equal to a preset threshold and the tail entity of the best matching query corresponding to that complete path.

[0012] Preferably, a supplementary retrieval graph is constructed by multi-hop neighborhood expansion starting from each best-matching query entity in the best-matching query entity set. Specifically, the method is as follows: Starting from each best-matching query entity, perform a 1-hop neighborhood expansion to obtain a set of all 1-hop neighborhood nodes and paths connected to each entity; Each 1-hop neighbor node is used as a new starting point to expand the 2-hop neighborhood, resulting in a set of all 2-hop neighbor nodes and paths connected to each 1-hop neighbor node. Based on the set of all 1-hop neighborhood nodes and paths and the set of all 2-hop neighborhood nodes and paths, a 2-hop neighborhood subgraph is generated centered on all best-matching query entities. The duplicate paths in the 2-hop neighborhood subgraph and the direct retrieval graph are deleted to obtain the supplementary retrieval graph.

[0013] Secondly, the present invention provides a knowledge retrieval system for defects in continuously cast billets based on dual retrieval maps, comprising: The large language retrieval unit is configured to take the direct retrieval graph, supplementary retrieval graph, and continuous casting problem as input to the large language model. It then uses the large language model to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. The direct retrieval graph is configured to locate knowledge paths related to continuous casting problems. The supplementary search graph is configured to supplement related knowledge that may be missed by the direct search graph.

[0014] Thirdly, the present invention provides an electronic device including a processor and a memory, wherein the memory stores computer instructions, and when the computer instructions are executed by the processor, the electronic device performs the method described thereon.

[0015] Fourthly, the present invention provides a computer program product, the computer program product including computer-executable instructions, which, when executed, implement the method described.

[0016] Fifthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the method described herein.

[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention provides a knowledge retrieval method for defects in continuously cast billets based on dual retrieval graphs. Existing methods suffer from two core shortcomings in continuous casting applications: first, the large language model's ability to understand technical terms and multi-level concepts is insufficient, making it difficult to retrieve accurate answers from generated queries; second, the continuous casting quality knowledge graph primarily uses short paths within three hops, and existing retrieval enhancement methods introduce noise and unnecessary computational overhead without restriction, easily including irrelevant entities and relationships, failing to meet accuracy requirements. Therefore, this invention solves these problems by simultaneously using a direct retrieval graph and a supplementary retrieval graph as input to the large language model. The direct retrieval graph is specifically used to locate knowledge paths related to continuous casting problems, effectively avoiding the noise and redundant path problems caused by "unrestricted retrieval scope" as described in the background art, thus improving retrieval accuracy. The supplementary retrieval graph is used to supplement related knowledge that may be missed by the direct retrieval graph, compensating for information omissions that may occur when relying solely on short-path retrieval. The synergistic effect of the two technologies not only overcomes the inaccuracy of retrieval caused by the misunderstanding of professional terminology in large language models, but also adapts to the structural characteristics of the continuous casting quality knowledge graph, which is dominated by short-path entity chains, thereby significantly improving the accuracy and completeness of billet defect knowledge retrieval.

[0018] Furthermore, based on the diverse relationship types existing in the current continuous casting quality knowledge graph, a continuous casting constraint construction and association binding strategy is introduced. By predefining four types of entity constraints and three types of relationship constraints and binding these constraints to the corresponding defect entities and relationships in the continuous casting quality knowledge graph, it is convenient to quickly and accurately construct enhanced retrieval paths based on the short-path entity chain characteristics of the continuous casting quality knowledge graph when building the retrieval graph in the future. Attached Figure Description

[0019] Figure 1 This is a flowchart of an embodiment of the present invention; Figure 2 This is a technical roadmap of an embodiment of the present invention; Figure 3 This is a semantic embedding model diagram of keyword triples in an embodiment of the present invention; Figure 4 This is a logic diagram of continuous casting quality knowledge graph embedding and keyword alignment according to an embodiment of the present invention; Figure 5 This is a flowchart of the direct retrieval graph construction process according to an embodiment of the present invention; Figure 6 This is a supplementary retrieval graph construction flowchart according to an embodiment of the present invention; Figure 7 This is a prompt instruction in an embodiment of the present invention. Detailed Implementation

[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0026] Example 1 This embodiment provides a knowledge retrieval method for continuous casting billet defects based on a dual-retrieval graph. By combining a large amount of structured domain knowledge from the continuous casting quality knowledge graph with the natural language generation capabilities of a large language model, continuous casting constraints and a dual-retrieval graph are designed to optimize the knowledge retrieval enhancement process. Knowledge related to continuous casting defect production problems is effectively retrieved from the reasoned continuous casting quality knowledge graph, guiding the large language model to generate answers that conform to the professional semantics of the continuous casting domain, thereby improving the readability of billet defect knowledge and the accuracy of knowledge retrieval enhancement.

[0027] Specifically, the process logic is as follows: Figure 1 As shown, the technical route is as follows Figure 2 As shown, the steps are as follows: Step 1: Semantic parsing and alignment with the knowledge graph using a large language model. The large language model extracts head entity keywords, tail entity keywords, and continuous casting relation keywords from the continuous casting problem, forming a set of keyword triples. The BERT model is used to encode these keyword triples into semantic embedding vectors. The existing continuous casting quality knowledge graph is then embedded into the semantic space. Finally, semantic matching between the query question and the entities and relations in the continuous casting quality knowledge graph is achieved by calculating the semantic similarity between the keyword set extracted by the large language model and the entities and relations in the continuous casting quality knowledge graph.

[0028] In this embodiment, the specific method for extracting the set of keyword triples from the continuous casting problem using a large language model is as follows: When passing query questions to a large language model, add structured keyword suggestion units. These units are divided into two segments and use... <cls> 、 <sep> 、 <eos>The annotation process is as follows: The first segment consists of the continuous casting problem to be conveyed to the large language model and a fixed prompt segment "Reference continuous casting terminology:". The second segment provides a specific set of reference continuous casting terminology. The continuous casting terminology set consists of keywords that correspond to entities and relationships in the knowledge graph, guiding the large language model to identify continuous casting knowledge keywords such as "rapid columnar crystal growth" and "generation of equiaxed crystal network", as well as keywords similar in meaning to continuous casting relationships such as "affects" and "how to solve", such as "leads to" and "takes". The parts within the unit are separated by delimiters.

[0029] The large language model uses this prompt unit as a reference to extract a set of keyword triples that conform to the knowledge of the continuous casting domain. Each triple contains a head entity, a continuous casting relation, and a tail entity. Except for the first triple, the head entity of each triple is equal to the tail entity of the previous triple. After deduplication of all head and tail entities, the query entity set is formed. The query entity set contains query entities , Indicates the first Each query entity. All the chained relationships constitute the query relation set. The query relationship set contains query relationships , Indicates the first The number of query entities after deduplication is one more than the number of query relationships. . This refers to a specific continuous casting problem. What is constructed has no real meaning.

[0030] Example of a structured keyword suggestion unit: <cls>I have noticed black streaks or dark spots on some of the cast billets. In addition, columnar crystals have been observed to form during production. What are the possible causes for these phenomena? <sep>Continuous casting terminology for reference: <eos> <cls>I have noticed black streaks or dark spots on some of the cast billets. In addition, columnar crystals have been observed to form during production. What could be the cause of this? <sep>The appearance of black streaks and dark spots, and the formation of columnar crystals, what could be the cause? <eos> In this embodiment, the specific method for embedding the keyword triple set into a unified semantic space is as follows: like Figure 3 As shown, a BERT language model pre-trained on a large-scale corpus is used as the encoder to perform context modeling on the input set of keyword triples. This set of keyword triples includes information from the continuous casting problem... All head entities, continuous casting relationships, and tail entities extracted from the process.

[0031] Specifically, each keyword is first transformed into a token sequence required for BERT input, and a corresponding input vector is constructed. Then, the BERT model performs multi-layer Transformer encoding on these continuous casting keyword input sequences. Each layer consists of a multi-head self-attention mechanism and a feedforward neural network, gradually capturing the contextual dependencies between continuous casting keywords, thereby obtaining the context of each continuous casting keyword in the current continuous casting problem. A semantic representation vector. The encoded result can be represented as a sequence of context representation vectors for each continuous casting keyword.

[0032] After obtaining the context representation vector sequence of all continuous casting keywords, all vectors in this sequence are processed according to the original continuous casting problem. The words in the sequence are concatenated sequentially. The start symbol [CLS] and special delimiter [SEP] specified by the BERT model are used to explicitly define the boundaries of each entity and the continuous casting relationship, ultimately yielding the continuous casting problem. semantic embedding vector .

[0033] In this embodiment, the existing continuous casting quality knowledge graph The specific method for embedding vectors into the semantic space is as follows: For a continuous casting ternary group Its embedding matrix is ​​shown below:

[0034] In the formula: This represents the overall semantic embedding vector of the continuously cast triplet, i.e., the embedding matrix. Represents a linear transformation matrix; Represents the standard header entity embedding vector; Represents the standard continuous casting relation embedding vector; This represents the standard tail entity embedding vector.

[0035] In this embodiment, semantic similarity based on BERT is used to calculate and complete the entity and relation alignment from keywords to the knowledge graph. The query entity set extracted from the large language model is then processed using BERT. and query relation set Encode all keywords in the query entity to obtain the corresponding query entity embedding vector set. and query relationship embedding vector set As shown in the following formula:

[0036] In the formula: Indicates querying entity set The Middle Query entities The embedding vector; Indicates querying the continuous casting relation set The Middle A query for continuous casting relationship The embedding vector.

[0037] In this embodiment, the specific method for semantic matching between the query question and standard entities and standard relationships in the continuous casting quality knowledge graph is as follows: like Figure 4 As shown, for a query problem This includes several query entities. Its corresponding semantic embedding vector It also includes several query relationships. Its corresponding semantic embedding vector .

[0038] The existing continuous casting quality knowledge graph contains a set of standard entities. And its corresponding embedding vector is Standard relation set And its corresponding embedding vector is .

[0039] Each query entity Embedded vector Corresponding to each standard entity in the continuous casting quality knowledge graph Embedded vector Perform semantic similarity calculations to obtain the query entity. and standard entities Cosine similarity score This is used to measure how similar the query entity is to the standard entity in the semantic space.

[0040] Each query relationship Embedded vector Relationship with each standard in the continuous casting quality knowledge graph Embedded vector Perform semantic similarity calculations to obtain the query relationship. Relationship with standards Cosine similarity score It is used to achieve the matching of query entities and relations with standard entities and relations. and As shown in the following formula:

[0041]

[0042] in, This represents the semantic similarity calculation function.

[0043] In this embodiment, based on the above similarity scores, the optimal matching object for each entity keyword and relation keyword extracted by the large language model in the continuous casting quality knowledge graph is determined: First, from the cosine similarity matrix In the middle, for each query entity keyword Find the entity node with the highest similarity score among all candidate entities, and denote it as its best matching query entity. .

[0044] For querying relational keywords From the similarity matrix Select the continuous casting relationship with the highest similarity score. As its best matching query relationship.

[0045] Finally, each keyword extracted from the large language model is obtained within the existing continuous casting quality knowledge graph. The best matching query entity set and the best matching query relationship set As shown in the following formula:

[0046]

[0047] Step 2: Constraint Modeling and Dual Retrieval Graph Construction. Based on the classification types of entities and relations in the continuous casting quality knowledge graph, entity constraints and relation constraints are defined respectively. These constraints are bound to the corresponding entities and relations in the continuous casting quality knowledge graph. A direct retrieval graph is constructed using the constraint types in the continuous casting problem as the path expansion standard. A semantically enhanced supplementary retrieval graph is constructed using a multi-hop neighborhood expansion method.

[0048] In this embodiment, the specific method for defining entity constraints and relational constraints is as follows: Entity constraints include four categories: "defect name", "defect characteristics", "defect phenomenon" and "solution measures"; Relationship constraints include three categories: "impact consequences", "feature descriptions", and "solutions".

[0049] After all continuous casting constraints are constructed, it is necessary to bind the corresponding constraint labels to all entities and relationships in the existing continuous casting quality knowledge graph. This binding process designs two text padding segments for each constraint: one for filling in the entity or relationship phrases of the continuous casting constraint, and the other for marking the constraint type to which it belongs, as shown in Table 1.

[0050] Table 1. Continuous Casting Constraint Establishment and Binding Table

[0051] Based on the aforementioned pre-defined constraint binding rules, the standard entity set in the existing continuous casting quality knowledge graph is... Bind corresponding constraint set , for standard relation sets Bind corresponding constraint set This forms a standard continuous casting quality knowledge graph, as shown in the following formula:

[0052]

[0053] In this embodiment, the specific method for constructing the direct retrieval graph is as follows: Figure 5 As shown, the construction of the direct retrieval graph relies on preset entity constraints and relation constraints, specifically: Query the entity set from the best match. Each best-matching query entity in Starting from the standard continuous casting quality knowledge graph, select the best matching query entity. Connected standard relationship This forms a standard relation subset corresponding to the query entity set.

[0054] Select the set of query relations that best match the standard relation subset. For all queries involving standard relations with the same constraint type, the selected standard relation will be used as the expansion path. ; Query entities with the best match connected to the extended path. Starting from this point, perform a 1-hop neighborhood expansion to obtain 1-hop neighborhood nodes, and then determine whether these 1-hop neighborhood nodes are the best matching query entity set. If any of the remaining best-matching query entities is found, then the expansion stops; otherwise, the expansion continues from the obtained neighboring nodes as new starting points until the expanded neighboring nodes form the best-matching query entity set. Stop when the remaining best-matching query entity is found.

[0055] Based on the extension The initial direct retrieval graph is constructed by skipping neighboring nodes and expanding the paths between neighboring nodes.

[0056] To improve the efficiency of path expansion, when along the expansion path... Received After skipping the neighbor node set, the current extended graph will be pruned and optimized according to preset entity constraints. The specific operation is as follows: Constraints are applied to each neighboring node in the initial direct retrieval graph, where: If the constraint type bound to each neighboring node matches the best query entity set If all the best-matching query entities in the graph have different constraint types, then the neighboring node is determined to be invalid, and the neighboring node and the extension path from the starting neighboring node to the neighboring node are removed from the initial direct retrieval graph.

[0057] If the constraint type bound to each neighboring node matches the best query entity set If any best-matching query entity is bound to the same constraint type, then the neighboring node is deemed valid, and the initial direct retrieval graph retains the neighboring node and the expansion path from the starting neighboring node to the neighboring node.

[0058] Meanwhile, considering the degree of entity association in the standard continuous casting quality knowledge graph, this embodiment sets the furthest expansion path to be... If a neighboring node with more than 4 hops still does not belong to the best matching query entity. If no clear connection is found between the starting node and the ending neighbor node, the expansion is stopped, and all expansion paths and intermediate nodes between the ending neighbor node and the starting node are removed. Finally, isolated nodes resulting from this process are discarded.

[0059] For the best matching query entity set Perform the above steps for each best-matching query entity in the query to construct the best-matching query entity. and The set of paths that meet the constraints is used to generate the direct retrieval graph. .

[0060] In this embodiment, as Figure 6 As shown, the specific method for constructing a semantically enhanced supplementary retrieval graph is as follows: First, the best matching query entity set All best-matching query entities are incorporated into the supplementary search graph as the starting point for path expansion.

[0061] Next, query the entity for each best match. Expand by one hop from the starting point to obtain the best matching query entity for each query. All directly connected 1-hop neighbor nodes, and query entities from each best match. The set of paths to these 1-hop neighbor nodes Furthermore, each best-matching query entity, 1-hop neighbor node, and path are included in the supplementary search graph.

[0062] Then, starting from the newly obtained 1-hop neighbor node, a 2-hop expansion is performed to obtain all connected 2-hop neighbor nodes and the set of paths from the 1-hop neighbor node to all 2-hop neighbor nodes. And included in the supplementary search map.

[0063] Finally, a 2-hop closed subgraph centered on all query entities is generated. This subgraph contains all neighborhood nodes and associated paths obtained by expanding 2 hops from each best-matching query entity, as shown in the following equation:

[0064] Due to the 2-hop subgraph obtained through multi-hop expansion Compared with direct retrieval graph There may be duplicate paths, therefore it is necessary to... Perform pruning operations by removing duplicate path sets. Simultaneously, isolated neighboring nodes generated as a result are removed to prevent subsequent knowledge redundancy, thus obtaining a complete supplementary retrieval graph. .and The paths are constructed differently. The neighborhood expansion process is no longer subject to strict continuous casting constraints, and it explores all potential connections between other entities related to the best-matching query entity. Able to reveal in This will broaden the knowledge of continuous casting defects not covered in the curriculum and improve the knowledge base of LLM.

[0065] Step 3: Score the semantic embedding vector obtained in Step 1 and the answer path of the direct retrieval graph obtained in Step 2, and use the score as the evaluation criterion for answer relevance to optimize the direct retrieval graph.

[0066] In this embodiment, the semantic embedding vector obtained in step 1 is used as the basis. Combined with learning scoring functions For direct retrieval graphs Each complete path in Each segment path in Scoring is performed to obtain a score value corresponding to each segment path. ; Based on the scores corresponding to all the segmented paths obtained Take the average value to obtain the score for each complete path. ; score The complete path and the tail entity of the best matching query corresponding to that complete path are removed to obtain the updated direct retrieval graph. ; The updated direct search graph will be obtained. This information is returned to the large language model as the basis for generating the final answer. The specific calculation method is shown in the following formula:

[0067]

[0068]

[0069] In the formula: This represents the continuous casting problem obtained in step 1. semantic embedding vector, This represents the updated continuum embedding vector after feature aggregation via the graph attention network; This represents a knowledge graph completion model based on graph neural networks and a two-branch reasoning layer; b This indicates custom adjustable parameters. This indicates the operation of calculating the arithmetic mean.

[0070] Step 4: Combine the optimized direct retrieval graph obtained in Step 3 with the supplementary retrieval graph obtained in Step 2. To guide the large language model in generating semantic information that is more consistent with the continuous casting domain, Langchain technology is used to guide the large language model in understanding the optimized direct retrieval graph. With supplementary search map And set up such as for them respectively Figure 7 The relevant prompt instructions are shown below.

[0071] Example 2 The enhanced knowledge retrieval method for continuous casting billet defects based on entity relationship constraints and dual retrieval graphs provided in this embodiment specifically includes the following steps: First, semantic parsing of the large language model is aligned with the knowledge graph. The large language model extracts entity and relation keywords from the continuous casting problem, forming a set of keyword triples. The BERT model is used to encode these keyword triples into semantic embedding vectors. The continuous casting quality knowledge graph, completed using a graph neural network and a two-branch inference model, is then embedded into the semantic space. Finally, semantic matching between the query question and the entities and relations in the continuous casting quality knowledge graph is achieved by calculating the semantic similarity between the keyword set extracted by the large language model and the entities and relations in the continuous casting quality knowledge graph.

[0072] Next, constraint modeling and dual retrieval graph construction are performed. Based on the classification types of entities and relations in the continuous casting quality knowledge graph, entity constraints and relation constraints are defined respectively. These constraints are bound to the corresponding defect entities and relations in the continuous casting quality knowledge graph. A direct retrieval graph is constructed using the constraint type in the continuous casting problem as the path expansion standard, and a semantically enhanced supplementary retrieval graph is constructed through a multi-hop neighborhood expansion method.

[0073] Then, the direct retrieval graph is optimized by scoring the question semantic embedding vector obtained by separately encoding the question using the BERT model and the retrieval graph answer path, which serves as the evaluation criterion for answer relevance.

[0074] Finally, the optimized direct retrieval graph is combined with the previously constructed supplementary retrieval graph, and Langchain technology is used to guide the large language model to generate the final answer.

[0075] In specific experiments, the method provided by this invention was evaluated using the GPT-3.5 model and a continuous casting defect knowledge dataset. As shown in Table 2, the method performed well in terms of precision and recall. Value and Good results were achieved in several key indicators, including [value]. [High] The value indicates that the method excels in outputting accurate knowledge, while a higher value indicates that the method excels in outputting accurate knowledge. The value indicates that the method can comprehensively cover relevant defect knowledge and reduce information omissions.

[0076] Table 2 Performance Indicators of the Method of the Invention on the Continuous Casting Defect Knowledge Dataset

[0077] Experimental verification shows that the constraint mechanism and dual retrieval graph strategy adopted in this invention can work together to improve the accuracy of defect knowledge retrieval in the continuous casting field through multi-level knowledge retrieval and fusion, and effectively support the generation of high-quality natural language answers.

[0078] Example 3 This embodiment provides a knowledge retrieval system for defects in continuously cast billets based on dual-retrieval graphs, including: The large language retrieval unit is configured to take the direct retrieval graph, supplementary retrieval graph, and continuous casting problem as input to the large language model. It then uses the large language model to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. The direct retrieval graph is configured to locate knowledge paths related to continuous casting problems. The supplementary search graph is configured to supplement related knowledge that may be missed by the direct search graph.

[0079] Example 4 This embodiment also provides a computing device. The computing device includes a bus, a processor, a memory, and a communication interface. The processor, memory, and communication interface communicate with each other via the bus. The computing device can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memory in the computing device.

[0080] A bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, a bus can include a path for transmitting information between various components of a computing device (e.g., memory, processor, communication interfaces).

[0081] The processor may include any one or more of the following: central processing unit (CPU), graphics processing unit (GPU), tensor processing unit (TPU), application specific integrated circuit (ASIC), field-programmable gate array (FPGA), microprocessor (MP), or digital signal processor (DSP).

[0082] Memory can include volatile memory, such as random access memory (RAM). Processors can also include non-volatile memory. volatile memory, such as read-only memory (ROM). ROM (memory only), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0083] The memory stores executable program code, which the processor executes to implement the functions of the aforementioned units, thereby achieving, for example, the method described in Embodiment 1. That is, the memory may store instructions for the methods and functions relating to the computing device in any of the above embodiments.

[0084] The communication interface uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between computing devices and other devices or communication networks.

[0085] Example 5 This embodiment also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, cause the processor to perform the methods and functions of the computing device involved in any of the above embodiments.

[0086] Generally, the various embodiments of this disclosure can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects can be implemented in hardware, while others can be implemented in firmware or software, which can be executed by a controller, microprocessor, or other computing device. Although various aspects of the embodiments of this disclosure are shown and described as block diagrams, flowcharts, or represented using some other illustration, it should be understood that the blocks, apparatuses, systems, techniques, or methods described herein can be implemented as, as non-limiting examples, in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0087] Example 6 This embodiment provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which execute in a device on a target real or virtual processor to perform the processes / methods as described above with reference to the accompanying drawings. Typically, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., that perform specific tasks or implement specific abstract data types. In various embodiments, the functionality of program modules can be combined or divided among program modules as needed. The machine-executable instructions for the program modules can execute within a local or distributed device. In a distributed device, the program modules can reside in both local and remote storage media.

[0088] Computer program code used to implement the methods of this disclosure may be written in one or more programming languages. This computer program code may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the computer or other programmable data processing apparatus, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be performed. The program code may be executed entirely on a computer, partially on a computer, as a stand-alone software package, partially on a computer and partially on a remote computer, or entirely on a remote computer or server.

[0089] In the context of this disclosure, computer program code or related data may be carried on any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and so on. Examples of signals may include electrical, optical, radio, sound, or other forms of propagation signals, such as carrier waves, infrared signals, etc.

[0090] Computer-readable media can be any tangible medium that contains or stores programs for or relating to an instruction execution system, apparatus, or device, or a data storage device such as a data center containing one or more available media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. More detailed examples of computer-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0091] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.< / eos> < / sep> < / cls> < / eos> < / sep> < / cls> < / eos> < / sep> < / cls>

Claims

1. A method for retrieving knowledge about defects in continuously cast billets based on a dual-retrieval graph, characterized in that, Includes the following steps: The direct retrieval graph, supplementary retrieval graph, and continuous casting problem are used as inputs to a large language model. The large language model is then used to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. Specifically: The direct retrieval graph is configured to locate knowledge paths related to continuous casting problems. The supplementary search graph is configured to supplement related knowledge that may be missed by the direct search graph.

2. The method for retrieving knowledge of defects in continuously cast billets based on a dual-retrieval graph according to claim 1, characterized in that, The methods for constructing direct retrieval maps and supplementary retrieval maps are as follows: Extract the head entity keywords, tail entity keywords, and continuous casting relationship keywords from historical continuous casting problems to form a set of keyword triplets; Based on the obtained set of keyword triples, the query entity set and query relation set are obtained; The obtained query entity set and query relation set are semantically matched with the existing continuous casting quality knowledge graph to obtain the best matching entity set and the best matching relation set. Based on the obtained set of best-matching entities and set of best-matching relationships, construct a direct retrieval graph and a supplementary retrieval graph.

3. The method for retrieving knowledge of defects in continuously cast billets based on a dual-retrieval graph according to claim 2, characterized in that, The obtained query entity set and query relation set are semantically matched with the existing continuous casting quality knowledge graph to obtain the best matching entity set and the best matching relation set. The specific method is as follows: The query entity set, query relation set, and standard entities and standard relations in the existing continuous casting quality knowledge graph are respectively encoded into query entity semantic embedding vectors, query relation semantic embedding vectors, standard entity semantic embedding vectors, and standard relation semantic embedding vectors; Calculate the similarity between the query entity semantic embedding vector and the standard entity semantic embedding vector to obtain the entity cosine similarity score; Calculate the similarity between the query relation semantic embedding vector and the standard relation semantic embedding vector to obtain the relation cosine similarity score; Based on the obtained entity cosine similarity score and relation cosine similarity score, the corresponding query entities and query relations are selected to obtain the best matching query entity set and the best matching query relation set.

4. The method for retrieving knowledge of defects in continuously cast billets based on a dual-retrieval graph according to claim 2, characterized in that, Based on the obtained best matching entity set and best matching relationship set, a direct retrieval graph and a supplementary retrieval graph are constructed. The specific method is as follows: Based on the classification of standard entities and standard relationships in the existing continuous casting knowledge graph, entity constraints and relationship constraints are defined respectively. Entity constraints include defect name, defect characteristics, defect phenomenon, and solution measures; relationship constraints include impact consequences, feature description, and solution methods. The entity constraints and relational constraints are bound to each standard entity and each standard relation in the existing continuous casting quality knowledge graph to obtain the standard continuous casting quality knowledge graph. Starting with each best-matching query entity in the best-matching query entity set, standard relationships connected to the best-matching query entities are selected from the standard continuous casting quality knowledge graph to form a standard relationship subset. Select standard relations from the standard relation subset that have the same constraint type as all query relations in the best matching query relation set, and use the selected standard relations as the expansion path; Constrained neighborhood expansion is performed along each expansion path to its connected neighboring nodes to construct a direct retrieval graph; A supplementary retrieval graph is constructed by multi-hop neighborhood expansion starting from each best-matching query entity in the best-matching query entity set.

5. The method for retrieving knowledge of defects in continuously cast billets based on a dual-retrieval graph according to claim 4, characterized in that, Constrained neighborhood expansion is performed along each expansion path to its connected neighboring nodes to construct a direct retrieval graph. The specific method is as follows: Each expansion path is extended one hop to its connected neighboring nodes to obtain one-hop neighboring nodes. It is then determined whether each one-hop neighboring node is any of the remaining best-matching query entities in the best-matching query entity set. If the 1-hop neighbor node belongs to any of the remaining best-matching query entities in the best-matching query entity set, then the expansion stops; If the 1-hop neighbor node does not belong to any of the remaining best matching query entities in the best matching query entity set, then the obtained neighbor node is used as a new starting point to continue expansion until the expanded neighbor node is any of the remaining best matching query entities in the best matching query entity set. When the farthest expansion path reaches the preset path number threshold and the obtained termination neighbor node does not belong to any of the remaining best matching query entities in the best matching query entity set, then the expansion stops. Based on the extension The initial direct retrieval graph is constructed by skipping neighboring nodes and expanding the paths between neighboring nodes; Constraints are applied to each neighboring node in the initial direct retrieval graph, where: If the constraint type bound to each neighboring node is different from the constraint type bound to all best-matching query entities in the best-matching query entity set, then the neighboring node is determined to be invalid, and the neighboring node and the extension path from the starting neighboring node to the neighboring node are removed from the initial direct retrieval graph. If the constraint type bound to each neighboring node is the same as the constraint type bound to any best matching query entity in the best matching query entity set, then the neighboring node is determined to be valid. The initial direct retrieval graph retains the neighboring node and the expansion path from the starting neighboring node to the neighboring node, thus obtaining the intermediate direct retrieval graph. The obtained set of keyword triples is encoded to obtain a semantic embedding vector; Each complete path in the intermediate direct retrieval graph is scored based on the obtained semantic embedding vector, and the corresponding score value is obtained. The final direct retrieval graph is obtained by removing the complete path with a score less than or equal to a preset threshold and the tail entity of the best matching query corresponding to that complete path.

6. The method for retrieving knowledge of defects in continuously cast billets based on a dual-retrieval graph according to claim 4, characterized in that, A supplementary retrieval graph is constructed by multi-hop neighborhood expansion, starting from each best-matching query entity in the best-matching query entity set. The specific method is as follows: Starting from each best-matching query entity, perform a 1-hop neighborhood expansion to obtain a set of all 1-hop neighborhood nodes and paths connected to each entity; Each 1-hop neighbor node is used as a new starting point to expand the 2-hop neighborhood, resulting in a set of all 2-hop neighbor nodes and paths connected to each 1-hop neighbor node. Based on the set of all 1-hop neighborhood nodes and paths and the set of all 2-hop neighborhood nodes and paths, a 2-hop neighborhood subgraph is generated centered on all best-matching query entities. By deleting duplicate paths in the 2-hop neighborhood subgraph and the direct retrieval graph, a supplementary retrieval graph is obtained.

7. A knowledge retrieval system for defects in continuously cast billets based on dual retrieval graphs, characterized in that, include: The large language retrieval unit is configured to take the direct retrieval graph, supplementary retrieval graph, and continuous casting problem as input to the large language model. It then uses the large language model to retrieve knowledge about defects in continuously cast billets within the continuous casting problem. The direct retrieval graph is configured to locate knowledge paths related to continuous casting problems. The supplementary search graph is configured to supplement related knowledge that may be missed by the direct search graph.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1 to 6.

9. A computer program product, characterized in that, The computer program product includes computer-executable instructions that, when executed, implement the method of any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the method of any one of claims 1 to 6.