Generative knowledge retrieval method and electronic equipment in field of safety and environment in iron and steel industry

By building a knowledge graph in the safety and environmental field of the steel industry and combining a natural language processing model, the problem of insufficient knowledge retrieval accuracy in the existing technology is solved, and more efficient and accurate knowledge retrieval results are achieved.

CN119415704APending Publication Date: 2025-02-11WUHAN SURVEYING GEOTECHN RES INST OF MCC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411352637.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The prior art has the problem of insufficient search accuracy in the knowledge retrieval in the field of safety and environmental protection in the steel industry, especially when dealing with large-scale data and complex and diverse industry knowledge.

Method used

By constructing a knowledge graph in the field of safety and environmental protection of steel enterprises and combining natural language processing models, the natural search language input by users is converted into Cypher search statements, structured knowledge information is retrieved in the knowledge graph, and the final search results are generated.

Benefits of technology

It improves the accuracy and efficiency of knowledge retrieval, provides more accurate, relevant, diverse, interesting, logical and consistent information, and solves the hallucinatory fact problems that may arise in the application of natural language processing models in professional fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415704A_ABST
    Figure CN119415704A_ABST
Patent Text Reader

Abstract

The invention relates to a generative knowledge retrieval method and electronic equipment in the field of safety and environment protection of the iron and steel industry, and belongs to the field of large language models and the technical field of information retrieve.The method comprises the steps that a knowledge graph in the field of safety and environment protection of the iron and steel enterprise is built based on collected text data in the field of safety and environment protection of the iron and steel industry; converting a natural retrieval language input by a user into a Cypher retrieval statement based on a natural language processing large model; retrieving in the knowledge graph based on the Cypher retrieval statement to obtain corresponding structured knowledge information; designing prompt information based on the natural retrieval language; the prompt information, the structured knowledge information and historical retrieval information of the natural language processing large model are input into the natural language processing large model, and a final retrieval result is generated. The technical problem of insufficient retrieval precision in the prior art is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of large language models and information retrieval technology, and in particular to a generative knowledge retrieval method and electronic equipment in the field of safety and environmental protection in the steel industry. Background Art

[0002] Knowledge retrieval is the technology and method of retrieving information related to the query from the knowledge base according to the user's query needs. Existing knowledge retrieval technologies mainly include keyword search, text matching, semantic matching, etc., which are used to quickly and accurately retrieve the information required by users. These methods are mostly based on manual classification of the knowledge base, matching using set rules or keywords, and returning relevant results. With the development of the Internet and information technology, the amount of industry knowledge data in specific fields continues to increase. The accuracy and efficiency of knowledge retrieval have become lower due to the amount of data, and even large-scale data cannot be effectively processed. The knowledge in the field of safety and environmental protection in the steel industry is complex, diverse, and heterogeneous. Related research requires higher accuracy in knowledge retrieval and more precise knowledge retrieval methods.

[0003] The big model is a model based on artificial intelligence technology. It has achieved remarkable results in many natural language processing tasks and has good problem-solving capabilities. The model has massive parameters and complex architecture. It is trained through large-scale text data and has strong language understanding and generation capabilities. Applying it to knowledge retrieval is a new research paradigm. The big model is usually based on pre-trained data sets. For applications in professional fields, it is easy to produce hallucination facts, resulting in insufficient accuracy in the retrieval of knowledge. At present, the main solution is to use knowledge enhancement-based methods to improve the problem-solving capabilities of the big model, but there are still problems such as insufficient structuring of the relevant knowledge base and low knowledge relevance. Therefore, in order to meet the knowledge needs in the field of safety and environmental protection in the steel industry, how to enhance the performance of large models and improve the retrieval accuracy of knowledge through more flexible and intelligent knowledge retrieval methods is a technical problem that needs to be solved. Summary of the invention

[0004] In view of this, it is necessary to provide a generative knowledge retrieval method and electronic equipment in the field of safety and environmental protection in the steel industry to solve the technical problem of insufficient retrieval accuracy in the prior art.

[0005] In order to solve the above problems, the present invention provides a generative knowledge retrieval method, comprising: Construct a knowledge graph in the field of safety and environmental protection for steel enterprises based on the collected text data in the field of safety and environmental protection in the steel industry; Based on the natural language processing model, the natural search terms entered by users are converted into Cypher search statements; Retrieving corresponding structured knowledge information in the knowledge graph based on the Cypher search statement; Designing prompt information based on the natural search term; The prompt information, structured knowledge information and historical search information of the natural language processing large model are input into the natural language processing large model to generate a final search result.

[0006] In a possible implementation, the construction of a knowledge graph in the field of safety and environmental protection for steel enterprises based on the collected text data in the field of safety and environmental protection for the steel industry includes: Clean the text data; Based on the cleaned text data, a knowledge graph construction method combining top-down and bottom-up methods is adopted to construct a knowledge graph in the field of safety and environmental protection of steel enterprises.

[0007] In a possible implementation, the knowledge graph in the field of safety and environmental protection of steel enterprises is constructed based on the cleaned text data by using a knowledge graph construction method combining top-down and bottom-up methods, including: Based on the cleaned text data, an ontology construction method is used to construct a knowledge ontology model in the field of safety and environmental protection of steel enterprises; Using a named entity recognition method to extract entities from the text data; Extracting the relations in the text data using a relation extraction method; Based on the ontology model, the extracted entities and relationships are stored in the form of a Neo4j graph database to obtain a knowledge graph in the field of safety and environmental protection of steel enterprises.

[0008] In a possible implementation, extracting entities from the text data using a named entity recognition method includes: Processing the text data based on the BIOES sequence annotation method to generate an annotation file; The Bert-BiLSTM-CRF deep learning model is trained based on the annotation file to obtain a fully trained entity recognition model for entity extraction; The vectorized text data is passed to the entity recognition model for entity extraction.

[0009] In a possible implementation, the extracting the relations in the text data by using a relation extraction method includes: The vectorized text data is input into a BiLSTM neural network model based on a self-attention mechanism to extract the relationship between entities.

[0010] In a possible implementation, based on the ontology model, the extracted entities and relationships are stored in the form of a Neo4j graph database to obtain a knowledge graph in the field of safety and environmental protection of steel enterprises, including: The extracted entities and relationships are stored in the Neo4j graph database in the form of "entity-relationship-attribute" triplets to generate a knowledge graph in the field of safety and environmental protection for steel enterprises.

[0011] In a possible implementation, the converting of the natural search terms input by the user into Cypher search statements based on the natural language processing big model includes: Based on the GLM-4 large model, the sentence stems of natural search terms are extracted to identify the search intent; Setting prompt rules based on prompt information engineering methods; The extracted sentence trunk of the natural search term and the prompt rules are input into the GLM-4 large model to generate a Cypher search sentence.

[0012] In a possible implementation, inputting the prompt information, the structured knowledge information, and the historical search information of the natural language processing big model into the natural language processing big model includes: Injecting the structured knowledge information of the historical search information into the natural language processing large model for knowledge transformation to obtain input prompts; The prompt information and input prompt are input into the large language model to generate the final search result.

[0013] In a possible implementation, injecting the historical search information into the structured knowledge information into the natural language processing large model for knowledge conversion includes: The structured knowledge information is converted into natural language knowledge information based on a large language model, and the content of the natural language knowledge information is adjusted based on the historical retrieval information.

[0014] The present invention also provides an electronic device, comprising: Memory, used to store programs; A processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the generative knowledge retrieval method described in any one of the above method items.

[0015] The beneficial effects of the present invention are as follows: the present invention provides a generative knowledge retrieval method in the field of safety and environmental protection in the steel industry. By uniformly representing the knowledge in the field of safety and environmental protection in the steel industry, a structured knowledge graph is constructed, which can provide accurate factual information to the natural language processing large model. The information processing and recognition capabilities of the natural language processing large model are utilized to parse the retrieval requirements and retrieve the field factual knowledge. By injecting the knowledge base knowledge and historical information into the natural language processing large model, an accurate response is generated for the contextual information provided by the natural language processing large model. In the face of the hallucination problem of the natural language processing large model, the powerful language understanding and generation capabilities of the natural language processing large model are utilized, combined with the rich knowledge contained in the knowledge graph, to provide more accurate and natural accurate knowledge retrieval content. Compared with the knowledge provided by the traditional knowledge base, the knowledge graph provides a better solution, which can provide more accurate, relevant, diverse, interesting, logical and consistent information to the natural language processing large model, so that they can more reliably generate accurate and true information, thereby effectively solving the technical problem of insufficient retrieval accuracy in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A method flow chart of an embodiment of a generative knowledge retrieval method in the field of safety and environmental protection in the steel industry provided by the present invention; Figure 2 for Figure 1 A method flow chart of step S101 in an embodiment; Figure 3 for Figure 2 A method flow chart of an embodiment of step S202; Figure 4 for Figure 3 A method flow chart of an embodiment of step S302; Figure 5 A schematic diagram of the annotated text provided by the present invention; Figure 6 A schematic diagram of the structure of the entity recognition model provided by the present invention; Figure 7 A schematic diagram of the structure of the BiLSTM neural network model based on the self-attention mechanism provided by the present invention; Figure 8 for Figure 1 A method flow chart of an embodiment of step S102; Fig. 9 for Figure 1 A method flow chart of an embodiment of step S105; Fig.10 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0018] Before showing the embodiments, the following terms are explained: In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0019] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0020] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0021] In order to solve the above problems, Figure 1 As shown, the present invention provides a generative knowledge retrieval method in the field of safety and environmental protection in the steel industry, comprising: S101. Construct a knowledge graph in the field of safety and environmental protection for steel enterprises based on the collected text data in the field of safety and environmental protection in the steel industry.

[0022] Furthermore, text data in the field of safety and environmental protection in the steel industry may include policy documents, guidelines, instructions, steel enterprise management systems, operating manuals, specifications, and internal system data.

[0023] Furthermore, in the process of acquiring data sources, for structured data such as engineering databases and internal system data, data is obtained from the application programming interface by writing programs, and text files are downloaded from the enterprise's file server for use.

[0024] like Figure 2 In a possible implementation, step S101 includes: S201, cleaning the text data.

[0025] Specifically, to ensure the cleanliness of the data, data cleaning mainly includes the following: Data filtering and deduplication: The collected data sources may contain a lot of noise and repeated information, which requires data filtering and deduplication processing. Deduplication rules are established through the key words of the hash table for fast search and deduplication. By traversing the text and updating the hash table, the number of occurrences of each word or phrase can be quickly calculated; Data denoising: Use regular expressions to remove label information from text, and remove irrelevant symbols and stop words in the text, such as symbols, numbers, emoticons, missing values, or blank fields; Word segmentation: Use Jieba word segmentation to segment the denoised data. Use the word segmentation library to segment the Chinese text, such as "centrifuge failure cause", which becomes ("centrifuge", "failure", "cause") after word segmentation.

[0026] S202. Based on the cleaned text data, a knowledge graph construction method combining top-down and bottom-up methods is adopted to construct a knowledge graph in the field of safety and environmental protection of steel enterprises.

[0027] like Figure 3 In a possible implementation, step S202 includes: S301. Based on the cleaned text data, an ontology construction method is used to construct a knowledge ontology model in the field of safety and environmental protection of steel enterprises.

[0028] It should be noted that the knowledge graph ontology model refers to the abstraction, classification and representation of knowledge elements to form a graph so that computers can better understand and utilize this knowledge. This model mainly includes three levels: entities, attributes, and relationships. Entities represent entities with independent meanings, attributes represent the attributes of entities, and relationships represent the relationships between entities. In the knowledge graph, entities, attributes, and relationships are the basic elements for constructing knowledge graphs, and they together constitute the structure and content of the knowledge graph. Attributes are a description of entity characteristics and are an indispensable part of the knowledge graph. They are used to describe the various attributes and characteristics of entities, thereby enriching the expression of entity information and the integrity of knowledge. ‌

[0029] Specifically, the construction of knowledge ontology mainly combines expert experience knowledge, adopts a seven-step ontology construction method for different resource types, and constructs a knowledge ontology model in the field of safety and environmental protection of steel enterprises.

[0030] Furthermore, the ontology construction method adopted may be to use protege ontology editing software to describe and model the safety and environmental information model.

[0031] S302: extract entities from text data using a named entity recognition method.

[0032] like Figure 4 In a possible implementation, step S302 includes: S401, processing text data based on the BIOES sequence annotation method to generate an annotation file.

[0033] Specifically, the safety and environmental protection data of steel enterprises are preprocessed, and the BIOES sequence annotation method is used to generate annotation files. The annotated files are used as data sets, and the data sets are divided into training sets, validation sets, and test sets in a ratio of 8:1:1. Among them, B (begin) means start, E (end) means end, U (unit) means unit, I (inside) means inside, and O (outside) means outside the entity. Figure 5 As shown in the figure, the corpus information such as "the centrifuge rotor has cracks" is used for annotation, where "crack" represents the type of fault (fault type, FT). The corresponding "crack" is annotated as "B-FT" and "pattern" is annotated as "E-FT".

[0034] S402: Train the Bert-BiLSTM-CRF deep learning model based on the annotation file to obtain a fully trained entity recognition model for entity extraction.

[0035] S403: passing the vectorized text data to an entity recognition model for entity extraction.

[0036] Specifically, Figure 6 As shown in the figure, the Bert pre-training model fully considers the relationship characteristics between characters and sentences, and converts the text data in the field of safety and environmental protection of steel enterprises into vector representation, which is convenient for the subsequent sequence layer to learn context features; the vector is passed to the BiLSTM-CRF model for further training, and the trained entity recognition model is used to extract entities in the corpus in the field of safety and environmental protection of steel enterprises.

[0037] S303: extract the relations in the text data using a relation extraction method.

[0038] In a possible implementation, step S303 includes: inputting the vectorized text data into a BiLSTM neural network model based on a self-attention mechanism to extract the relationship between entities.

[0039] Specifically, Figure 7As shown, the Bert embedding layer is used to vectorize the text data to obtain the feature vector of the input data. The vector is input into the BiLSTM model containing the self-attention mechanism. The BiLSTM layer uses a bidirectional neural network model to learn the context information and shallow semantic features in the text sentences in the field of safety and environmental protection of steel enterprises from the input feature vector. The self-attention layer uses the self-attention mechanism to learn the deep global semantic features of the text sentences from the sentence vector output by BiLSTM, thereby mining the relationship between entities in the data in the field of safety and environmental protection of steel enterprises.

[0040] S304. Based on the ontology model, the extracted entities and relationships are stored in the form of a Neo4j graph database to obtain a knowledge graph in the field of safety and environmental protection of steel enterprises.

[0041] In a possible implementation, step S304 includes: The extracted entities and relationships are stored in the Neo4j graph database in the form of "entity-relationship-attribute" triplets to generate a knowledge graph in the field of safety and environmental protection for steel enterprises.

[0042] Specifically, after obtaining the data in the field of safety and environmental protection of steel enterprises: for structured and semi-structured data, the database mapping method is used to store the data in the graph database based on the constructed ontology. Unstructured text information is converted into structured knowledge through processes such as entity recognition and relationship extraction. The knowledge storage stores the extracted knowledge in the form of "entity-relationship-attribute" triples in the Neo4j graph database, thereby generating a knowledge graph in the field of safety and environmental protection of steel enterprises.

[0043] It should be noted that in the above process of constructing the knowledge graph ontology model, it is first necessary to define the concepts (classes) in the field and define attributes for these classes. These attributes are the basis of entities and relationships in the knowledge graph, and they describe the associations and characteristics between classes. Therefore, in this embodiment, when constructing a complete knowledge graph, it is necessary to combine the extracted entities and the relationships between entities with the defined attributes.

[0044] It can be understood that the knowledge graph construction method in the field of safety and environmental protection of steel enterprises provided in this embodiment can quickly realize the construction of knowledge in this field, and provide high-quality, reliable and comprehensive knowledge in the field of safety and environmental protection of steel enterprises for the retrieval application of large natural language processing models.

[0045] S102. Convert the natural search terms input by the user into Cypher search statements based on the natural language processing big model.

[0046] like Figure 8In a possible implementation, step S102 includes: S801. Extract sentence trunks from natural search terms based on the GLM-4 large model and identify search intent.

[0047] Specifically, in combination with the advantages of the natural language processing model in information processing, the present invention adopts the GLM-4 model, combines the scenario processing with the retrieval requirements proposed in natural language, extracts the main information of the retrieval text, and identifies its retrieval intent. The prompt examples shown in Table 1 are used to guide the natural language processing model to accurately extract the main content of the retrieval information.

[0048]

[0049] S802: Setting prompt rules based on a prompt information engineering method.

[0050] S803: Input the extracted sentence trunk of the natural search term and the prompt rules into the GLM-4 large model to generate a Cypher search sentence.

[0051] It should be noted that most traditional graph database search statements are customized based on the question type, and it is difficult to automatically generate Cypher search statements for graph databases. The application scenarios are fixed and the utilization rate is low. The present invention adopts a rule-based and natural language processing large model method to automatically generate Cypher search statements for graph databases. Appropriate prompt rules are designed through prompt word engineering, so that the natural language processing large model refers to the prompt information and combines the main information of the question to automatically generate Cypher search statements. The rule-based prompt method enables the natural language processing large model to have a stronger ability to automatically generate Cypher statements, and there are no grammatical errors in the automatic generation of simple and complex query statements.

[0052] Specifically, the sample prompt rules shown in Table 2 are used to enable the natural language processing model to refer to the prompt information and generate Cypher statements in combination with the extracted main content.

[0053]

[0054] For example, according to the above prompt, the Cypher generated after processing by the natural language processing large model for the question “What are the causes of cracks in centrifuge rotors” is “MATCH (n: centrifuge rotor)-[:association]->(f: fault)-[:association]->(c: Cause)WHERE f.type = 'crack' RETURN DISTINCTc.description”.

[0055] S103. Retrieve corresponding structured knowledge information in the knowledge graph based on the Cypher search statement.

[0056] Specifically, the GLM-4 large model is used to generate Cypher queries, which are executed in the Neo4j graph database to obtain structured knowledge in the field of safety and environmental protection in steel enterprises.

[0057] S104. Design prompt information based on natural search terms.

[0058] S105: Input the prompt information, structured knowledge information and historical search information of the natural language processing big model into the natural language processing big model to generate the final search result.

[0059] like Fig. 9 In a possible implementation, step S105 includes: S901. Inject the historical search information and structured knowledge information into the natural language processing large model for knowledge transformation to obtain input prompts.

[0060] In a possible implementation, step S901 includes: converting structured knowledge information into natural language knowledge information based on a large language model, and adjusting the content of the natural language knowledge information based on historical retrieval information.

[0061] It is understandable that knowledge retrieval usually uses manual input of natural language to interact with the knowledge base. The knowledge obtained through the knowledge graph retrieval in the field of safety and environmental protection of steel enterprises is structured, such as (<bearing damage><fault cause>"closed centrifuge", <rotor loose or damaged><fault cause>"closed centrifuge"), and the knowledge in the natural language processing large model is parameterized knowledge obtained through training. The structured knowledge in the knowledge graph needs to be transformed and further applied in the natural language processing large model. The natural language processing large model has the ability of contextual learning, can memorize historical retrieval information, and retrieve historical related information in combination with demand information, and inject it into the natural language processing large model as retrieval information together with the converted graph knowledge, and further processed by the natural language processing large model to respond to the retrieval requirements submitted by users.

[0062] Specifically, the knowledge and historical information retrieved in step S103 are imported as input into the parameterized knowledge base of the natural language processing large model to respond to the search information submitted by the user.

[0063] It should be noted that knowledge retrieval usually uses artificial input of natural language to interact with the knowledge base. The knowledge retrieved from the knowledge graph in the field of safety and environmental protection of steel enterprises through the Cypher statement generated by the natural language processing large model is structured, such as (<bearing damage><fault cause> "closed centrifuge", <rotor loose or damaged><fault cause> "closed centrifuge"). The knowledge in the natural language processing large model is the knowledge described in the form of natural language obtained through training. In order to enable the natural language processing large model to accurately combine the injected structured information and dynamically generate the required knowledge based on demand, the prompt example shown in Table 3 is used to enable the large language model to accurately respond to the search requirements submitted by the user based on the injected knowledge graph information and historical information in the field of safety and environmental protection of steel enterprises according to the prompt requirements.

[0064]

[0065] Based on the above prompt examples, the structured (<bearing damage><fault cause>"closed centrifuge", <rotor loose or damaged><fault cause>"closed centrifuge") graph information is transformed into natural description knowledge "Closed centrifuges may encounter a variety of faults during operation, two of the more common causes are "bearing damage" and "rotor loose or damaged". These two causes are directly related to the core components of the closed centrifuge."

[0066] S902: Input the prompt information and input prompt into the large language model to generate the final search result.

[0067] Specifically, after training with a large amount of data, the selected natural language processing model has the ability to understand the intention of human instructions by adopting supervised fine-tuning, feedback self-help, human feedback reinforcement learning, etc. In order to ensure that the model can accurately identify the retrieval intention, the required knowledge is accurately generated by combining knowledge.

[0068] Furthermore, the present invention uses prompts to enable the natural language processing big model to generate domain knowledge based on retrieval requirements. The prompt input to the natural language processing big model is "Please refer to the converted {natural description knowledge}" and the output prompt of the natural language processing big model is "Combined with the input information {respond to the user's retrieval requirements}". The content of "{}" is modified according to the retrieval requirements.

[0069] For example, the user's search requirement "{In terms of equipment safety, what are the main causes of failure of closed centrifuges?}" is parsed by the natural language processing big model trunk and generates a Cypher statement generated by the natural language processing big model "MATCH (n:Centrifuge {name: 'Closed centrifuge'})-[r:Fault cause]->() RETURN n.name ASCentrifugeName, r.result AS FaultCause". The knowledge retrieved from the knowledge graph in the field of safety and environmental protection of steel enterprises is structured, such as (<bearing damage><fault cause>"closed centrifuge", <rotor loose or damaged><fault cause>"closed centrifuge"). The input prompt of the natural language processing big model is "Please refer to the converted {closed centrifuges may encounter a variety of faults during operation, two of which are more common causes are "bearing damage" and "rotor loose or damaged". These two causes are directly related to the core components of the closed centrifuge}", and the output prompt of the natural language processing big model is "Combined with the input information {respond to the user's search demand for the cause of the closed centrifuge failure}". Finally, the generative retrieval results of the natural language processing large model are formatted and output in the form of natural language text that is easy for users to understand. The result is "A closed centrifuge may encounter a variety of faults during operation, two of which are common causes: "bearing damage" and "loose or damaged rotors." Bearing damage usually refers to damage to the parts that support the rotation, affecting the normal operation of the machine; a loose or damaged rotor refers to problems with the rotating parts inside the centrifuge, which may cause the machine to become unbalanced or run poorly."

[0070] Compared with the prior art, the present invention provides a generative knowledge retrieval method in the field of safety and environmental protection in the steel industry. By uniformly representing the knowledge in the field of safety and environmental protection in the steel industry, a structured knowledge graph is constructed, which can provide accurate factual information to the natural language processing large model. The information processing and recognition capabilities of the natural language processing large model are utilized to parse the retrieval requirements and retrieve the field factual knowledge. By injecting the knowledge base knowledge and historical information into the natural language processing large model, an accurate response is generated for the contextual information provided by the natural language processing large model. In the face of the hallucination problem of the natural language processing large model, the powerful language understanding and generation capabilities of the natural language processing large model are utilized, combined with the rich knowledge contained in the knowledge graph, to provide more accurate and natural accurate knowledge retrieval content. Compared with the knowledge provided by the traditional knowledge base, the knowledge graph provides a better solution, which can provide more accurate, relevant, diverse, interesting, logical and consistent information to the natural language processing large model, so that they can more reliably generate accurate and true information, thereby effectively solving the technical problem of insufficient retrieval accuracy in the prior art.

[0071] like Fig.10The present invention further provides an electronic device 100, comprising: A memory 1010, used for storing programs; The processor 1020 is coupled to the memory 1010 and is used to execute the program stored in the memory 1010 to implement the steps in the generative knowledge retrieval method in the field of safety and environmental protection in the steel industry as described in any one of the above method items.

[0072] Fig.10 Only some components of the electronic device 100 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0073] In some embodiments, the processor 1020 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes stored in the memory 1010 or process data, such as the generative knowledge retrieval method of the present invention.

[0074] In some embodiments, the processor 1020 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 1020 may be local or remote. In some embodiments, the processor 1020 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0075] In some embodiments, the memory 1010 may be an internal storage unit of the electronic device 100, such as a hard disk or memory of the electronic device 100. In other embodiments, the memory 1010 may also be an external storage device of the electronic device 100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 100.

[0076] Furthermore, the memory 1010 may include both an internal storage unit of the electronic device 100 and an external storage device. The memory 1010 is used to store application software installed in the electronic device 100 and various data.

[0077] In one embodiment, when the processor 1020 executes the generative knowledge retrieval program in the field of safety and environmental protection in the steel industry in the memory 1010, the following steps may be implemented: Construct a knowledge graph in the field of safety and environmental protection for steel enterprises based on the collected text data in the field of safety and environmental protection in the steel industry; Based on the natural language processing model, the natural search terms entered by users are converted into Cypher search statements; Retrieve the corresponding structured knowledge information in the knowledge graph based on Cypher search statements; Design prompt information based on natural search terms; The prompt information, structured knowledge information and historical search information of the natural language processing big model are input into the natural language processing big model to generate the final search result.

[0078] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 100 mentioned, and the electronic device 100 may be a portable device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable devices include but are not limited to portable devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable devices may also be other portable devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 100 may not be a portable device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0079] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the generative knowledge retrieval method described in any one of the above-mentioned method items.

[0080] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer storage medium, wherein the computer storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0081] The above is a detailed introduction to a generative knowledge retrieval method and electronic device in the field of safety and environmental protection in the steel industry provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be modifications in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A generative knowledge retrieval method in the field of safety and environmental protection in the steel industry, characterized in that: include: Construct a knowledge graph in the field of safety and environmental protection for steel enterprises based on the collected text data in the field of safety and environmental protection in the steel industry; Based on the natural language processing model, the natural search terms entered by users are converted into Cypher search statements; Retrieving corresponding structured knowledge information in the knowledge graph based on the Cypher search statement; Designing prompt information based on the natural search term; The prompt information, structured knowledge information and historical search information of the natural language processing large model are input into the natural language processing large model to generate a final search result.

2. The generative knowledge retrieval method according to claim 1, characterized in that: The knowledge graph in the field of safety and environmental protection of steel enterprises is constructed based on the collected text data in the field of safety and environmental protection of the steel industry, including: Clean the text data; Based on the cleaned text data, a knowledge graph construction method combining top-down and bottom-up methods is adopted to construct a knowledge graph in the field of safety and environmental protection of steel enterprises.

3. The generative knowledge retrieval method according to claim 2, characterized in that: Based on the cleaned text data, a knowledge graph construction method combining top-down and bottom-up is used to construct a knowledge graph in the field of safety and environmental protection of steel enterprises, including: Based on the cleaned text data, an ontology construction method is used to construct a knowledge ontology model in the field of safety and environmental protection of steel enterprises; Using a named entity recognition method to extract entities from the text data; Extracting the relations in the text data using a relation extraction method; Based on the ontology model, the extracted entities and relationships are stored in the form of a Neo4j graph database to obtain a knowledge graph in the field of safety and environmental protection of steel enterprises.

4. The generative knowledge retrieval method according to claim 3, characterized in that: The extracting entities from the text data by using a named entity recognition method includes: Processing the text data based on the BIOES sequence annotation method to generate an annotation file; The Bert-BiLSTM-CRF deep learning model is trained based on the annotation file to obtain a fully trained entity recognition model for entity extraction; The vectorized text data is passed to the entity recognition model for entity extraction.

5. The generative knowledge retrieval method according to claim 3, characterized in that: The method of extracting the relationship in the text data by using the relationship extraction method includes: The vectorized text data is input into a BiLSTM neural network model based on a self-attention mechanism to extract the relationship between entities.

6. The generative knowledge retrieval method according to claim 3, characterized in that: Based on the ontology model, the extracted entities and relationships are stored in the form of a Neo4j graph database to obtain a knowledge graph in the field of safety and environmental protection of steel enterprises, including: The extracted entities and relationships are stored in the Neo4j graph database in the form of "entity-relationship-attribute" triplets to generate a knowledge graph in the field of safety and environmental protection for steel enterprises.

7. The generative knowledge retrieval method according to claim 1, characterized in that: The method of converting the natural search terms input by the user into Cypher search statements based on the natural language processing large model includes: Based on the GLM-4 large model, the sentence stems of natural search terms are extracted to identify the search intent; Setting prompt rules based on prompt information engineering methods; The extracted sentence trunk of the natural search term and the prompt rules are input into the GLM-4 large model to generate a Cypher search sentence.

8. The generative knowledge retrieval method according to claim 1, characterized in that: Inputting the prompt information, structured knowledge information and historical search information of the natural language processing big model into the natural language processing big model includes: Injecting the structured knowledge information of the historical search information into the natural language processing large model for knowledge transformation to obtain input prompts; The prompt information and input prompt are input into the large language model to generate the final search result.

9. The generative knowledge retrieval method according to claim 8, characterized in that: The injecting of the historical search information into the structured knowledge information into the natural language processing large model for knowledge conversion includes: The structured knowledge information is converted into natural language knowledge information based on a large language model, and the content of the natural language knowledge information is adjusted based on the historical retrieval information.

10. An electronic device, characterized in that: include: Memory, used to store programs; A processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the generative knowledge retrieval method described in any one of claims 1 to 9.