Security ring field knowledge graph construction and knowledge question answering method and device and electronic equipment
Through the pre-trained large language model, analyzing environmental monitoring and safety monitoring data is constructed, and the knowledge graph is solved, which solves the needs of professionalism and application scenarios in the safety and environment field, and realizes efficient knowledge integration and accurate answers in the field of environmental protection and safety.
Patent Information
- Application Number
- CN202411184846.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-01-10
AI Technical Summary
The existing technology cannot meet the targeted requirements of professionalism and application scenarios in the field of safety and environmental protection, and cannot effectively utilize the application potential of large language models in the field of environmental protection and safety, resulting in low efficiency and error-prone environmental protection and safety monitoring.
A pre-trained large language model is used to analyze environmental monitoring data and security monitoring data, extract entities, concepts and relationships in unstructured text data, build a knowledge graph, and organize and classify them through preset category standards to generate Knowledge graphs for general knowledge categories and professionally customized knowledge categories are used to answer users' natural language questions.
Through the text processing capabilities of large language models, we automatically extract knowledge in the fields of environmental protection and safety, provide a more comprehensive perspective and solution, effectively identify general knowledge and professional customized knowledge, meet the professional and application scenario needs of the safety and environmental field, and improve the needs of the professionalism and application scenarios of the safety and environmental field, The efficiency and accuracy of environmental protection and safety monitoring are achieved.
Smart Images

Figure CN119294509A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer large language models, and in particular to knowledge graph construction and knowledge question-answering methods, devices and electronic equipment in the field of safety and environmental protection. Background Art
[0002] Traditional environmental protection and safety monitoring methods rely on manual analysis, which is inefficient and prone to errors. The emergence of large language models has made it possible to automate text analysis, but existing technologies have not yet fully utilized the application potential of LLM in the field of environmental protection and safety.
[0003] Large language models are an important technology in the field of natural language processing, and have made significant progress in many aspects in recent years. The environmental protection field faces challenges such as climate change and biodiversity loss, and needs to integrate knowledge and information scattered in different data sources. Large language models can understand and generate human language, while knowledge graphs convert text data into structured knowledge for easy query and reasoning. Large language models can continuously improve their capabilities through autonomous learning and self-improvement. They can process natural language, compose music, generate images, etc.
[0004] The application of large language models in the field of safety and environmental protection can understand the natural language of users in a targeted manner and provide corresponding answers and knowledge graphs. However, since the field of safety and environmental protection has certain professionalism and targeted application scenarios, the implementation graph structure given by conventional large language models tends to be general knowledge answers, which obviously cannot meet the requirements of the field of safety and environmental protection. Summary of the invention
[0005] In view of this, it is necessary to provide a method, device and electronic equipment for constructing a knowledge graph and answering knowledge in the field of safety and environmental protection, so as to solve the technical problem that the existing technology cannot meet the requirements of professionalism and targeted application scenarios in the field of safety and environmental protection.
[0006] In order to solve the above problems, the present invention provides a method for constructing a knowledge graph in the field of safety and environmental protection, comprising: Analyze environmental monitoring data and safety monitoring data based on a pre-trained large language model to obtain unstructured text data including environmental monitoring reports and safety risk assessments; Extract entities, concepts, and relationships from unstructured text data based on a large language model, and initially build a knowledge system; The knowledge system is organized and classified based on preset category standards and large language models to obtain a knowledge graph of general knowledge categories and professional customized knowledge categories.
[0007] In a possible implementation, the environmental monitoring data is derived from a message from an environmental monitoring station and / or a user text input, and the security monitoring data is derived from a message from a security monitoring device and / or a user text input.
[0008] In a possible implementation, before analyzing the environmental monitoring data and the security monitoring data based on the pre-trained large language model, the following steps are also included: The environmental monitoring data and the safety monitoring data are preprocessed.
[0009] In a possible implementation, the preprocessing of the environmental monitoring data and the security monitoring data includes: The environmental monitoring data and security monitoring data are cleaned, formatted and encoded.
[0010] In a possible implementation, the categories of the knowledge graph also include: A knowledge graph of routing jump categories that displays text content in the knowledge system in the form of subject content pages.
[0011] The present invention also provides a knowledge question-answering method in the field of safety and environmental protection, comprising: The natural language question input by the user in text form is analyzed based on the large language model to obtain a query language, wherein the categories of the query language include: a general knowledge category and a query data category.
[0012] Obtaining answers from the knowledge graph based on the query, and conveying the answers to the user in the form of page display; Among them, the knowledge graph is obtained according to the safety and environmental protection field knowledge graph construction method as described in any one of the above method items.
[0013] In a possible implementation, obtaining an answer from a knowledge graph based on a query includes: Determining whether the category of the query is a general knowledge category; If so, directly calling the content corresponding to the query from the knowledge graph of the general knowledge category based on the large language model as the answer output; If not, determining whether the category of the query is a query data category; If yes, then generate an SQL statement based on the large language model, and query the knowledge graph of the professional customized knowledge category for content corresponding to the query as an answer output according to the SQL statement; If not, a route is generated, and according to the route, the content corresponding to the query is searched from the knowledge graph of the route jump category and output as the answer.
[0014] The present invention also provides a knowledge question-answering device in the field of safety and environmental protection, comprising: 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; An answer query module, used to obtain an answer from the knowledge graph based on the query language; An answer display module is used to convey the answer to the user in the form of a page display; Among them, the knowledge graph is obtained according to the safety and environmental protection field knowledge graph construction method described in any one of the above method items.
[0015] In a possible implementation, the answer query module further includes: A query recognition module, used to determine whether the category of the query is a general knowledge category, and to determine whether the category of the query is a query data category; Route generation module, used to generate routes.
[0016] 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 method for constructing a knowledge graph in the field of safety and environmental protection described in any one of the above-mentioned method items, as well as the steps in the method for answering knowledge in the field of safety and environmental protection.
[0017] The beneficial effects of the present invention are as follows: the present invention provides a knowledge graph construction in the field of safety and environmental protection. First, through the text processing capabilities of a large language model, entities, relationships and concepts are automatically extracted from unstructured text data, thereby constructing or enriching a knowledge graph in the field of environmental protection. A large language model combined with a knowledge graph can integrate knowledge in the fields of environmental protection and safety, providing a more comprehensive perspective and solution. Finally, by dividing the types of knowledge graphs and using a large language model to classify knowledge, general knowledge and professional customized knowledge can be identified, and targeted answers can be given, thereby effectively solving the technical problem that the existing technology cannot meet the requirements of professionalism and targeted application scenarios in the field of safety and environmental protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A method flow chart of an embodiment of a method for constructing a knowledge graph in the field of safety and environmental protection provided by the present invention; Figure 2 A method flow chart of an embodiment of the safety and environmental protection knowledge question and answer method provided by the present invention Figure 3 for Figure 2 A method flow chart of an embodiment of step S202; Figure 4A method flow chart of an embodiment of a safety and environmental protection knowledge question and answer device provided by the present invention; Figure 5 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 graph construction in the field of safety and environmental protection, including: S101. Analyze environmental monitoring data and safety monitoring data based on a pre-trained large language model to obtain unstructured text data including environmental monitoring reports and safety risk assessments; In a possible implementation, the environmental monitoring data is derived from messages from an environmental monitoring station and / or user text input, and the security monitoring data is derived from messages from a security monitoring device and / or user text input.
[0024] Specifically, environmental monitoring data and safety monitoring data can be collected in real time through manual input or direct access to data sources.
[0025] It should be noted that before starting the method steps provided by the present invention, a large language model can be pre-trained using large-scale text data to enable it to understand and analyze texts related to environmental protection and safety.
[0026] S102. Extract entities, concepts and relationships from unstructured text data based on a large language model and initially build a knowledge system; S103. Sort and classify the knowledge system based on preset category standards and a large language model to obtain a knowledge graph of general knowledge categories and professional customized knowledge categories.
[0027] In a possible implementation, the categories of knowledge graphs also include: A knowledge graph of routing jump categories that displays text content in the knowledge system in the form of subject content pages.
[0028] Compared with the prior art, the present invention provides a knowledge graph construction in the field of safety and environmental protection. First, through the text processing capabilities of a large language model, entities, relationships and concepts are automatically extracted from unstructured text data, and then the knowledge graph in the field of environmental protection is constructed or enriched. The large language model combined with the knowledge graph can integrate the knowledge in the fields of environmental protection and safety, and provide a more comprehensive perspective and solution. Finally, by dividing the types of knowledge graphs and using a large language model to classify the knowledge, general knowledge and professional customized knowledge can be identified, and targeted answers can be given, thereby effectively solving the technical problem that the existing technology cannot meet the requirements of professionalism and application scenario targeting in the field of safety and environmental protection.
[0029] In a possible implementation, before step S101, the following steps are further included: Preprocess environmental monitoring data and security monitoring data.
[0030] Furthermore, preprocessing includes: cleaning, formatting and encoding the environmental monitoring data and security monitoring data.
[0031] like Figure 2 The present invention also provides a knowledge question-answering method in the field of safety and environmental protection, comprising: S201, analyzing the natural language question input by the user in text form based on the large language model to obtain a query language; Specifically, the categories of query language include: general knowledge category and query data category.
[0032] S202, obtaining answers from the knowledge graph based on the query, and conveying the answers to the user in the form of page display; Among them, the knowledge graph is obtained according to the safety and environmental protection field knowledge graph construction method as described in any one of the above method items.
[0033] like Figure 3 In a possible implementation, step S202 includes: S301, determining whether the category of the query is a general knowledge category; S302: If yes, directly call the content corresponding to the query from the knowledge graph of the general knowledge category based on the large language model as the answer output; S303: If not, determine whether the category of the query is the query data category; S304: If yes, generate an SQL statement based on the large language model, and query the knowledge graph of the professional customized knowledge category for content corresponding to the query as an answer output according to the SQL statement; S305. If not, generate a route, and query the content corresponding to the query from the knowledge graph of the route jump category according to the route and output it as the answer.
[0034] like Figure 4 The present invention also provides a safety and environmental protection knowledge question-answering device 40, comprising: A query language conversion module 410 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; An answer query module 420 is used to obtain an answer from the knowledge graph based on the query language; The answer display module 430 is used to convey the answer to the user in the form of a page display; Among them, the knowledge graph is obtained according to the safety and environmental protection field knowledge graph construction method described in any one of the above method items.
[0035] In a possible implementation, the answer query module 420 further includes: A query recognition module 4201 is used to determine whether the category of the query is a general knowledge category, and to determine whether the category of the query is a query data category; The route generation module 4202 is used to generate routes.
[0036] like Figure 5 The present invention further provides an electronic device 50, comprising: A memory 510, used for storing programs; The processor 520 is coupled to the memory 510 and is used to execute the program stored in the memory 510 to implement the method for constructing a knowledge graph in the field of safety and environmental protection described in any of the above method items, or the steps in the method for answering knowledge in the field of safety and environmental protection.
[0037] Figure 5Only some of the components of the electronic device 50 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.
[0038] In some embodiments, the processor 520 can be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code stored in the memory 510 or process data, such as the safety and environmental protection field knowledge graph construction method or the safety and environmental protection field knowledge question and answer method in the present invention.
[0039] In some embodiments, the processor 520 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 520 may be local or remote. In some embodiments, the processor 520 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.
[0040] In some embodiments, the memory 510 may be an internal storage unit of the electronic device 50, such as a hard disk or memory of the electronic device 50. In other embodiments, the memory 510 may also be an external storage device of the electronic device 50, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 50.
[0041] Furthermore, the memory 510 may include both an internal storage unit of the electronic device 50 and an external storage device. The memory 510 is used to store application software installed in the electronic device 50 and various data.
[0042] In one embodiment, when the processor 520 executes the safety and environmental protection field knowledge graph construction program in the memory 510, the following steps may be implemented: Analyze environmental monitoring data and safety monitoring data based on a pre-trained large language model to obtain unstructured text data including environmental monitoring reports and safety risk assessments; Extract entities, concepts, and relationships from unstructured text data based on a large language model, and initially build a knowledge system; The knowledge system is organized and classified based on preset category standards and large language models to obtain a knowledge graph of general knowledge categories and professional customized knowledge categories.
[0043] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 50 mentioned, and the electronic device 50 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 50 may not be a portable device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0044] 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.
[0045] 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 method for constructing a knowledge graph in the field of safety and environmental protection, characterized in that: include: Analyze environmental monitoring data and safety monitoring data based on a pre-trained large language model to obtain unstructured text data including environmental monitoring reports and safety risk assessments; Extract entities, concepts, and relationships from unstructured text data based on a large language model, and initially build a knowledge system; The knowledge system is organized and classified based on preset category standards and large language models to obtain a knowledge graph of general knowledge categories and professional customized knowledge categories.
2. The knowledge graph construction method according to claim 1, characterized in that: The environmental monitoring data is derived from messages from an environmental monitoring station and / or user text input, and the security monitoring data is derived from messages from a security monitoring device and / or user text input.
3. The knowledge graph construction method according to claim 1, characterized in that: Before analyzing environmental monitoring data and security monitoring data based on the pre-trained large language model, it also includes: The environmental monitoring data and the safety monitoring data are preprocessed.
4. The knowledge graph construction method according to claim 3, characterized in that: The preprocessing of the environmental monitoring data and the safety monitoring data includes: The environmental monitoring data and security monitoring data are cleaned, formatted and encoded.
5. The knowledge graph construction method according to claim 1, characterized in that: The categories of the knowledge graph also include: A knowledge graph of routing jump categories that displays text content in the knowledge system in the form of subject content pages.
6. A knowledge question-answering method in the field of safety and environmental protection, characterized in that: include: Analyze the natural language question input by the user in text form based on the large language model to obtain a query language, wherein the categories of the query language include: general knowledge category and query data category; Obtaining answers from the knowledge graph based on the query, and conveying the answers to the user in the form of page display; Wherein, the knowledge graph is obtained according to the method for constructing a knowledge graph in the field of safety and environmental protection as described in any one of claims 1 to 5 above.
7. The knowledge question answering method according to claim 6, characterized in that: The obtaining of answers from the knowledge graph based on the query language includes: Determining whether the category of the query is a general knowledge category; If so, directly calling the content corresponding to the query from the knowledge graph of the general knowledge category based on the large language model as the answer output; If not, determining whether the category of the query is a query data category; If yes, then generate an SQL statement based on the large language model, and query the knowledge graph of the professional customized knowledge category for content corresponding to the query as an answer output according to the SQL statement; If not, a route is generated, and according to the route, the content corresponding to the query is searched from the knowledge graph of the route jump category and output as the answer.
8. A knowledge question-answering device in the field of safety and environmental protection, characterized in that: include: 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; An answer query module, used to obtain an answer from the knowledge graph based on the query language; An answer display module is used to convey the answer to the user in the form of a page display; Wherein, the knowledge graph is obtained according to the method for constructing a knowledge graph in the field of safety and environmental protection as described in any one of claims 1 to 5 above.
9. The knowledge question-answering device according to claim 5, characterized in that: The answer query module also includes: A query recognition module, used to determine whether the category of the query is a general knowledge category, and to determine whether the category of the query is a query data category; Route generation module, used to generate routes.
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 method for constructing a knowledge graph in the safety and environmental protection field as described in any one of claims 1 to 5, and the steps in the method for question-answering knowledge in the safety and environmental protection field as described in any one of claims 6 to 7.
Citation Information
Cited By
Safety monitoring intelligent question answering system based on AI large model
CN119990150A