Question answering method and device for knowledge in security ring field, electronic equipment and storage medium

By building a safety and environmental knowledge graph based on OWL and deep learning models, and combining a large language model, the problem of low knowledge integration and reuse efficiency in the field of safety and environmental protection is solved, the authenticity and accuracy of knowledge are achieved, and a comprehensive field is provided Knowledge system, supporting enterprise decision-making analysis and innovation.

CN119271772APending Publication Date: 2025-01-07WUHAN SURVEYING GEOTECHN RES INST OF MCC +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411235255.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the field of safety and environmental protection, after the existing technology combines large language models with knowledge graphs, it may lack authenticity and accuracy in the face of problems in the professional field, making it difficult to effectively integrate and reuse knowledge.

Method used

The OWL ontology language is used to build a structured standard knowledge description model, combine the deep learning model to obtain knowledge data in the security and environmental field, build a knowledge graph, and use the large language model to analyze the natural language problems entered by users to generate corresponding answers.

Benefits of technology

By structured representation of safety and environment knowledge, we can improve the reuse efficiency and accuracy of knowledge, ensure the authenticity and accuracy of unstructured text data obtained in the safety and environment field, provide a comprehensive field knowledge system, and support enterprise decision-making analysis and Innovation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271772A_ABST
    Figure CN119271772A_ABST
Patent Text Reader

Abstract

The invention relates to a safety ring field knowledge question-answering method and device, electronic equipment and a storage medium, and belongs to the technical field of artificial intelligence and safety production and environmental protection, and the knowledge question-answering method comprises the steps: constructing a structured standard knowledge description model based on an OWL ontology language, and constructing a knowledge graph ontology model; obtaining knowledge data of the security ring field based on the deep learning model; combining the knowledge graph ontology model and the knowledge data to construct a knowledge graph of the security ring field; analyzing a natural language question input by a user based on a large language model to obtain a query language; and generating a corresponding answer based on the large language model, the knowledge graph and the query language. According to the method and the device, the technical problem that the authenticity and the accuracy may be lacked when a large language model and a knowledge graph are combined in the prior art for solving the problem of a professional field is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence, safe production and environmental protection technology, and in particular to a knowledge question-answering method, device, electronic equipment and storage medium in the field of safety and environmental protection. Background Art

[0002] The field of safety and environmental protection involves many types of data, including environmental monitoring data, pollution source information, production safety records, policies and regulations, etc. In view of the low efficiency and accuracy of knowledge reuse caused by the complexity and diversity of knowledge in the field of safety and environmental protection and the changeable user needs, this paper proposes a safety and environmental protection knowledge construction and knowledge question-answering method that integrates a large language model and knowledge graph.

[0003] In recent years, with the continuous advancement of knowledge engineering, more and more companies and organizations are seeking to apply this technology to the field of safety and environmental protection. Faced with massive amounts of safety and environmental protection data, traditional data processing methods are difficult to quickly and accurately extract valuable information. Knowledge graphs can help decision makers quickly find key information and improve decision-making efficiency and accuracy through structured knowledge representation and reasoning capabilities. Through the construction of knowledge graphs, knowledge can be automatically and intelligently reused, improve knowledge reuse efficiency and accuracy, and reduce labor costs. Therefore, the application prospects of knowledge graphs in the field of safety and environmental protection are broad and far-reaching. It can not only enhance the innovation ability and competitiveness of this field, but also bring practical benefits and value to enterprises and society.

[0004] However, with the continuous development and improvement of technology, the construction of knowledge graphs in the field of safety and environmental protection also faces some challenges. Due to the professionalism and complexity of this field, it is necessary to explore the automatic construction method of knowledge graphs in the field of safety and environmental protection based on the characteristics of the enterprise itself and its accumulated data and knowledge, to realize the automatic construction and intelligent application of knowledge graphs in the field of safety and environmental protection, and to provide strong support for the sustainable development and innovation in the field of safety and environmental protection. In recent years, large language models (LLMs) have shown remarkable results in a variety of natural language processing tasks. Such models have a large parameter scale and complex network structure, and can effectively process and understand natural language tasks. However, when faced with problems in professional fields, the generated results of large language models may lack authenticity and accuracy. Summary of the invention

[0005] In view of this, it is necessary to provide a knowledge question-answering method, device, electronic device and storage medium in the field of safety and environmental protection, so as to solve the technical problem that the existing technology may lack authenticity and accuracy when facing professional field problems after combining a large language model with a knowledge graph.

[0006] In order to solve the above problems, the present invention provides a knowledge question-answering method in the field of safety and environmental protection, comprising: Construct a structured standard knowledge description model based on the OWL ontology language to build a knowledge graph ontology model; Acquire knowledge data in the field of safety and environmental protection based on deep learning models; Combining the knowledge graph ontology model and knowledge data to construct a knowledge graph in the field of safety and environmental protection; Parse the natural language questions input by the user based on the large language model to obtain the query language; Generate a corresponding answer based on the large language model, the knowledge graph, and the query.

[0007] In a possible implementation, constructing a knowledge graph ontology model based on the OWL ontology language by constructing a structured standard knowledge description model includes: Determine the professional field and scope of the knowledge graph; Determine the terms and concepts in the field of safety and environmental protection based on the professional fields and scope; Based on the OWL ontology language to build a structured standard knowledge description model, the classes and their hierarchical structures in the ontology model are defined according to the term list; The classes and their hierarchical structures in the ontology model are defined, including: Defining attributes of a class, wherein the attributes include data attributes and object attributes; Define the relationships between classes.

[0008] In a possible implementation, the step of acquiring knowledge data in the field of safety and environmental protection based on a deep learning model includes: Preprocess the safety and environmental protection text data including standards, specifications, experimental reports and literature reports in the field of safety and environmental protection; Extract entities and relationships between entities from the preprocessed safety and environmental protection text data; Construct entity recognition models and relationship recognition models based on entities and relationships between entities; Triples are extracted based on the entity recognition model and the relationship recognition model, and the extracted knowledge data is stored in the Neo4j graph database.

[0009] In a possible implementation, the preprocessing of the safety and environmental protection text data includes: The unstructured text data is cleaned and the preprocessed safety and environmental protection text data is saved in the form of a txt file.

[0010] In a possible implementation, extracting entities and relationships between entities from the preprocessed safety and environmental protection text data includes: Define entity types in safety and environmental protection text data; According to the entity type, annotating the entities in the safety and environmental protection text data based on the Brat tool; Perform entity recognition on the labeled results based on the ALBERT-BiLSTM-CRF model; Relation extraction is performed on the results of entity recognition based on the ALBERT-BiLSTM model.

[0011] Among them, relationships include inclusion relationships, association relationships, dependency relationships, and influence relationships.

[0012] In a possible implementation, the parsing of the natural language question input by the user based on the large language model to obtain the query language includes: Extract and parse the sentence stem of natural language questions based on the large language model, and output the parsed result of the original question; Convert the parsing result into a Cypher statement to obtain the query language.

[0013] In a possible implementation, generating a corresponding answer based on the large language model, the knowledge graph, and the query includes: Retrieving safety and environmental protection knowledge corresponding to the query in the knowledge graph; Inputting the safety and environmental protection knowledge into the large language model together with the query language in a prompting manner; Generate answers by reasoning based on a large language model.

[0014] The present invention also provides a knowledge question-answering device in the field of safety and environmental protection, comprising: Ontology model building module, used to build a structured standard knowledge description model based on OWL ontology language to build a knowledge graph ontology model; Knowledge data acquisition module, used to acquire knowledge data in the field of safety and environmental protection based on deep learning models; A knowledge graph construction module, used to construct a knowledge graph in the field of safety and environmental protection by combining the ontology model and knowledge data; A query language conversion module is used to analyze the natural language questions input by the user in text form based on the large language model to obtain the query language; The answer query module is used to generate corresponding answers based on the large language model, knowledge graph and query language.

[0015] The present invention also provides an electronic device, comprising: Memory, used to store programs; A processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the safety and environmental protection field knowledge question and answer method described in any one of the above method items.

[0016] 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 safety and environmental protection field knowledge question and answer method described in any one of the above-mentioned method items.

[0017] The beneficial effects of the present invention are as follows: the present invention provides a knowledge question-answering method in the field of safety and environmental protection. First, the present invention utilizes the knowledge graph-related technology to represent the knowledge in the field of safety and environmental protection in a structured manner. At the same time, the large language model has the ability to understand and generate natural language. The fusion of the two enables the knowledge in the field of safety and environmental protection to be effectively integrated to form a comprehensive field knowledge system, thereby realizing the extensive sharing and application of knowledge. Secondly, the source of the unstructured text data in the field of safety and environmental protection obtained by the present invention is authentic and reliable, and the deep learning model has the ability to automatically learn feature representations from large-scale data. Through training, the deep learning model can learn the complex patterns and associations in the unstructured data in the field of safety and environmental protection, thereby improving the authenticity and accuracy of the extracted knowledge, thereby effectively solving the technical problem that the existing technology may lack authenticity and accuracy when facing problems in professional fields after combining the large language model with the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A method flow chart of an embodiment of a safety and environmental protection knowledge question and answer method provided by the present invention; Figure 2 for Figure 1 A method flow chart of step S101 in an embodiment; Figure 3 for Figure 1 A method flow chart of an embodiment of step S102; 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 ALBERT-BiLSTM-CRF model provided by the present invention; Figure 7 for Figure 1 A method flow chart of an embodiment of step S104; Figure 8 for Figure 1 A method flow chart of an embodiment of step S105; Fig. 9 A schematic diagram of the structure of an embodiment of a knowledge question-answering device in the field of safety and environmental protection provided by the present invention; Fig.10 A schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] 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.

[0020] 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.

[0021] 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.

[0022] 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.

[0023] In order to solve the above problems, Figure 1 As shown, the present invention provides a knowledge question-answering method in the field of safety and environmental protection, comprising: S101. Construct a structured standard knowledge description model based on OWL ontology language to construct a knowledge graph ontology model; Specifically, we collect and organize relevant safety and environmental protection data and information, including enterprise databases, industry standards, policies and regulations, research reports, expert experience, etc. We screen and organize the collected knowledge to ensure the accuracy and authority of the information.

[0024] S102. Acquire knowledge data in the field of safety and environmental protection based on deep learning models; It should be noted that the deep learning model can be a BiLSTM-CRF deep learning model. When using these deep learning models, the ALBERT pre-trained model is used to obtain text word embedding, complete the vectorized representation of the input data, pass the word vector to the BiLSTM-CRF deep learning model for training, and use the trained model to extract entities in the corpus to obtain knowledge data in the field of safety and environmental protection.

[0025] S103. Combine the ontology model and knowledge data to build a knowledge graph in the field of safety and environmental protection; S104, parsing the natural language question input by the user based on the large language model to obtain a query language; It should be noted that the large language model can be the chatGPT large language model.

[0026] S105. Generate corresponding answers based on the large language model, knowledge graph and query language.

[0027] Compared with the prior art, the present invention provides a knowledge question-answering method in the field of safety and environmental protection. First, the present invention utilizes the knowledge graph-related technology to represent the knowledge in the field of safety and environmental protection in a structured manner. At the same time, the large language model has the ability to understand and generate natural language. The fusion of the two enables the knowledge in the field of safety and environmental protection to be effectively integrated to form a comprehensive field knowledge system, thereby realizing the extensive sharing and application of knowledge. Secondly, the source of the unstructured text data in the field of safety and environmental protection obtained by the present invention is authentic and reliable, and the deep learning model has the ability to automatically learn feature representations from large-scale data. Through training, the deep learning model can learn the complex patterns and associations in the unstructured data in the field of safety and environmental protection, thereby improving the authenticity and accuracy of the extracted knowledge, thereby effectively solving the technical problem that the prior art may lack authenticity and accuracy in the face of professional field problems after combining the large language model with the knowledge graph. In addition, the construction of a knowledge base in the field of safety and environmental protection that integrates the knowledge graph and the large language model can provide enterprises with accurate and comprehensive decision support information. Enterprises can conduct fast and accurate decision analysis based on this information, reduce decision risks, and improve decision efficiency and quality. As an effective knowledge management tool, the knowledge graph can help enterprises integrate and manage safety and environmental protection knowledge resources scattered everywhere. The large language model can support natural language generation, so that the information in the knowledge graph can be presented to corporate employees in a more understandable way, promoting the dissemination and innovation of knowledge.

[0028] like Figure 2 In a possible implementation, step S101 includes: S201. Determine the professional field and scope of the knowledge graph; S202. Determine the terms and concepts in the field of safety and environmental protection based on the preset professional fields and categories; S203, based on the OWL ontology language to construct a structured standard knowledge description model, define the classes and their hierarchical structures in the ontology model according to the term list; S204, define the attributes of the class; Among them, attributes include data attributes and object attributes; S205. Define the relationship between classes.

[0029] Specifically, the pattern layer design of the ontology model is designed based on the experience of domain experts. The ontology construction in the field of safety and environmental protection adopts an automatic downward ontology construction method, which is adjusted in combination with the specific characteristics of the field. First, determine the professional field and scope, and clarify the goals and scope of ontology construction (such as air quality monitoring, water pollution control, solid waste treatment, etc.). Investigate whether there are ready-made ontologies applicable to the field of safety and environmental protection for reuse or reference. Collect key terms and concepts in the field of safety and environmental protection, such as "air quality", "water pollution", "solid waste", etc. Define classes and class hierarchies, and define the classes and their hierarchies in the ontology based on the term list. Define the attributes of the class, and define relevant attributes for each class, including data attributes and object attributes. For example, the attributes of the "gas pollutant" class include data attributes such as "concentration" and "composition". Define the relationship between classes, and clarify the relationship between classes, such as inheritance relationship, part-whole relationship, etc. For example, "industrial waste gas" is a subclass of "gas pollutants", and there is an inheritance relationship between them.

[0030] like Figure 3 In a possible implementation, step S102 includes: S301. Preprocess the safety and environmental protection text data including standards and specifications, experimental reports and literature reports in the field of safety and environmental protection.

[0031] Specifically, the safety and environmental protection text data is preprocessed, including: data cleaning of unstructured text data, and saving the preprocessed safety and environmental protection text data in the form of a txt file.

[0032] S302, extracting entities and relationships between entities from the preprocessed safety and environmental protection text data; S303, constructing an entity recognition model and a relationship recognition model based on entities and relationships between entities; S304: Extract triples based on the entity recognition model and the relationship recognition model, and store the extracted knowledge data in the Neo4j graph database.

[0033] It should be noted that the present invention is mainly aimed at the acquisition of knowledge from text unstructured data, which comes from standards, experimental reports, literature reports, etc. The knowledge expression is complex and diverse, and knowledge extraction is required from the text. Data preprocessing is performed on the unstructured data of the safety and environmental protection text. The safety and environmental protection text contains a large amount of unstructured data, which needs to be cleaned and the processed text is saved in the form of a txt file.

[0034] It is understandable that Neo4j, as a high-performance NOSQL graph database, is unique in that it uses graph structures to store, retrieve and manage data. It also supports the execution of complex query and analysis tasks. The following are several significant advantages of Neo4j: 1. Intuitive relationship representation: Neo4j uses nodes and edges to represent entities and their relationships respectively. This approach makes even complex relationship networks easy to understand and query.

[0035] 2 High performance: Thanks to the use of native graph storage and retrieval technology, Neo4j performs well in processing large amounts of data and can support real-time analysis to meet users' needs for high performance.

[0036] 3. Flexible query capabilities: Neo4j's original Cypher query language allows users to write and execute complex graph queries in a very intuitive and flexible way, greatly improving the convenience of data retrieval.

[0037] 4. Scalability: Neo4j supports distributed deployment and horizontal expansion, which means it can easily cope with the processing needs of large-scale knowledge bases, providing users with great flexibility and expansion space.

[0038] like Figure 4 In a possible implementation, step S302 includes: S401, defining entity types in safety and environmental protection text data; S402: Label entities in the safety and environmental protection text data according to entity types based on the Brat tool.

[0039] Specifically, brat is used to manually annotate the safety and environmental protection text, and the BIO annotation method is used to annotate the safety and environmental protection text data. The first character of the named entity is represented by "B", the last character is represented by "I", and the non-named entity is represented by "O". The label name corresponds to the safety and environmental protection domain ontology; the entity relationship annotation uses the predefined concept relationship, and the annotated text is converted into txt format. Figure 5 For example, "In order to reduce heavy metal pollution in industrial wastewater, a chemical plant has adopted an advanced wastewater treatment system that can effectively remove heavy metal elements such as lead and mercury in wastewater, ensuring that the discharged wastewater meets national environmental protection standards."

[0040] The entity annotation process is as follows: 1) Define entity types. Including "pollutants" (such as heavy metals, chemicals, etc.), "environmental protection measures" (such as wastewater treatment systems, air purification devices, etc.), "standards" (such as national environmental protection standards, safety regulations, etc.); 2) Use brat to annotate entities. Use the Brat tool to open the annotation interface and paste or import the above text into the annotation area. According to the defined entity type, annotate the corresponding entities in the text one by one. "Heavy metal pollution" is annotated as a "pollutant" type. "Wastewater treatment system" is annotated as an "environmental protection measure" type. "Lead and mercury" as specific heavy metal elements are further annotated as subtypes or separate types of "pollutants", and "national environmental protection standards" are annotated as "standards" type. After completing the annotation, save the annotation results. Brat usually saves the annotation information in a specific format for subsequent processing and analysis.

[0041] S403. Perform entity recognition on the labeled results based on the ALBERT-BiLSTM-CRF model.

[0042] It should be noted that the first layer of the ALBERT-BiLSTM-CRF model is the ALBERT encoding layer. This model is a lightweight pre-trained language model based on the BERT model. Compared with the traditional BERT model, the ALBERT training volume is greatly reduced, the running speed is relatively improved, and it performs well in many natural language processing tasks. This layer converts the text word sequence into a word vector sequence, and uses the vector to represent the word entities in the sentence and the relationship between the entities. The ALBERT layer includes the Transformer shared full connection layer and the Attention layer, which share all the parameters in the hidden layer, greatly reducing the number of parameters, and can effectively improve the training efficiency.

[0043] The second layer is the bidirectional neural network BILSTM layer. The input of BiLSTM is the word vector output by the ALBERT encoding layer. BiLSTM is composed of two LSTMs, positive and negative, which can receive the forward and reverse feature inputs of the sentence to obtain complete context information. The input of BiLSTM is the word vector output by the ALBERT encoding layer. The BILSTM layer can automatically extract the features of the sentence and obtain more comprehensive semantic information by capturing the character information and order information of the text sequence.

[0044] The fourth layer is the conditional random field (CRF) layer. CRF is a discriminative undirected graph model. During the training process, the model parameters are learned using maximum likelihood estimation, and the Viterbi algorithm is used to further decode the label sequence with the largest probability model. This method uses batch-based gradient descent to optimize hyperparameters, uses the Adam optimizer, sets the learning rate to 0.002, and sets the number of hidden nodes in the LSTM forward and backward propagation to 200. The specific implementation principle is as follows: Figure 6 shown.

[0045] S404. Perform relationship extraction on the results of entity recognition based on the ALBERT-BiLSTM model.

[0046] Among them, relationships include inclusion relationships, association relationships, dependency relationships, and influence relationships.

[0047] Specifically, the first layer of the ALBERT-BiLSTM model is the ALBERT encoding layer, which embeds the safety and environmental protection text data at the word vector level.

[0048] The second layer is a bidirectional neural network BILSTM layer, which performs forward and reverse encoding on the safety and environmental statements.

[0049] The third layer is the output layer, which outputs the relationship type of safety and environmental entities through the joint action of the BILSTM neural network and the Softmax activation function.

[0050] like Figure 7 In a possible implementation, step S104 includes: S701, extracting and parsing the sentence trunk of the natural language question based on the large language model, and outputting the parsing result of the original question; S702: Convert the parsing result into a Cypher statement to obtain a query.

[0051] It should be noted that, in this embodiment, the large language model cannot obtain more accurate results for natural language processing in vertical fields. It is necessary to use domain data sets to allow the model to further learn and perform model fine-tuning to solve natural language processing problems in professional fields.

[0052] Use a fine-tuned large language model to extract the main sentence of natural questions, take the natural language question as input, and output the parsing result of the original question. For example, when the question "What are the commonly used desulfurization and denitrification technologies in industrial waste gas treatment?" is input into the model, the corresponding parsing result is "["pollutant": industrial waste gas]-(treatment method)-["desulfurization and denitrification technology / measures": Entity]".

[0053] Then, the question parsing results are converted into Cypher statements using a rule-based statement conversion method.

[0054] like Figure 8 In a possible implementation, step S105 includes: S801, searching the safety and environmental protection knowledge corresponding to the query in the knowledge graph; S802, inputting safety and environmental protection knowledge into the large language model together with the query language in the form of prompts; S803: Generate answers through reasoning based on the large language model.

[0055] It should be noted that the present invention adopts an innovative method to combine the safety and environmental protection knowledge graph with the large language model to generate answers with professional knowledge. The core of the present invention is to use the constructed safety and environmental protection field knowledge graph to retrieve professional knowledge closely related to the question. Subsequently, these professional knowledge are input into the large language model together with the question in the form of prompts, so as to obtain a comprehensive and accurate answer. The input text format is "In <field>, please refer to the following data: <professional knowledge>, answer the question: <question>." The content in "<>" is modifiable content. For example: "In the field of safety and environmental protection, answer the question: What are the commonly used desulfurization and denitrification technologies in industrial waste gas treatment? Please refer to the following data: wet desulfurization and denitrification technology: limestone-gypsum method, seawater desulfurization method, double alkali method, lemon absorption method; dry desulfurization and denitrification technology: activated carbon adsorption method, electron beam radiation method, metal oxide desulfurization method; denitrification technology: selective catalytic reduction method, selective non-catalytic reduction method". The large language model used in the present invention can be the chatGPT large language model, and the specific implementation is not limited to this model.

[0056] like Fig. 9 The present invention also provides a safety and environmental protection knowledge question-answering device 90, comprising: An ontology model construction module 910 is used to construct a structured standard knowledge description model based on the OWL ontology language to construct a knowledge graph ontology model; The knowledge data acquisition module 920 is used to acquire knowledge data in the field of safety and environmental protection based on the deep learning model; The knowledge graph construction module 930 is used to construct a knowledge graph in the field of safety and environmental protection by combining the ontology model and knowledge data; A query language conversion module 940 is used to analyze the natural language question input by the user in text form based on the large language model to obtain a query language; The answer query module 950 is used to generate corresponding answers based on the large language model, knowledge graph and query language.

[0057] like Fig.10 The 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 safety and environmental protection field knowledge question and answer method described in any one of the above method items, or the steps in the safety and environmental protection field knowledge question and answer method.

[0058] 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.

[0059] 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 or process data stored in the memory 1010, such as the safety and environmental protection knowledge question and answer method of the present invention.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] In one embodiment, when the processor 1020 executes the safety and environmental protection knowledge question answering program in the memory 1010, the following steps may be implemented: Construct a structured standard knowledge description model based on the OWL ontology language to build a knowledge graph ontology model; Acquire knowledge data in the field of safety and environmental protection based on deep learning models; Combine ontology model and knowledge data to build knowledge graph in the field of safety and environmental protection; Parse the natural language questions input by the user based on the large language model to obtain the query language; Generate corresponding answers based on large language models, knowledge graphs, and query language.

[0064] 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).

[0065] 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 safety and environmental protection field knowledge question and answer method described in any one of the above-mentioned method items.

[0066] 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.

[0067] The above is a detailed introduction to a knowledge graph construction method, device and electronic device 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 knowledge question-answering method in the field of safety and environmental protection, characterized in that: include: Construct a structured standard knowledge description model based on the OWL ontology language to build a knowledge graph ontology model; Acquire knowledge data in the field of safety and environmental protection based on deep learning models; Combining the knowledge graph ontology model and knowledge data to construct a knowledge graph in the field of safety and environmental protection; Parse the natural language questions input by the user based on the large language model to obtain the query language; Generate a corresponding answer based on the large language model, the knowledge graph, and the query.

2. The safety and environmental protection knowledge question-answering method according to claim 1 is characterized in that: The method of constructing a structured standard knowledge description model based on the OWL ontology language to construct a knowledge graph ontology model includes: Determine the professional field and scope of the knowledge graph; Determine the terms and concepts in the field of safety and environmental protection based on the professional fields and scope; Based on the OWL ontology language to build a structured standard knowledge description model, the classes and their hierarchical structures in the ontology model are defined according to the term list; The classes and their hierarchical structures in the ontology model are defined, including: Defining attributes of a class, wherein the attributes include data attributes and object attributes; Define the relationships between classes.

3. The safety and environmental protection knowledge question-answering method according to claim 1 is characterized in that: The acquisition of knowledge data in the field of safety and environmental protection based on the deep learning model includes: Preprocess the safety and environmental protection text data including standards, specifications, experimental reports and literature reports in the field of safety and environmental protection; Extract entities and relationships between entities from the preprocessed safety and environmental protection text data; Construct entity recognition models and relationship recognition models based on entities and relationships between entities; Triples are extracted based on the entity recognition model and the relationship recognition model, and the extracted knowledge data is stored in the Neo4j graph database.

4. The safety and environmental protection knowledge question-answering method according to claim 3 is characterized in that: The preprocessing of the safety and environmental protection text data includes: The safety and environmental protection text data is cleaned and the pre-processed safety and environmental protection text data is saved in the form of a txt file.

5. The safety and environmental protection knowledge question-answering method according to claim 3 is characterized in that: The entities and the relationships between the entities are extracted from the preprocessed safety and environmental protection text data, including: Define entity types in safety and environmental protection text data; According to the entity type, annotating the entities in the safety and environmental protection text data based on the Brat tool; Perform entity recognition on the labeled results based on the ALBERT-BiLSTM-CRF model; Relationship extraction is performed on the results of entity recognition based on the ALBERT-BiLSTM model, where the relationships include inclusion relationships, association relationships, dependency relationships, and influence relationships.

6. The safety and environmental protection knowledge question-answering method according to claim 1, characterized in that: The natural language question input by the user is parsed based on the large language model to obtain the query language, including: Extract and parse the sentence stem of natural language questions based on the large language model, and output the parsed result of the original question; Convert the parsing result into a Cypher statement to obtain the query language.

7. The safety and environmental protection knowledge question-answering method according to claim 6, characterized in that: The generating a corresponding answer based on the large language model, the knowledge graph and the query language includes: Retrieving safety and environmental protection knowledge corresponding to the query in the knowledge graph; Inputting the safety and environmental protection knowledge into the large language model together with the query language in a prompting manner; Generate answers by reasoning based on a large language model.

8. A knowledge question-answering device in the field of safety and environmental protection, characterized in that: include: Ontology model building module, used to build a structured standard knowledge description model based on OWL ontology language to build a knowledge graph ontology model; Knowledge data acquisition module, used to acquire knowledge data in the field of safety and environmental protection based on deep learning models; A knowledge graph construction module, used to construct a knowledge graph in the field of safety and environmental protection by combining the ontology model and knowledge data; A query language conversion module is used to analyze the natural language questions input by the user in text form based on the large language model to obtain the query language; The answer query module is used to generate corresponding answers based on the large language model, knowledge graph and query language.

9. An electronic device, characterized in that: include: Memory, used to store programs; A processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the safety and environmental protection field knowledge question and answer method described in any one of claims 1 to 7.

10. A storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the safety and environmental protection knowledge question and answer method described in any one of claims 1 to 7 above.

Citation Information

Cited By

  • Private knowledge model knowledge generation method and device, equipment and medium

    CN119476447A

  • A method, device, equipment and medium for generating private knowledge model knowledge

    CN119476447B