Industrial formula and process knowledge answer generation method and device

By cleaning and fusion of industrial formula data and process knowledge data, forming a domain knowledge graph and establishing a reverse index, the problems of high construction and maintenance costs, lack of intelligence and low retrieval efficiency in the existing technology are solved, and efficient and intelligent are achieved The generation and interpretation of the answers are improved.

CN119494402AActive Publication Date: 2025-02-21SHENYANG INST OF AUTOMATION GUANGZHOU CHINESE ACAD OF SCI
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411493804.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-21
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

The existing technology has problems such as high construction and maintenance costs, lack of intelligence and low retrieval efficiency in the management and application of industrial formula and process knowledge.

Method used

By cleaning and preprocessing industrial formula data and process knowledge data, naming entity recognition, relationship extraction and data fusion, forming a domain knowledge graph, and establishing an inverted index to achieve efficient query and answer generation.

Benefits of technology

It reduces the construction and maintenance costs of the knowledge graph, improves the system's retrieval efficiency, provides more intelligent and efficient services, and the generated answers include decision suggestions and self-certified information, which improves the credibility and explanatory nature of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119494402A_ABST
    Figure CN119494402A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial formula and process knowledge answer generation method and device, and the method comprises the steps: forming a field knowledge graph oriented to industrial formula and process knowledge according to an entity set and a relation set; establishing an inverted index according to node attributes and edge attributes of the domain knowledge graph; coding and retrieving nodes and edges of the domain knowledge graph according to the inverted index and a query embedding vector generated by a user input question to obtain an optimal sub-graph; and inputting the user input question subjected to text coding and the optimal sub-graph subjected to graph coding into a preset large language model to generate an answer containing self-certification information. According to the invention, automatic data processing and knowledge graph construction reduce the demand of manual intervention, and reduce the construction and maintenance cost; and the reverse index and the efficient retrieval algorithm are introduced, so that the query speed is increased, and the system can quickly respond to user requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial data processing, and in particular to a method and device for generating answers to industrial formula and process knowledge. Background Art

[0002] Existing technologies have their own advantages and disadvantages in the management and application of private formula and process knowledge in various industries. Traditional database systems are stable but lack intelligence; expert systems have certain reasoning capabilities but poor flexibility; knowledge graphs can handle complex relationships but have high construction and maintenance costs. Although the above three major existing technologies have solved the management and application problems of private industrial formula and process knowledge in the textile industry to a certain extent, their flexibility and intelligence are very limited, and there are still many shortcomings:

[0003] (1) High construction and maintenance costs: Traditional databases and expert systems rely on manual maintenance, and the construction and updating of knowledge graphs also require a lot of manpower. At the same time, as time goes by, the amount of data increases exponentially, especially in the face of more and more unstructured and semi-structured data, maintaining and updating databases and knowledge graphs will become more and more complicated.

[0004] (2) Lack of intelligence: The system can only operate according to predefined structures and query statements, lacking flexible knowledge reasoning and automated processing capabilities. Once the rules are defined, it is difficult to adjust them dynamically. It can be seen that these technologies have limited capabilities in knowledge reasoning and automated processing, and it is difficult to meet dynamic and complex process requirements.

[0005] (3) Low retrieval efficiency: When faced with complex queries and large-scale graphs, the processing capabilities of existing technologies are limited, and the retrieval and reasoning efficiency is low, making it difficult to respond to user needs in real time. Summary of the invention

[0006] The embodiments of the present invention provide a method and device for generating answers to industrial formula and process knowledge, which reduces the construction and maintenance costs of industry knowledge graphs, improves the retrieval efficiency of the system, and provides users with more intelligent and efficient services.

[0007] To achieve the above objectives, a first aspect of an embodiment of the present application provides a method for generating an industrial formula and process knowledge answer, comprising:

[0008] Clean and preprocess industrial formula data and process knowledge data to obtain standardized data;

[0009] Performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set;

[0010] According to the entity set and the relationship set, a domain knowledge graph for industrial formula and process knowledge is formed;

[0011] Establish an inverted index according to the node attributes and edge attributes of the domain knowledge graph;

[0012] According to the inverted index and the query embedding vector generated by the user input question, the nodes and edges of the domain knowledge graph are encoded and retrieved to obtain the optimal subgraph;

[0013] The text-encoded user input question and the graph-encoded optimal subgraph are input into a preset large language model to generate an answer containing self-verification information.

[0014] In a possible implementation of the first aspect, the industrial formula data and the process knowledge data are cleaned and preprocessed to obtain standardized data, specifically including:

[0015] Based on the unique identifier, deleting duplicates in the industrial formula data and process knowledge data;

[0016] Filling missing values ​​in the industrial formula data and process knowledge data by linear interpolation;

[0017] The industrial formula data and the process knowledge data are standardized according to the mean and standard deviation of the industrial formula data and the process knowledge data.

[0018] In a possible implementation manner of the first aspect, performing named entity recognition, relationship extraction, and data fusion on the standardized data to obtain an entity set and a relationship set specifically includes:

[0019] Using the RoBERTa model to identify entities in the standardized data;

[0020] Using a pre-trained language model combined with a bidirectional long short-term memory network to identify the relationship between the entities;

[0021] Two entities whose similarity is greater than the matching threshold are merged to obtain an entity set and a relationship set.

[0022] In a possible implementation manner of the first aspect, forming a domain knowledge graph for industrial formula and process knowledge according to the entity set and the relationship set specifically includes:

[0023] The entity set and the relationship set are filled into different preset entity relationships, the entities in the different entity relationships are used as nodes, and the relationships in the different entity relationships are imported into a graph database as edges to form a domain knowledge graph for industrial formula and process knowledge.

[0024] In a possible implementation manner of the first aspect, establishing an inverted index according to the node attributes and edge attributes of the domain knowledge graph specifically includes:

[0025] According to the node attributes of the domain knowledge graph, several node attribute fields are established;

[0026] According to the edge attributes of the domain knowledge graph, a plurality of edge attribute fields are established;

[0027] The node serial numbers of all the node attribute fields and the edge serial numbers of all the edge attribute fields are recorded to establish an inverted index.

[0028] In a possible implementation manner of the first aspect, before encoding and retrieving the nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph, the method further includes:

[0029] The user input question is fed into the application language model, and a preset encoding strategy is applied to generate a query embedding vector.

[0030] In a possible implementation manner of the first aspect, encoding and retrieving nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain an optimal subgraph specifically includes:

[0031] Applying the preset encoding strategy to encode the nodes and edges of the domain knowledge graph respectively;

[0032] Using the k-nearest neighbor retrieval method, the node of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant node, and the edge of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant edge.

[0033] In a possible implementation manner of the first aspect, inputting the text-encoded user input question and the graph-encoded optimal subgraph into a preset large language model to generate an answer containing self-verification information specifically includes:

[0034] Text encoding is performed on the user input question by a text embedder to obtain a query input;

[0035] Aligning the optimal subgraph with the vector space of a preset large language model through a graph encoder including a multi-layer perceptron to obtain a graph input;

[0036] The query input and the graph input are input together into the preset large language model to generate an answer containing decision suggestions and self-verification information; the self-verification information is the explanation information of the decision suggestions.

[0037] In a possible implementation manner of the first aspect, the preset large language model is an open source large language model or a commercial large language model that introduces an enhanced attention mechanism.

[0038] A second aspect of an embodiment of the present application provides an industrial formula and process knowledge answer generation device, comprising:

[0039] The standardization module is used to clean and preprocess the industrial formula data and process knowledge data to obtain standardized data;

[0040] A fusion module, used for performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set;

[0041] A graph module, used to form a domain knowledge graph for industrial formula and process knowledge based on the entity set and the relationship set;

[0042] Establishing a module for establishing an inverted index according to the node attributes and edge attributes of the domain knowledge graph;

[0043] A subgraph module, used to encode and retrieve nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain an optimal subgraph;

[0044] A generation module is used to input the user input question after text encoding and the optimal subgraph after graph encoding into a preset large language model to generate an answer containing self-verification information.

[0045] Compared with the prior art, the method and device for generating answers to industrial formula and process knowledge provided by the embodiment of the present invention ensure the high quality of data through data cleaning and preprocessing; through named entity recognition and relationship extraction, the system can accurately identify and extract key entities in the data and the relationships between them, providing structured information for building a knowledge graph, and then converting the entities and relationships into nodes and edges in the graph database, forming a structured knowledge graph, which is convenient for the management and query of complex relationships. Then, by establishing an inverted index, the system can quickly locate relevant nodes and edges in large-scale data, significantly improving the query speed. Finally, combined with the user input question and the optimal subgraph, the answer generated by the large language model not only contains decision suggestions, but also comes with self-certification information, which improves the credibility and interpretability of the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a flowchart of a method for generating industrial formula and process knowledge answers according to an embodiment of the present invention;

[0047] Figure 2A schematic diagram of a process for obtaining an optimal subgraph is provided in one embodiment of the present invention;

[0048] Figure 3 The present invention provides a schematic diagram of a process for generating an answer containing self-certifying information according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] To solve the above problems, see Figure 1 An embodiment of the present invention provides a method for generating answers to industrial formula and process knowledge, comprising:

[0051] S10. Clean and preprocess the industrial formula data and process knowledge data to obtain standardized data.

[0052] S11. Perform named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set.

[0053] S12. Based on the entity set and the relationship set, a domain knowledge graph for industrial formula and process knowledge is formed.

[0054] S13. Establish an inverted index based on the node attributes and edge attributes of the domain knowledge graph.

[0055] S14. According to the inverted index and the query embedding vector generated by the user input question, the nodes and edges of the domain knowledge graph are encoded and retrieved to obtain the optimal subgraph.

[0056] S15. Input the text-encoded user input question and the graph-encoded optimal subgraph into a preset large language model to generate an answer containing self-verification information.

[0057] The above method is essentially a method for managing and utilizing private industrial formulas and process knowledge based on a large language model and domain knowledge graph. Through the RAG (Retrieval Augmented Generation) process, it achieves comprehensive data cleaning, effective knowledge extraction and fusion, graph construction and indexing, and efficient answer generation and interpretation:

[0058] The standardized processing in S10 ensures the integrity and consistency of the data, providing a high-quality data foundation for subsequent processing; through named entity recognition and relationship extraction in S11, the system can accurately identify and extract key entities in the data and the relationships between them, providing structured information for building a knowledge graph; data fusion reduces redundant entities, improves the integration of data, and makes the knowledge graph more concise and efficient.

[0059] S12 converts entities and relationships into nodes and edges in a graph database, forming a structured knowledge graph that facilitates the management and query of complex relationships. The visualization characteristics of the knowledge graph make data relationships more intuitive, which facilitates management and analysis. S13 By establishing an inverted index, the system can quickly locate relevant nodes and edges in large-scale data, significantly improving the query speed. The inverted index optimizes the retrieval path, allowing complex queries to be completed efficiently and improving the system's response speed. S14 generates a query embedding vector and performs similarity calculations, allowing the system to accurately match the questions entered by the user, improving the accuracy and relevance of the retrieval.

[0060] S15 combines the user input question and the optimal subgraph. The answer generated by the large language model not only contains decision suggestions, but also comes with self-verification information, which improves the credibility and interpretability of the answer. The generated answer is more accurate and comprehensive, and users can get the required information faster, which improves the overall user experience of the system.

[0061] The above method can not only efficiently manage and apply industrial formula and process knowledge, but also significantly improve the performance of the management system in the following aspects: First, through data cleaning and preprocessing, the high quality of data is ensured; second, the structuring of the knowledge graph forms a structured and visual knowledge graph, which is easy to manage and query; third, the query efficiency, through inverted index and efficient retrieval algorithm, significantly improves the query speed; fourth, the intelligence level, using large language models to generate intelligent answers, improves the intelligence of the system and user experience. These improvements are not only applicable to the textile industry, but can also be extended to other industries that need to manage and apply complex knowledge, helping industrial enterprises to improve their competitiveness and innovation capabilities.

[0062] Exemplarily, the industrial formula data and process knowledge data are cleaned and preprocessed to obtain standardized data, specifically including:

[0063] Based on the unique identifier, deleting duplicates in the industrial formula data and process knowledge data;

[0064] Filling missing values ​​in the industrial formula data and process knowledge data by linear interpolation;

[0065] The industrial formula data and the process knowledge data are standardized according to the mean and standard deviation of the industrial formula data and the process knowledge data.

[0066] Data cleaning and preprocessing is a crucial step in data analysis. Its purpose is to remove noise and inconsistency in the data, which is completed through three steps: deleting redundant information, filling missing data, and data standardization to improve data quality and model accuracy. After manually deleting duplicates based on unique identifiers (such as IDs), the data needs to be processed for missing values ​​and standardized. Missing value processing refers to the use of appropriate methods to fill in missing values ​​when there are missing values ​​in the data set. In this solution, missing values ​​will be filled in by linear interpolation, and the linear interpolation method is implemented as follows:

[0067]

[0068] Among them, x i is the location of the missing value, x i-1 is the data value before the missing value, x i+1 is the data value of the position after the missing value. Data standardization is to convert the data to the same scale to eliminate the impact of different dimensions between different features. Data standardization is performed by the following formula:

[0069]

[0070] Among them, x is the original data value, μ is the mean of the data set, σ is the standard deviation of the data set, and x′ is the standardized data value.

[0071] Exemplarily, the performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set specifically includes:

[0072] Using the RoBERTa model to identify entities in the standardized data;

[0073] Using a pre-trained language model combined with a bidirectional long short-term memory network to identify the relationship between the entities;

[0074] Two entities whose similarity is greater than the matching threshold are merged to obtain an entity set and a relationship set.

[0075] The above steps are used for knowledge extraction and fusion, aiming to extract key information from unstructured text data and fuse this information with other data sources to form a unified knowledge representation. It mainly includes three steps: named entity recognition, relationship extraction and data fusion.

[0076] Named entities can use the RoBERTa model to identify entities in text, such as chemical composition, process steps, equipment names, etc. RoBERTa is an improved version of BERT, which aims to improve the performance of the model by optimizing the pre-training process. Its main improvements include: longer pre-training, larger batch size, removal of the next sentence prediction (NSP) task, and better hyperparameter tuning. The self-attention mechanism of RoBERTa is as follows:

[0077]

[0078] Where Q, K, and V are linear transformations of the input, d k is the dimension of the key vector. After the input text T, the RoBERTa model outputs the entity set E:

[0079] E={(e i ,t i )|i=1,2,…,n} (4)

[0080] Among them, e i The i-th entity identified, t i is the type of entity and n is the total number of entities.

[0081] Relation extraction can use a pre-trained language model (such as BERT) combined with a bidirectional long short-term memory network (BiLSTM) to identify the relationship between entities. For example, "the combination of component A and component B" or "step X is the predecessor of step Y". Among them, BERT's attention mechanism is the same as formula (c). BiLSTM is a bidirectional long short-term memory network that improves the modeling ability of sequence data by considering both forward and backward context information. The main features of BiLSTM include: bidirectional information flow and long short-term memory. To capture the context information of the sequence. The BiLSTM unit is as follows:

[0082] f t =σ(W f ·[h t-1 ,x t ]+b f ) (5)

[0083] i t =σ(W i ·[h t-1 ,x t ]+b i ) (6)

[0084]

[0085] o t =σ(W o ·[h t-1,x t ]+b o ) (9)

[0086] h t =o t *tanh(C t ) (10)

[0087] Among them, f t It is the forget gate, t is the input gate, is the candidate memory, C t is a memory unit, o t is the output gate, h t is the hidden state, x t is the input, W and b are weights and biases, σ is the sigmoid function, and tanh is the hyperbolic tangent function. After the input text T, BERT combined with the BiLSTM model outputs the relation set R:

[0088] R={(e i ,e j ,r ij )|i,j=1,2,…,n} (11)

[0089] Among them, e i and e j The recognized entity, r ij It is entity e i and e j Data fusion is to integrate the knowledge extracted from text with other data sources (such as databases and experimental data) to form a unified knowledge representation. According to the following matching rules, the same or similar entities in different data sources are merged.

[0090]

[0091] Among them, (e i ,e j ) is entity e i and e j In the matching process, two entities with similarity greater than the matching threshold are considered the same and merged.

[0092] Through the above steps, key entities can be identified from standardized data, the relationships between entities can be extracted, and data fusion can be performed through similarity calculation to finally generate entity sets and relationship sets. These sets provide important basic data for the subsequent construction of domain knowledge graphs.

[0093] Exemplarily, the forming of a domain knowledge graph for industrial formula and process knowledge based on the entity set and the relationship set specifically includes:

[0094] The entity set and the relationship set are filled into different preset entity relationships, the entities in the different entity relationships are used as nodes, and the relationships in the different entity relationships are imported into a graph database as edges to form a domain knowledge graph for industrial formula and process knowledge.

[0095] The goal of constructing a domain knowledge graph is to organize the extracted entities and relationships into a coherent graph structure for storing and retrieving domain-specific knowledge. According to private formulas and process knowledge, the entity types are determined, such as chemical composition, process steps, equipment names, etc., and the relationship types between entities are further defined, such as "combination", "pre-steps", etc. Subsequently, the entity sets and relationship sets after data fusion are filled into various entities and relationships to form a domain knowledge graph for private formulas and process knowledge. Finally, the node (entity) and edge (relationship) data are imported into the graph database Neo4j to form a complete knowledge graph for efficient retrieval and query.

[0096] When importing, each entity in the entity collection is imported into the graph database as a node. Each node contains the attributes of the entity, such as name, type, description, etc.; each relationship in the relationship collection is imported into the graph database as an edge. Each edge connects two nodes and contains the relationship type and other attributes. A complete knowledge graph is built in the graph database to ensure that all nodes and edges are correctly connected.

[0097] Through the above steps, the entity set and relationship set are imported into the graph database to form a domain knowledge graph for industrial formula and process knowledge. This graph structurally represents the key entities and their relationships in industrial formula and process knowledge, providing strong support for subsequent query, analysis and application.

[0098] Exemplarily, the step of establishing an inverted index according to the node attributes and edge attributes of the domain knowledge graph specifically includes:

[0099] According to the node attributes of the domain knowledge graph, several node attribute fields are established;

[0100] According to the edge attributes of the domain knowledge graph, a plurality of edge attribute fields are established;

[0101] The node serial numbers of all the node attribute fields and the edge serial numbers of all the edge attribute fields are recorded to establish an inverted index.

[0102] The purpose of graph indexing is to improve the query and retrieval efficiency of the knowledge graph. By establishing an index, specific nodes or relationships can be quickly located to support complex query operations. This step establishes an inverted index for the attributes of nodes (entities) and edges (relationships) in the domain knowledge graph to support fast retrieval. First, select the node and edge attribute fields that need to be indexed (such as node name, type, edge type, etc.); secondly, establish an inverted index for each index field and record the node or edge sequence number corresponding to each attribute value. Specifically, the inverted index structure is as follows:

[0103] I={(term,{id1,id2,…,id n})|term∈attributes,id i ∈nodes oredges}(13)

[0104] Among them, I is the inverted index set, term is the attribute value of the index field, id i is the corresponding node or edge number, attributes is the set of all attributes, and nodes or edges is the set of all entities and relationships.

[0105] If you want to find all nodes of type "raw materials", you can quickly find the ID list of these nodes through the inverted index. If you want to find all edges of type "use", you can also quickly find the ID list of these edges through the inverted index. By establishing an inverted index, the search efficiency of node and edge attributes in the domain knowledge graph can be greatly improved. This method is particularly suitable for scenarios with diverse attribute values ​​and frequent queries, which can significantly reduce query time and improve user experience.

[0106] See also Figure 2 Exemplarily, before encoding and retrieving the nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph, the method further includes:

[0107] The user input question is fed into the application language model, and a preset encoding strategy is applied to generate a query embedding vector.

[0108] For the text attribute Z of node n n , apply the language model LM, and get the representation Z n =LM(x n )∈R d For technicians in the textile industry who randomly ask a given recipe question q in the field, the same encoding strategy is applied to generate the query embedding vector Z q =LM(x q )∈R d .

[0109] Exemplarily, encoding and retrieving nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph specifically includes:

[0110] Applying the preset encoding strategy to encode the nodes and edges of the domain knowledge graph respectively;

[0111] Using the k-nearest neighbor retrieval method, the node of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant node, and the edge of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant edge.

[0112] The above cross-domain inverted index based on the above-mentioned establishment encodes and retrieves the nodes and edges of the domain knowledge graph, aiming to accurately locate the relevant subgraphs and node information in specific decision problems and situations.

[0113] We can use k-nearest neighbor retrieval to identify the most relevant nodes and edges based on the similarity between the query and each node or edge. We will then study graph refinement and embedding, aiming to build a subgraph that contains as many relevant nodes and edges as possible while keeping the size of the graph manageable. Finally, we can use a reward algorithm to reward the most relevant nodes (V k ) and edge (E k ) assigns a higher reward value and identifies an optimally sized and relevant subgraph S * The optimal subgraph is obtained by optimizing the total reward value of nodes and edges minus the cost associated with the subgraph size, aiming to contextualize the retrieved recipe process scenarios.

[0114] In practical applications, the inverted index can be used to preliminarily filter out relevant nodes and edges based on the keywords in the query embedding vector Zq (such as "cotton fiber" and "equipment"). For the embedding vectors Zn and Ze of the preliminarily filtered nodes and edges, the similarity between them and the query embedding vector Zq is calculated. Cosine similarity or other distance measurement methods can be used.

[0115] Then select the top k nodes and edges with the highest similarity as the most relevant nodes and edges. Select the most relevant nodes and edges: for example, the most relevant node: node 2 (ring spinning machine); the most relevant edge: edge 1 (cotton fiber is used by ring spinning machine). Connect the most relevant nodes and edges and their adjacent nodes and edges to form the optimal subgraph.

[0116] Through the above steps, we can generate a query embedding vector based on the question entered by the user, and use the inverted index and k-nearest neighbor retrieval method to efficiently locate the most relevant nodes and edges in the domain knowledge graph, and finally build the optimal subgraph. This method not only improves the efficiency of retrieval, but also ensures the relevance and accuracy of the retrieval results.

[0117] See also Figure 3 Exemplarily, the step of inputting the text-encoded user input question and the graph-encoded optimal subgraph into a preset large language model to generate an answer containing self-verification information specifically includes:

[0118] Text encoding is performed on the user input question by a text embedder to obtain a query input;

[0119] Aligning the optimal subgraph with the vector space of a preset large language model through a graph encoder including a multi-layer perceptron to obtain a graph input;

[0120] The query input and the graph input are input together into the preset large language model to generate an answer containing decision suggestions and self-verification information; the self-verification information is the explanation information of the decision suggestions.

[0121] First, at the prompt word input, after the knowledge alignment process described above, the optimal subgraph is obtained; at the enhanced retrieval input, the retrieved optimal subgraph is encoded using a graph encoder, and the graph encoder of the multi-layer perceptron is used to align the graph label with the vector space of the large language model. Then, this encoded graph label (graph input) and the query processed by the text embedder (query input) are input into the pre-trained and frozen large language model to generate the answer.

[0122] Assume that the optimal subgraph contains node 1 (cotton fiber), node 2 (ring spinning machine), and edge 1 (cotton fiber -> ring spinning machine). Use the pre-trained language model to encode the text attributes of the nodes and edges to generate node embedding vectors and edge embedding vectors. Then use a graph encoder with a multi-layer perceptron to align the embedding vectors of the nodes and edges into the vector space of the large language model to generate the graph input.

[0123] Through the above steps, the user input question and the optimal subgraph can be encoded respectively, and these encodings can be input into the preset large language model to generate answers containing decision suggestions and self-verification information. This method not only improves the accuracy and relevance of the answers, but also provides detailed explanation information to help users better understand and apply the generated answers.

[0124] Exemplarily, the preset large language model is an open source large language model or a commercial large language model that introduces an enhanced attention mechanism.

[0125] To further enhance the credibility and interpretability of the generated answers, an enhanced attention mechanism is introduced here to examine the relevance of different subgraph components to the query, ensuring that the generated self-verification information is both accurate and rooted in domain-specific knowledge structures. In addition, the optimized training process of the graph encoder and text embedder that combines domain expert knowledge will be studied to further improve the model's understanding of complex questions and the quality of its answers.

[0126] Compared with the prior art, the method for generating answers to industrial formula and process knowledge provided by the embodiment of the present invention ensures the high quality of data through data cleaning and preprocessing; through named entity recognition and relationship extraction, the system can accurately identify and extract key entities in the data and the relationships between them, providing structured information for building a knowledge graph, and then converting the entities and relationships into nodes and edges in the graph database, forming a structured knowledge graph, which is convenient for the management and query of complex relationships. Then, by establishing an inverted index, the system can quickly locate relevant nodes and edges in large-scale data, significantly improving the query speed. Finally, combined with the user input question and the optimal subgraph, the answer generated by the large language model not only contains decision recommendations, but also comes with self-certification information, which improves the credibility and interpretability of the answer.

[0127] An embodiment of the present application provides an industrial formula and process knowledge answer generation device, including: a standardization module, a fusion module, a graph module, a building module, a sub-graph module and a generation module.

[0128] The standardization module is used to clean and preprocess industrial formula data and process knowledge data to obtain standardized data.

[0129] The fusion module is used to perform named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set.

[0130] A graph module is used to form a domain knowledge graph for industrial formula and process knowledge based on the entity set and the relationship set.

[0131] A module is established to establish an inverted index according to the node attributes and edge attributes of the domain knowledge graph.

[0132] The subgraph module is used to encode and retrieve the nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph.

[0133] A generation module is used to input the user input question after text encoding and the optimal subgraph after graph encoding into a preset large language model to generate an answer containing self-verification information.

[0134] Compared with the prior art, the industrial formula and process knowledge answer generation device provided by the embodiment of the present invention ensures the high quality of data through data cleaning and preprocessing; through named entity recognition and relationship extraction, the system can accurately identify and extract key entities in the data and the relationships between them, providing structured information for building a knowledge graph, and then converting the entities and relationships into nodes and edges in the graph database, forming a structured knowledge graph, which is convenient for the management and query of complex relationships. Then, by establishing an inverted index, the system can quickly locate relevant nodes and edges in large-scale data, significantly improving the query speed. Finally, combined with the user input question and the optimal subgraph, the answer generated by the large language model not only contains decision suggestions, but also comes with self-certification information, which improves the credibility and interpretability of the answer.

[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment and will not be described again here.

[0136] An embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for generating an industrial formula and process knowledge answer as described above.

[0137] The computer device may be a computing device such as a smart phone, a tablet computer, a desktop computer, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the figure is merely an example of a computer device and does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.

[0138] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0139] In some embodiments, the memory may be an internal storage unit of the computer device, such as a hard disk or memory of the computer device. In other embodiments, the memory may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.

[0140] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.

[0141] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.

[0142] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0143] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for generating answers to industrial formula and process knowledge, characterized in that: include: Clean and preprocess industrial formula data and process knowledge data to obtain standardized data; Performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set; According to the entity set and the relationship set, a domain knowledge graph for industrial formula and process knowledge is formed; Establish an inverted index according to the node attributes and edge attributes of the domain knowledge graph; According to the inverted index and the query embedding vector generated by the user input question, the nodes and edges of the domain knowledge graph are encoded and retrieved to obtain the optimal subgraph; The text-encoded user input question and the graph-encoded optimal subgraph are input into a preset large language model to generate an answer containing self-verification information.

2. A method for generating answers to industrial formula and process knowledge as claimed in claim 1, characterized in that: The industrial formula data and process knowledge data are cleaned and preprocessed to obtain standardized data, specifically including: Based on the unique identifier, deleting duplicates in the industrial formula data and process knowledge data; Filling missing values ​​in the industrial formula data and process knowledge data by linear interpolation; The industrial formula data and the process knowledge data are standardized according to the mean and standard deviation of the industrial formula data and the process knowledge data.

3. A method for generating answers to industrial formula and process knowledge as claimed in claim 1, characterized in that: The performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set specifically includes: Using the RoBERTa model to identify entities in the standardized data; Using a pre-trained language model combined with a bidirectional long short-term memory network to identify the relationship between the entities; Two entities whose similarity is greater than the matching threshold are merged to obtain an entity set and a relationship set.

4. A method for generating answers to industrial formula and process knowledge as claimed in claim 1, characterized in that: The forming of a domain knowledge graph for industrial formula and process knowledge according to the entity set and the relationship set specifically includes: The entity set and the relationship set are filled into different preset entity relationships, the entities in the different entity relationships are used as nodes, and the relationships in the different entity relationships are imported into a graph database as edges to form a domain knowledge graph for industrial formula and process knowledge.

5. The method for generating industrial formula and process knowledge answers as claimed in claim 1, characterized in that: The step of establishing an inverted index according to the node attributes and edge attributes of the domain knowledge graph specifically includes: According to the node attributes of the domain knowledge graph, several node attribute fields are established; According to the edge attributes of the domain knowledge graph, a plurality of edge attribute fields are established; The node serial numbers of all the node attribute fields and the edge serial numbers of all the edge attribute fields are recorded to establish an inverted index.

6. A method for generating answers to industrial formula and process knowledge as claimed in claim 1, characterized in that: Before encoding and retrieving the nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph, the method further includes: The user input question is fed into the application language model, and a preset encoding strategy is applied to generate a query embedding vector.

7. A method for generating answers to industrial formula and process knowledge as claimed in claim 6, characterized in that: The encoding and retrieving of nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain the optimal subgraph specifically includes: Applying the preset encoding strategy to encode the nodes and edges of the domain knowledge graph respectively; Using the k-nearest neighbor retrieval method, the node of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant node, and the edge of the domain knowledge graph with the greatest similarity to the query embedding vector is identified as the most relevant edge.

8. The method for generating industrial formula and process knowledge answers as claimed in claim 1, characterized in that: The step of inputting the text-encoded user input question and the graph-encoded optimal subgraph into a preset large language model to generate an answer containing self-verification information specifically includes: Text encoding is performed on the user input question by a text embedder to obtain a query input; Aligning the optimal subgraph with the vector space of a preset large language model through a graph encoder including a multi-layer perceptron to obtain a graph input; The query input and the graph input are input together into the preset large language model to generate an answer containing decision suggestions and self-verification information; the self-verification information is the explanation information of the decision suggestions.

9. A method for generating answers to industrial formula and process knowledge as claimed in claim 7, characterized in that: The preset large language model is an open source large language model or a commercial large language model that introduces an enhanced attention mechanism.

10. An industrial formula and process knowledge answer generation device, characterized in that: include: The standardization module is used to clean and preprocess the industrial formula data and process knowledge data to obtain standardized data; A fusion module, used for performing named entity recognition, relationship extraction and data fusion on the standardized data to obtain an entity set and a relationship set; A graph module, used to form a domain knowledge graph for industrial formula and process knowledge based on the entity set and the relationship set; Establishing a module for establishing an inverted index according to the node attributes and edge attributes of the domain knowledge graph; A subgraph module, used to encode and retrieve nodes and edges of the domain knowledge graph according to the inverted index and the query embedding vector generated by the user input question to obtain an optimal subgraph; A generation module is used to input the user input question after text encoding and the optimal subgraph after graph encoding into a preset large language model to generate an answer containing self-verification information.

Citation Information

Patent Citations

  • Large language model knowledge question-answering method and system fused with multi-modal knowledge graph

    CN118627628A

  • Question and answer method and system based on tin smelting knowledge graph

    CN118779424A

  • Data intelligent question and answer method and system fusing domain knowledge

    CN118779438A

  • Method for constructing knowledge graph based on large language model and vector library

    CN119129722A

  • Method and system for generating enhanced knowledge questions and answers for mixed retrieval of heterogeneous database

    CN119311831A