A Method for Constructing an Emergency Plan Knowledge Graph
By constructing the ontology map of the knowledge graph and entity extraction model of the emergency plan, the problem of low accuracy of entity extraction caused by the irregular text structure of the traditional emergency plan is solved, and more efficient construction and management of the emergency plan knowledge graph are achieved.
Patent Information
- Application Number
- CN202210447707.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Due to the irregular structure of traditional text-based emergency plans, it is difficult to achieve the accuracy of entity extraction through machine learning models, affecting the efficiency of emergency command decisions.
By constructing the ontology map of the target knowledge graph, the emergency plan text is obtained and similarity matched with the candidate topics, the text is divided in area after determining the target topic, and the entity relationship is extracted using the knowledge extraction model to build an emergency plan knowledge graph.
It improves the accuracy of entity extraction in the process of knowledge graph construction, reduces the impact of irregular text structure on the knowledge extraction model, and enhances the digital management and intelligent push capabilities of emergency plans.
Smart Images

Figure CN114840685B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and particularly to a method for constructing an emergency plan knowledge graph. Background Art
[0002] As an important task of emergency management, an emergency plan is a plan formulated in advance for possible emergencies related to emergency management, emergency command, and emergency rescue.
[0003] When an emergency occurs, most traditional text-based plans exist in paper form and there are many defects in the plan text, making it difficult to effectively serve the command and decision-making departments and the operation departments. The command and decision-making departments are difficult to timely grasp the emergency handling status and the response of each department, and cannot make accurate decisions. Actively exploring methods to improve emergency plans using modern technical means such as computer technology, network technology, and simulation technology is the current research focus of emergency plans. By applying the knowledge graph to the digital management and intelligent push of emergency plans and establishing a digital platform for emergency plans, it is possible to achieve standardized management of the emergency plan system and text content by the main body department of the emergency plan, facilitate the query of plan knowledge, and assist emergency command and decision-making.
[0004] However, since the plan text is unstructured text and the text structure is not yet standardized, the accuracy of entity extraction of the knowledge graph through a machine learning model is relatively low. Summary of the Invention
[0005] This application provides a method, device, equipment, and storage medium for constructing an emergency plan knowledge graph, which improves the training efficiency of the machine learning model. The technical solution is as follows.
[0006] On the one hand, a method for constructing an emergency plan knowledge graph is provided. The method includes:
[0007] Construct a target knowledge graph ontology graph; the target knowledge graph ontology graph contains entities and the relationships between entities;
[0008] Obtain the emergency plan text;
[0009] Perform similarity matching between the emergency plan text and each candidate theme to obtain a matching degree, and determine the target theme corresponding to the emergency plan text from each candidate theme based on the matching degree;
[0010] Divide the emergency plan text based on the target theme and obtain the target text of the main text area;
[0011] Perform knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities;
[0012] Associate the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph.
[0013] On the other hand, an emergency plan knowledge graph construction device is provided, and the device includes:
[0014] An ontology construction module for constructing an ontology graph of a target knowledge graph; the ontology graph of the target knowledge graph includes entities and the relationships between the entities;
[0015] An emergency plan text acquisition module for acquiring an emergency plan text;
[0016] A similarity matching module for performing similarity matching between the emergency plan text and each candidate topic to obtain a matching degree, and determining a target topic corresponding to the emergency plan text from among the candidate topics based on the matching degree;
[0017] A region division module for dividing the emergency plan text based on the target topic and obtaining the target text of the main text region;
[0018] A knowledge extraction module for performing knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities;
[0019] A graph construction module for associating the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph.
[0020] In a possible implementation manner, the similarity matching module is further configured to
[0021] For each candidate topic, perform similarity matching between the file name of the emergency plan text and the topic name of the candidate topic to obtain a first matching value;
[0022] Perform similarity matching between the title of the emergency plan text and the title of the candidate topic to obtain a second matching value;
[0023] Perform similarity matching between the keywords of the emergency plan text and the keywords of the candidate topic to obtain a third matching value; the keywords of the emergency plan text have an appearance frequency higher than a target threshold in the emergency plan text;
[0024] Perform weighted summation on the first matching value, the second matching value, and the third matching value to obtain the matching degree between the candidate topic and the emergency plan text;
[0025] Determine the target topic of the emergency plan text according to the matching degrees between the candidate topics and the emergency plan text.
[0026] In a possible implementation, the area division module is further configured to
[0027] obtain at least one pair of start keywords and end keywords corresponding to the target topic;
[0028] For each pair of start keywords and end keywords, obtain the target text of the body area in the target topic that is between the start keyword and the end keyword.
[0029] In a possible implementation, the apparatus further includes:
[0030] A part-of-speech analysis module, configured to perform word segmentation on the target text and perform part-of-speech analysis on each obtained target word;
[0031] A sentence splitting module, configured to split the target text into sentences according to the word relationship between each target word and the punctuation marks in the target text, to obtain the target text after sentence splitting.
[0032] The knowledge extraction module is further configured to
[0033] perform knowledge extraction on the target text after sentence splitting through a target knowledge extraction model to obtain the target entity and the relationship between the target entities.
[0034] In a possible implementation, the target text after sentence splitting contains at least one target sentence;
[0035] The apparatus further includes:
[0036] A word relationship detection module, configured to detect the word relationship between each word in the target sentence for each target sentence;
[0037] A sentence completion module, configured to perform a completion operation on the target sentence according to the target word relationship and the target paragraph where the target sentence is located when the target word relationship is missing in the target sentence.
[0038] In a possible implementation, the sentence completion module is further configured to
[0039] when there is an object-verb relationship in the target sentence and there is no subject-predicate relationship, complete the subject of the target sentence according to the candidate subjects in the target paragraph;
[0040] when there is a subject-predicate relationship in the target sentence and there is no object-verb relationship, merge the next sentence of the target sentence with the target sentence.
[0041] In a possible implementation, the apparatus further includes:
[0042] A training text acquisition module is used to acquire a training plan text; the training plan text contains entity annotation information; the entity annotation information is used to indicate the sentence where the entity is located, the entity category, and the entity content.
[0043] A model training module is used to perform knowledge extraction on the training plan text through an initial knowledge extraction model, and iteratively update the initial knowledge extraction model a target number of times according to the extraction result and the entity annotation information to generate the target knowledge extraction model.
[0044] On the other hand, a computer device is provided. The computer device includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory. The at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the above-mentioned emergency plan knowledge graph construction method.
[0045] On another hand, a computer-readable storage medium is provided. At least one instruction is stored in the storage medium. The at least one instruction is loaded and executed by the processor to implement the above-mentioned emergency plan knowledge graph construction method.
[0046] On the other hand, a computer program product is also provided. A computer program product or a computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned emergency plan knowledge graph construction method.
[0047] The technical solution provided by this application may include the following beneficial effects:
[0048] When constructing an emergency plan knowledge graph, the computer device can first construct a target knowledge graph ontology graph to define entities and the relationships between entities. At this time, the computer device can obtain the emergency plan text that needs to be input, match the emergency plan text with candidate topics, and determine the target topic corresponding to the emergency plan text. The computer device can then divide the emergency plan text according to the target topic to determine the text in the main body area, and then perform knowledge extraction on the text in the main body area through a knowledge extraction model to extract entities to construct an emergency plan knowledge graph. In the above solution, by matching the emergency plan text with the pre-set candidate topics, the main body area corresponding to the emergency plan is determined, reducing the impact of an irregular text structure on the knowledge extraction model, thereby improving the accuracy of entity extraction in the process of knowledge graph construction. Description of the Drawings
[0049] To more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings required for the description of the specific embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0050] Figure 1 It is a schematic structural diagram of a system for constructing an emergency plan knowledge graph shown according to an exemplary embodiment.
[0051] Figure 2 It is a method flow chart of a method for constructing an emergency plan knowledge graph shown according to an exemplary embodiment.
[0052] Figure 3 It is a method flow chart of a method for constructing an emergency plan knowledge graph shown according to an exemplary embodiment.
[0053] Figure 4 It shows a topological schematic diagram of an ontology graph of an emergency plan knowledge graph involved in an embodiment of the present application.
[0054] Figure 5 It shows a flow chart of topic recognition involved in an embodiment of the present application.
[0055] Figure 6 It shows a schematic diagram of an intelligent segmentation process involved in an embodiment of the present application.
[0056] Figure 7 It shows a schematic diagram of an intelligent clause splitting and completion process involved in an embodiment of the present application.
[0057] Figure 8 It is a block diagram of the structure of an apparatus for constructing an emergency plan knowledge graph shown according to an exemplary embodiment.
[0058] Figure 9 It is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. Specific Embodiments
[0059] Next, the technical solutions of the present application will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.
[0060] It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or a representation of an associated relationship. For example, A indicates B, which can mean that A directly indicates B. For example, B can be obtained through A; it can also mean that A indirectly indicates B. For example, A indicates C, and B can be obtained through C; it can also mean that there is an associated relationship between A and B.
[0061] In the description of the embodiments of the present application, the term "corresponding" can indicate a direct or indirect corresponding relationship between two parties, can also indicate an associated relationship between two parties, or can be relationships such as indication and being indicated, configuration and being configured, etc.
[0062] In the embodiments of the present application, "predefined" can be implemented by pre-saving corresponding codes, tables, or other means that can be used to indicate relevant information in a device (for example, including terminal devices and network devices). The present application does not limit its specific implementation method.
[0063] Before describing the various embodiments shown in the present application, several concepts related to the present application will be introduced first.
[0064] 1) AI (Artificial Intelligence, artificial intelligence)
[0065] Artificial Intelligence, abbreviated as AI in English. It is a new technical science that studies, develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. Artificial intelligence is a branch of computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. The research in this field includes robots, speech recognition, image recognition, natural language processing, and expert systems, etc. Since its birth, the theory and technology of artificial intelligence have become increasingly mature, and the application fields have also been continuously expanding. It can be imagined that the future technological products brought by artificial intelligence will be the "containers" of human wisdom. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is not human intelligence, but it can think like a human and may even exceed human intelligence.
[0066] The main material basis for studying artificial intelligence and the machine that can implement the artificial intelligence technology platform is the computer. In addition to computer science, artificial intelligence also involves multiple disciplines such as information theory, cybernetics, automation, bionics, biology, psychology, mathematical logic, linguistics, medicine, and philosophy. The main contents studied in the discipline of artificial intelligence include: knowledge representation, automatic reasoning and search methods, machine learning and knowledge acquisition, knowledge processing systems, natural language understanding, computer vision, intelligent robots, automatic programming, etc.
[0067] 2) Machine Learning (ML)
[0068] Machine learning is an interdisciplinary field that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills, reorganize the existing knowledge structure, and continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learning from demonstration.
[0069] 3) Knowledge Graph
[0070] Knowledge Graph, known as knowledge domain visualization or knowledge domain mapping map in the library and information science field, is a series of various graphs that display the development process and structural relationships of knowledge. It uses visualization technology to describe knowledge resources and their carriers, mine, analyze, construct, draw, and display knowledge and their mutual connections. The Knowledge Graph is a modern theory that combines the theories and methods of disciplines such as applied mathematics, graphics, information visualization technology, and information science with methods such as bibliometric citation analysis and co-occurrence analysis, and uses visual graphs to vividly display the core structure, development history, frontier fields, and overall knowledge architecture of disciplines to achieve the purpose of multi-disciplinary integration.
[0071] As introduced in the background technology, the emergency plan, as an important task of emergency management, is a plan formulated in advance for possible emergencies related to emergency management, emergency command, and emergency rescue.
[0072] When an emergency occurs, most traditional text-based plans exist in paper form and there are many defects in the plan text, making it difficult to effectively serve the command and decision-making departments and the action departments. The command and decision-making departments are difficult to timely grasp the emergency disposal status and the response situations of each department, and cannot make accurate decisions. Actively exploring methods to improve the emergency plan using modern technical means such as computer technology, network technology, and simulation technology is the current research focus of the emergency plan. By applying the Knowledge Graph to the digital management and intelligent push of the emergency plan, an emergency plan digital platform can be established, which can realize the standardized management of the emergency plan system and text content by the main departments of the emergency plan, facilitate the query of plan knowledge, and assist in emergency command and decision-making.
[0073] However, since the plan text is unstructured text and the text structure is not yet standardized, the accuracy of entity extraction of the Knowledge Graph through machine learning models is relatively low.
[0074] To address the above problems, an embodiment of the present application proposes a method for constructing an emergency plan knowledge graph, which includes: constructing an ontology graph of the target knowledge graph; obtaining emergency plan texts; performing similarity matching between the emergency plan texts and each candidate topic to obtain a matching degree, and determining the target topic corresponding to the emergency plan texts among the candidate topics based on the matching degree; partitioning the emergency plan texts based on the target topic and obtaining the target texts in the main text area; performing knowledge extraction on the target texts through a target knowledge extraction model to obtain target entities and the relationships between the target entities; associating the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph. Through the above solution, the accuracy of entity extraction in the process of constructing the knowledge graph can be improved. The above solution will be introduced in detail below.
[0075] Figure 1 It is a schematic structural diagram of an emergency plan knowledge graph construction system shown according to an exemplary embodiment. Optionally, the emergency plan knowledge graph construction system includes a server 110 and a terminal 120. Among them, data communication is carried out between the terminal 120 and the server 110 through a communication network, and the communication network can be a wired network or a wireless network.
[0076] Optionally, the emergency plan knowledge graph construction system can construct an emergency plan knowledge graph in the server 110, that is, in the form of a graph database, save each data (such as entity attributes, entity relationships, etc.) corresponding to the knowledge graph in the graph database in the server 110.
[0077] Optionally, the server 110 includes a machine learning model for performing knowledge extraction. The machine learning model can be a machine learning model trained in the server 110 through training plan texts, or the machine learning model (such as a model training device) can also be a machine learning model trained in other computer devices through training plan texts. On the model training device, after training a machine learning model for performing knowledge extraction through training plan texts, the structure of the machine learning model and the parameter information of the machine learning model can be sent to the server 110 so that the server 110 can construct a machine learning model for performing knowledge extraction.
[0078] Optionally, the knowledge extraction process may be executed on the terminal 120. That is, the terminal 120 may receive the parameter information of the machine learning model and the structure information of the machine learning model sent by the model training device or the server 110, and construct the corresponding machine learning model on the terminal 120. When the terminal 120 receives the emergency plan text that needs to be subjected to knowledge extraction, it may, through the application program, call the machine learning model to perform knowledge extraction on the emergency plan text, and send and save each data obtained by the knowledge extraction (such as entity attributes, entity relationships, etc.) in the server 110, so that the server 110 can construct a knowledge graph.
[0079] Optionally, the terminal 120 may be a terminal device having an instruction input component. The instruction input component may include components such as a touch display screen, a mouse, and a keyboard that generate instruction information according to user operations. The user may, by performing a specified operation on the instruction input component, control the terminal 120 to perform a specified operation (such as obtaining the emergency plan text, performing knowledge extraction on the emergency plan text, etc.).
[0080] Optionally, the terminal 120 may be a mobile terminal such as a smart phone, a tablet computer, or a laptop computer, or may be a terminal such as a desktop computer or a projection computer, or a smart terminal having a data processing component. The embodiments of the present application do not impose any restrictions in this regard.
[0081] The server 110 may be implemented as a single server or as a server cluster composed of a group of servers. It may be a physical server or may be implemented as a cloud server. In a possible implementation manner, the server 110 is the background server of the application program in the terminal 120.
[0082] Optionally, the above-mentioned server may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or may be a cloud server providing technical computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0083] Optionally, the system may further include a management device for managing the system (such as managing the connection status between each module and the server). The management device is connected to the server through a communication network. Optionally, the communication network is a wired network or a wireless network.
[0084] Optionally, the above-mentioned wireless network or wired network uses standard communication technologies and / or protocols. The network is usually the Internet, but it can also be any other network, including but not limited to any combination of local area networks, metropolitan area networks, wide area networks, mobile, limited or wireless networks, private networks or virtual private networks. In some embodiments, technologies and / or formats including Hypertext Markup Language, Extensible Markup Language, etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as Secure Sockets Layer, Transport Layer Security, Virtual Private Network, Internet Protocol Security, etc. can be used to encrypt all or some of the links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the above data communication technologies.
[0085] Figure 2 is a method flowchart of a method for constructing an emergency plan knowledge graph shown according to an exemplary embodiment. This method is executed by a computer device, and the computer device can be a server or a terminal in a model training system as shown in Figure 1 Taking the emergency plan knowledge graph construction method executed by the server as an example, as shown in Figure 2 shown, the emergency plan knowledge graph construction method may include the following steps:
[0086] Step 201, construct a target knowledge graph ontology graph.
[0087] The target knowledge graph ontology graph contains entities and the relationships between the entities.
[0088] An ontology is a semantic data model used to define the types of things and the attributes that can be used to describe them. In the embodiments of the present application, the computer device can first define the attributes of the instances involved in the knowledge graph before constructing the knowledge graph.
[0089] Step 202, obtain the emergency plan text.
[0090] Step 203, perform similarity matching between the emergency plan text and each candidate theme to obtain a matching degree, and determine the target theme corresponding to the emergency plan text among each candidate theme based on the matching degree.
[0091] In a possible implementation manner of the embodiments of the present application, after obtaining the emergency plan text, the computer device can perform similarity matching between the emergency plan text and each candidate theme predefined in the computer device, so as to determine the target theme corresponding to the emergency plan text.
[0092] Taking the power industry as an example, the emergency plan text is used to indicate the specific action measures and command decision-making plans required in the event of a power emergency. However, there are also various types of power emergencies, and the content differences of emergency plan texts for different types may be relatively large. For example, when there is a failure of power generation equipment and a power line failure caused by natural disasters, the corresponding emergency measures are obviously quite different. Therefore, the corresponding emergency plan texts should also have a large gap. Therefore, computer equipment can classify emergency plan texts by theme. At this time, the text structures of emergency plan texts assigned to the same theme category are the same or similar.
[0093] Step 204, divide the emergency plan text based on the target theme, and obtain the target text in the body area.
[0094] When the target theme corresponding to the emergency plan text is obtained, the emergency plan text can be divided into regions according to the text structure indicated by the target theme. At this time, the computer equipment can directly determine the body area corresponding to the emergency plan text according to the text structure indicated by the target theme, and determine the target text in the body area as the body text, and perform operations such as knowledge extraction on the body text.
[0095] Step 205, perform knowledge extraction on the target text through the target knowledge extraction model to obtain the target entities and the relationships between the target entities.
[0096] And since in the embodiment of the present application, the target text is the body text extracted according to the target theme, when performing knowledge extraction operations on the body text through the target knowledge extraction model, the impact caused by the structural differences of the emergency plan text on knowledge extraction is minimized as much as possible, and the accuracy of the target knowledge extraction model in performing knowledge extraction operations is improved.
[0097] Step 206, associate the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph.
[0098] When the target entities and the relationships between the target entities are extracted, the target entities and the relationships between the target entities can be associated with the ontology graph of the emergency plan knowledge graph (that is, saved in the graph database corresponding to the emergency plan knowledge graph), so as to construct an emergency plan knowledge graph.
[0099] After constructing the emergency plan knowledge graph, since the essence of the knowledge graph is a graph-based semantic network that stores the association relationships between entities, computer devices can perform path retrieval on the entities in the graph according to the query conditions input by the user, so as to obtain the entities corresponding to the query conditions and return them to the user, enabling the user to quickly and accurately query the content corresponding to the query conditions in the knowledge graph.
[0100] In summary, when constructing the emergency plan knowledge graph, the computer device can first construct the target knowledge graph ontology graph to define the ontology and the relationships between ontologies. At this time, the computer device can obtain the emergency plan text that needs to be input, match the emergency plan text with the candidate topics, and determine the target topic corresponding to the emergency plan text. The computer device can then divide the emergency plan text according to the target topic to determine the text in the main body area, and then perform knowledge extraction on the text in the main body area through the knowledge extraction model to extract entities and construct the emergency plan knowledge graph. In the above solution, by matching the emergency plan text with the pre-set candidate topics, the main body area corresponding to the emergency plan is determined, reducing the impact of the irregular text structure on the knowledge extraction model, thereby improving the accuracy of entity extraction in the process of knowledge graph construction.
[0101] Figure 3 is a method flow chart of an emergency plan knowledge graph construction method shown according to an exemplary embodiment. This method is executed by a computer device, which can be a server or a terminal in a model training system as shown in Figure 1 Taking the execution of the emergency plan knowledge graph construction method by the server as an example, as shown in Figure 3 The emergency plan knowledge graph construction method may include the following steps:
[0102] Step 301, construct a target knowledge graph ontology graph.
[0103] In a possible implementation manner of the embodiment of the present application, during the process of constructing the emergency plan knowledge graph, the computer device can first construct the initial ontology graph of the emergency plan knowledge graph, that is, the target knowledge graph ontology graph, to define the entities in the knowledge graph and the relationships between the entities.
[0104] Please refer to Figure 4 which shows a topological schematic diagram of an emergency plan knowledge graph ontology graph involved in the embodiment of the present application. As shown in Figure 4 During the construction of the emergency plan knowledge graph, the attribute ontologies that may be involved may include superior departments, executing departments, collaborating departments, task content, task prerequisites, source systems, and target systems.
[0105] At this time, the attribute information of the entities contained in the ontology can also be defined in advance. For example, the attribute information of the entities contained in the ontology can include: department {id, name, department level}, matter department {name, role}, matter {original text, id, task prerequisite, task content, target system, source system}, link {id, serial number, name}, stage {id, name}, theme {id, name, affiliated city, keyword}, company {id, name, level}, matter promotion {matter promotion method}.
[0106] At this time, the relationships between the ontologies can be characterized as the relationships between the entities contained in the ontologies. For example, the relationships between the entities contained in the ontologies can include: {matter - related department - matter department}, {matter department - corresponding department - department}, {matter - affiliated link - link}, {matter - pre - matter - matter promotion}, {matter promotion - post - matter - matter}, {link - affiliated stage - stage}, {stage - affiliated event - theme}, {department - affiliated company - company}.
[0107] Step 302, obtain the emergency plan text.
[0108] Step 303, perform similarity matching between the emergency plan text and each candidate theme to obtain a matching degree, and determine the target theme corresponding to the emergency plan text among each candidate theme based on the matching degree.
[0109] In the embodiment of the present application, each of the candidate themes can be pre - saved in a computer device. The computer device can save the configuration information corresponding to each candidate theme. For example, for any candidate theme, the computer device can save the theme information such as the theme name corresponding to the candidate theme, the title of the candidate theme, and the keywords of the candidate theme, so that the computer device can perform similarity matching between the theme information of the candidate theme and the emergency plan text.
[0110] In a possible implementation manner, for each candidate theme, perform similarity matching between the file name of the emergency plan text and the theme name of the candidate theme to obtain a first matching value;
[0111] Perform similarity matching between the title of the emergency plan text and the title of the candidate theme to obtain a second matching value;
[0112] Perform similarity matching between the keywords of the emergency plan text and the keywords of the candidate theme to obtain a third matching value; the frequency of occurrence of the keywords of the emergency plan text in the emergency plan text is higher than a target threshold;
[0113] Perform weighted summation on the first matching value, the second matching value, and the third matching value to obtain the matching degree between the candidate theme and the emergency plan text;
[0114] Determine the target theme of the emergency plan text according to the matching degree of each candidate theme and the emergency plan text.
[0115] Please refer to Figure 5 , which shows a theme recognition flowchart involved in the embodiments of the present application. As Figure 5 shown, when a PDF file (i.e., the emergency plan text in the embodiments of the present application) is obtained, the PDF file can be subjected to file name similarity matching, in-file title matching, and in-file keyword matching, and the three matching results obtained are calculated according to a certain weight, so as to obtain the matching degree of the PDF file with each candidate theme.
[0116] For theme recognition, it is necessary to judge the theme to which the input document content belongs. After the theme is determined, the key text content to be parsed is obtained according to the preset theme structure model of the system.
[0117] The theme recognition method (that is, theme matching) can identify the theme based on the keyword matching technology in a specific domain. Specifically, it includes: designing a theme keyword model. The theme keyword is mainly used to match the theme and contains information such as keywords and specific domains. For example, if the keyword is "typhoon" and the specific domain is "title", then when the document is input, the system will obtain the document title domain and match the keyword. If the match is successful, the document will be classified into the defined theme. The purpose of distinguishing themes is that the paragraph structures corresponding to different themes are different. After determining the theme, the sentences to be extracted can be extracted according to the corresponding paragraph structure, which can greatly improve the efficiency and accuracy of the program operation.
[0118] Step 304, obtain at least one pair of start keywords and end keywords corresponding to the target theme.
[0119] When classifying the emergency plan text by theme, that is, determining the target theme matched by the emergency plan text, at this time, the target theme in the computer device includes various paragraph structures, start keywords, and end keywords. At this time, the computer device can divide the emergency plan text into each paragraph according to the start keyword and the end keyword.
[0120] Step 305, for each pair of start keywords and end keywords, obtain the target text of the body area in the target theme between the start keyword and the end keyword.
[0121] In a possible implementation manner, after obtaining the start keyword and the end keyword, the computer device can, for each pair of start keywords and end keywords, determine the content between the start keyword and the end keyword as the body area of the paragraph;
[0122] Alternatively, in another possible implementation, after obtaining the start keyword and the end keyword, for each pair of the start keyword and the end keyword, the computer device may use the sentence where the start keyword is located as the starting sentence, use the sentence where the end keyword is located as the ending sentence, determine the text area from the starting sentence to the ending sentence as the body area, and determine the text from the starting sentence to the ending sentence as the body text.
[0123] Please refer to Figure 6 , which shows a schematic diagram of an intelligent segmentation process involved in an embodiment of the present application. As Figure 6 shown, when the computer device obtains a PDF file, it can first process the table of contents and tables in the file. For example, it can directly ignore the table of contents and tables in the file and directly read the main content part of the file. At this time, since the PDF file is composed of text on each page, when the computer device reads a single-page PDF, it can judge the single-page PDF to determine whether the start and end keywords are on this page. When both the start and end keywords are on this page, the text between the keywords is extracted as the body; when the start keyword is read but the end keyword is not read, the computer device reads the second-page PDF and judges whether there is an end keyword in the second-page PDF. If there is an end keyword, the text between the end keyword and the start keyword is extracted as the body; if there is no end keyword, it continues to read the third-page PDF and make a judgment until an end keyword exists in a single-page PDF is read.
[0124] After the computer device divides the body area for each pair of the start keyword and the end keyword, the emergency plan text has actually been divided into an area composed of paragraphs formed by each body area and a non-body area outside the body area. At this time, the non-body area can be considered as text features with little importance. Therefore, in order to avoid the influence of an irregular text structure on semantics, in the subsequent knowledge extraction process, only the text content of the body area part can be used for knowledge extraction. Although different text structures correspond to different themes, by screening out the body area of the emergency plan text through the keywords in the theme, the computer device can extract the text content of the more important part from different text structures, and minimize the influence of the irregular text structure on the subsequent knowledge extraction as much as possible.
[0125] In the embodiment of the present application, in order to further improve the accuracy of knowledge extraction of the emergency plan text, after segmenting the emergency plan text to obtain the body area of the emergency plan text, each body area can be further segmented into sentences, so that the text in the body area is divided into individual sentences, so as to perform knowledge extraction at the sentence level in the subsequent knowledge extraction process.
[0126] Step 306: Perform word segmentation on the target text and conduct part-of-speech analysis on each resulting target word.
[0127] To re-segment the segmented paragraphs, first perform word segmentation on the target text (e.g., through Jieba segmentation). Based on paddle.cut in Jieba segmentation for word segmentation, on the one hand, Chinese word segmentation (including stop words) can be achieved, and on the other hand, part-of-speech and semantic annotation of words can be carried out (the paddle model can default to separating more than 20 types of part-of-speech tags, such as noun n, verb v).
[0128] Step 307: According to the word relationship between each target word and the punctuation marks in the target text, perform sentence segmentation on the target text to obtain the target text after sentence segmentation.
[0129] After obtaining the part-of-speech of each target word, a dependency parsing tool (such as DDparser) can be used to analyze the dependency relationship between words in the sentence (that is, the word relationship between target words, such as the relationship between the subject and the predicate, hereinafter referred to as the subject-predicate relationship, etc.).
[0130] When the word relationship between each target word in the sentence is obtained, automatic segmentation can be performed according to the word relationship and punctuation marks. After segmentation, it can be further determined whether there is a parallel relationship or a serial verb construction in the sentence. Such sentences are generally in the same matter, so sentences with a parallel relationship and sentences with a serial verb relationship can be merged into one sentence.
[0131] After obtaining the main text content in the emergency plan text, considering that the format of the plan text is not standardized and there are often problems of missing sentence components, such as missing or abbreviating the task execution subject, missing or abbreviating the task operation object, etc. Therefore, in a possible implementation manner of this application embodiment, after the computer device obtains the main text content, it can also perform sentence segmentation on the main text content and conduct part-of-speech analysis on each sentence obtained after sentence segmentation to determine whether there is a missing sentence component in the sentence. When there is a missing sentence component, supplement the components in the sentence.
[0132] In a possible implementation manner, the target text after sentence segmentation contains at least one target sentence;
[0133] At this time, the computer device detects the word relationship between each word in the target sentence for each target sentence;
[0134] When the target word relationship is missing in the target sentence, perform a completion operation on the target sentence according to the target word relationship and the target paragraph where the target sentence is located.
[0135] In a possible implementation, when there is an object-predicate relationship in the target sentence and there is no subject-predicate relationship, the subject of the target sentence is completed according to the candidate subjects in the target paragraph.
[0136] When there is a subject-predicate relationship in the target sentence and there is no object-predicate relationship, the next sentence of the target sentence is merged with the target sentence.
[0137] In a possible implementation, the candidate subject can be the subject of the sentence that is before the target sentence in the sentences of the paragraph to which the target sentence belongs.
[0138] Alternatively, the candidate subject can be the subtitle with the smallest text distance from the target sentence in the paragraph to which the sentence belongs.
[0139] Please refer to Figure 7 , which shows a schematic diagram of an intelligent sentence splitting and completion process involved in an embodiment of the present application. As Figure 7 shown, in a possible implementation, after the computer device reads the body text, it first performs an initial sentence splitting operation on the body text according to the punctuation marks in the body text to obtain each candidate sentence. At this time, the computer device analyzes the word relationship of each candidate sentence according to DDparser.
[0140] For any candidate sentence, when there is an SBV (subject-predicate relationship) and a VOB (object-predicate relationship) in the candidate sentence, then the candidate sentence is a complete sentence, it is determined that the candidate sentence has been formed into a sentence, the candidate sentence is directly obtained as the target sentence, and the subject in the candidate sentence is extracted as the candidate subject for the next subjectless sentence.
[0141] When there is no SBV (subject-predicate relationship) but there is a VOB (object-predicate relationship) in the candidate sentence, then the candidate sentence obviously lacks a subject. At this time, a subject can be selected from the candidate subjects to complete the sentence with the candidate subject.
[0142] When there is no VOB (object-predicate relationship) in the candidate sentence, the next candidate sentence is directly merged with the candidate sentence as the target sentence.
[0143] In the actual emergency plan text, due to writing habits, default words (such as "its" and "the") are usually used to represent the subject, but this will make it difficult for the computer device to understand the true semantics when extracting knowledge. At this time, the computer device uses DDParser to determine whether the sentence structure is complete and meaningful before knowledge extraction, and then uses jieba word segmentation to extract the subject in the sentence to replace the default word. In addition, for the plan, the jieba word segmentation and DDParser vocabulary are modified to improve the accuracy, so that the goal can be achieved well, and the sentences selected during manual annotation can be basically the same.
[0144] Step 308: extract knowledge from the sentence-divided target text through the target knowledge extraction model to obtain target entities and the relationships between target entities.
[0145] In a possible implementation, a training plan text is obtained; the training plan text includes entity annotation information; the entity annotation information is used to indicate the sentence where the entity is located, the entity category, and the entity content;
[0146] The initial knowledge extraction model is used to extract knowledge from the training plan text, and the initial knowledge extraction model is iteratively updated a target number of times based on the extraction results and entity annotation information to generate a target knowledge extraction model.
[0147] Optionally, the annotations on the training plan text are manually annotated. Manual annotation is mainly based on the entity category in "attribute management" and the value is taken based on the key-value rule. The content includes: sentence, attribute, value, among which "sentence" is the sentence where the entity is located, "attribute" is the entity category to which the entity belongs, and "value" is the entity content. When performing entity annotation, it is necessary to manually complete the sentences with incomplete sentence components. For example, "The company's typhoon, flood and other disasters handling leadership group office reports to the disaster handling leadership group." The manually annotated content for this sentence is: "Sentence-Company typhoon, flood and other disasters handling leadership group office reports to the disaster handling leadership group", "Executive department-Leadership group office", "Task content-Report", "Superior department-Disaster handling leadership group".
[0148] Optionally, the knowledge extraction model used in the embodiments of the present application can select the BiLSTM+CRF model that combines deep learning and machine learning. The optimization of algorithm parameters mainly includes: (1) Set the Dropout parameter to prevent overfitting. When not using Dropout to lose neurons, on a small dataset, the network trains and fits this data, and the accuracy is close to 1, and the network shows overfitting. Therefore, set the random inactivation rate of Dropout = 0.5 to lose half of the neurons during the training process to prevent overfitting. (2) Gradually decay the learning rate. If the learning rate is too small, it will cause your neural network to not be able to learn at all. If the learning rate is too large, overfitting is likely to occur. Therefore, adopt the method of gradually decaying the learning rate, set the initial value of the learning rate to: learning-rate = 1e-3, and control it through the decay parameter of the optimizer class. The learning rate is large in the initial stage of learning to enable the model to learn quickly, and then continuously decreases and decays in the later stage to prevent overfitting, and the model can continue to learn and fine-tune in the later stage. (3) Set mini-batch. Mini-batch is a batch of the training dataset at a time. If the batch gradient descent method is used, all the training sets need to be processed at once and then a gradient descent is achieved, which is very slow. The mini-batch gradient descent method can divide the number of samples into multiple small mini-batches, so that individual small batches can be processed simultaneously to improve the learning speed, rather than processing all the X and Y training sets. Set this value to 128. (4) epoch (number of training rounds) During training, it is not enough to iterate and train all the data once. It needs to be repeated many times to fit and converge. If the number of rounds is too large, it will consume a lot of useless resources and the model will not be improved. If the number of rounds is too small, the training effect of the model is not good. Therefore, set it to 150 rounds, the model converges, and it will not continue to train ineffectively.
[0149] Optionally, during the training process of the above knowledge extraction model, data preprocessing needs to be carried out first. Convert the manually annotated data into "BIO" annotation. Then train the model according to the loss function, and the loss function is shown as follows.
[0150]
[0151]
[0152]
[0153] The purpose of model training is to make the loss function reach the minimum value, that is, the probability reaches the maximum value. The parameters after training are saved in the ckpt file. The parameters after training are saved in the ckpt file.
[0154] Step 309: Associate the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct the emergency plan knowledge graph.
[0155] Optionally, after the emergency plan knowledge graph is constructed, association analysis and query of the knowledge graph can be performed. In essence, the knowledge graph is a graph-based semantic network that stores the association relationships between entities. The association query of the knowledge graph is actually a path retrieval of the entities in the graph, and the depth-first search (DFS) and breadth-first search (BFS) algorithms are used to retrieve the graph. The association analysis of the knowledge graph includes various graph analysis algorithms, such as PageRank, loop detection, shortest and longest paths, K-hop reachability query, community discovery, and other algorithms.
[0156] Optionally, in a possible implementation, an organizational structure management module can also be designed in the emergency plan knowledge graph. The computer device can expand the department name in the plan to "company name + department name" according to the company's organizational structure, so as to achieve association queries between different levels of companies. For example, "Emergency Office of B County Power Supply Company of A Company" can be associated with "Emergency Office of C City Power Supply Company of A Company".
[0157] Optionally, the Viterbi algorithm can also be used for knowledge graph query: two matrices T1 and T2 are used; T1 records the maximum probability of falling into all hidden states at the current moment, and T1ij represents the maximum probability of falling into the hidden state i at the jth moment (i.e., the jth text character); the maximum probability is stored by T2, and this maximum probability is transferred from which hidden state at the previous moment, that is, the transfer path is recorded; finally, backtracking is performed forward from the end to find the optimal path with the maximum probability, that is, the label of the text sequence is obtained, and the obtained text sequence is used as the query result.
[0158] Optionally, after the emergency plan knowledge graph is constructed, the knowledge graph can be visualized. The knowledge graph processes complex information through calculation into knowledge that can be structurally represented, and the represented knowledge can be displayed through graphic drawing, providing valuable reference for people's learning and facilitating information retrieval. Since the knowledge graph uses a graph mode for storage management, a relational graph is often used to display the knowledge graph.
[0159] In summary, when constructing an emergency plan knowledge graph, a computer device can first construct a target knowledge graph ontology graph to define the ontology and the relationships between ontologies. At this time, the computer device can obtain the emergency plan text to be input, match the similarity between the emergency plan text and candidate topics, and determine the target topic corresponding to the emergency plan text. The computer device can then divide the emergency plan text according to the target topic to determine the text in the main body area, and then perform knowledge extraction on the text in the main body area through a knowledge extraction model to extract entities and construct an emergency plan knowledge graph. In the above solution, by matching the emergency plan text with the pre-set candidate topics, the main body area corresponding to the emergency plan is determined, reducing the impact of the irregular text structure on the knowledge extraction model, and thus improving the accuracy of entity extraction in the process of constructing the knowledge graph.
[0160] Figure 8 It is a structural block diagram of an emergency plan knowledge graph construction device shown according to an exemplary embodiment. The device includes:
[0161] An ontology construction module 801, configured to construct a target knowledge graph ontology graph; the target knowledge graph ontology graph includes entities and the relationships between entities;
[0162] An emergency plan text acquisition module 802, configured to acquire an emergency plan text;
[0163] A similarity matching module 803, configured to perform similarity matching between the emergency plan text and each candidate topic to obtain a matching degree, and determine the target topic corresponding to the emergency plan text from the candidate topics based on the matching degree;
[0164] A region division module 804, configured to perform region division on the emergency plan text based on the target topic and obtain the target text in the main body region;
[0165] A knowledge extraction module 805, configured to perform knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities;
[0166] A graph construction module 806, configured to associate the target entities and the relationships between the target entities with the emergency plan knowledge graph ontology graph to construct an emergency plan knowledge graph.
[0167] In a possible implementation manner, the similarity matching module is further configured to,
[0168] For each candidate topic, perform similarity matching between the file name of the emergency plan text and the topic name of the candidate topic to obtain a first matching value;
[0169] Perform a similarity match between the title of the emergency response plan text and the title of the candidate topic to obtain a second match value;
[0170] Perform a similarity match between the keywords of the emergency response plan text and the keywords of the candidate topic to obtain a third match value; the frequency of occurrence of the keywords of the emergency response plan text in the emergency response plan text is higher than the target threshold;
[0171] Perform a weighted sum of the first match value, the second match value, and the third match value to obtain the matching degree between the candidate topic and the emergency response plan text;
[0172] Determine the target topic of the emergency response plan text according to the matching degree between each candidate topic and the emergency response plan text.
[0173] In a possible implementation manner, the area division module is further configured to,
[0174] Obtain at least one pair of start keywords and end keywords corresponding to the target topic;
[0175] For each pair of start keywords and end keywords, obtain the target text of the body area in the target topic that is between the start keyword and the end keyword.
[0176] In a possible implementation manner, the device further includes:
[0177] A part-of-speech analysis module, configured to perform word segmentation on the target text and perform part-of-speech analysis on each obtained target word;
[0178] A sentence splitting module, configured to split the target text according to the word relationship between each target word and the punctuation marks in the target text to obtain the target text after sentence splitting.
[0179] The knowledge extraction module is further configured to,
[0180] Perform knowledge extraction on the target text after sentence splitting through a target knowledge extraction model to obtain the target entities and the relationships between the target entities.
[0181] In a possible implementation manner, the target text after sentence splitting contains at least one target sentence;
[0182] The device further includes:
[0183] A word relationship detection module, configured to detect the word relationship between each word in the target sentence for each target sentence;
[0184] A sentence completion module, configured to perform a completion operation on the target sentence according to the target word relationship and the target paragraph where the target sentence is located when the target word relationship is missing in the target sentence.
[0185] In a possible implementation manner, the sentence completion module is further configured to
[0186] When there is an object-verb relationship in the target sentence and there is no subject-verb relationship, complete the subject of the target sentence according to the candidate subjects in the target paragraph;
[0187] When there is a subject-verb relationship in the target sentence and there is no object-verb relationship, merge the next sentence of the target sentence with the target sentence.
[0188] In a possible implementation manner, the device further includes:
[0189] A training text acquisition module, configured to acquire a training plan text; the training plan text contains entity annotation information; the entity annotation information is used to indicate the sentence where the entity is located, the entity category, and the entity content;
[0190] A model training module, configured to perform knowledge extraction on the training plan text through an initial knowledge extraction model, and perform iterative updates on the initial knowledge extraction model for a target number of times according to the extraction result and the entity annotation information to generate the target knowledge extraction model.
[0191] In summary, when constructing an emergency plan knowledge graph, a computer device can first construct a target knowledge graph ontology graph to define the ontology and the relationships between ontologies. At this time, the computer device can obtain the emergency plan text to be input, match the emergency plan text with the candidate topics, and determine the target topic corresponding to the emergency plan text. The computer device can then divide the emergency plan text according to the target topic to determine the text in the main body area, and then perform knowledge extraction on the text in the main body area through the knowledge extraction model to extract entities to construct the emergency plan knowledge graph. In the above solution, by matching the emergency plan text with the pre-set candidate topics, the main body area corresponding to the emergency plan is determined, reducing the impact of the irregular text structure on the knowledge extraction model, thereby improving the accuracy of entity extraction in the process of knowledge graph construction.
[0192] Please refer to Figure 9 , which is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. The computer device includes a memory and a processor. The memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.
[0193] Among them, the processor may be a Central Processing Unit (CPU). The processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., which are chips, or combinations of the above types of chips.
[0194] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions, and modules stored in the memory, that is, to implement the methods in the above method embodiments.
[0195] The memory may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0196] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one computer program, and the at least one computer program is loaded and executed by the processor to implement all or part of the steps in the above method. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0197] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include the well-known common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0198] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for constructing an emergency plan knowledge graph, characterized in that, The method includes: Constructing an ontology graph of the target knowledge graph; the ontology graph of the target knowledge graph includes entities and the relationships between entities; Obtaining an emergency plan text; Performing similarity matching between the emergency plan text and each candidate theme to obtain a matching degree, and determining the target theme corresponding to the emergency plan text from among the candidate themes based on the matching degree; Dividing the emergency plan text into regions based on the target theme, and obtaining the target text of the main text region; Performing knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities; Associating the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph.
2. The method according to claim 1, characterized in that, The performing similarity matching between the emergency plan text and each candidate theme to obtain a matching degree, and determining the target theme corresponding to the emergency plan text from among the candidate themes based on the matching degree includes: For each candidate theme, performing similarity matching between the file name of the emergency plan text and the theme name of the candidate theme to obtain a first matching value; Performing similarity matching between the title of the emergency plan text and the title of the candidate theme to obtain a second matching value; Performing similarity matching between the keywords of the emergency plan text and the keywords of the candidate theme to obtain a third matching value; the frequency of occurrence of the keywords of the emergency plan text in the emergency plan text is higher than a target threshold; Performing weighted summation on the first matching value, the second matching value, and the third matching value to obtain the matching degree between the candidate theme and the emergency plan text; Determining the target theme of the emergency plan text based on the matching degrees of the candidate themes and the emergency plan text.
3. The method according to claim 1 or 2, characterized in that, The dividing the emergency plan text into regions based on the target theme, and obtaining the target text of the main text region includes: Obtaining at least one pair of start keywords and end keywords corresponding to the target theme; For each pair of start keywords and end keywords, obtaining the target text of the main text region in the target theme that is between the start keyword and the end keyword.
4. The method according to claim 3, characterized in that, Before the performing knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities, the method further includes: Performing word segmentation on the target text, and performing part-of-speech analysis on each obtained target word; Based on the word relationships between the target words and the punctuation marks in the target text, performing sentence splitting on the target text to obtain the target text after sentence splitting; The performing knowledge extraction on the target text through a target knowledge extraction model to obtain target entities and the relationships between the target entities includes: Performing knowledge extraction on the target text after sentence splitting through a target knowledge extraction model to obtain the target entities and the relationships between the target entities.
5. The method according to claim 4, characterized in that, The target text after sentence splitting includes at least one target sentence; Before extracting knowledge from the target text after clause splitting through the target knowledge extraction model to obtain the target entities and the relationships between the target entities, the method further includes: For each target sentence, detect the word - relationship between each word in the target sentence; When the target word - relationship is missing in the target sentence, perform a completion operation on the target sentence according to the target word - relationship and the target paragraph where the target sentence is located.
6. The method according to claim 5, characterized in that, The step of "when the target word - relationship is missing in the target sentence, perform a completion operation on the target sentence according to the target word - relationship and the target paragraph where the target sentence is located" includes: When there is an object - verb relationship in the target sentence and no subject - verb relationship, complete the subject of the target sentence according to the candidate subjects in the target paragraph; When there is a subject - verb relationship in the target sentence and no object - verb relationship, merge the next sentence of the target sentence with the target sentence.
7. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain a training plan text; the training plan text contains entity annotation information; the entity annotation information is used to indicate the sentence where the entity is located, the entity category, and the entity content; Through an initial knowledge extraction model, perform knowledge extraction on the training plan text, and perform iterative updates on the initial knowledge extraction model for a target number of times according to the extraction results and the entity annotation information to generate the target knowledge extraction model.
8. An emergency plan knowledge graph construction device, characterized in that, The device includes: An ontology construction module, configured to construct an ontology graph of a target knowledge graph; the ontology graph of the target knowledge graph contains entities and the relationships between the entities; A plan text acquisition module, configured to acquire an emergency plan text; A similarity matching module, configured to perform similarity matching between the emergency plan text and each candidate topic to obtain a matching degree, and determine the target topic corresponding to the emergency plan text from each candidate topic based on the matching degree; A region division module, configured to perform region division on the emergency plan text based on the target topic and obtain the target text of the main text region; A knowledge extraction module, configured to extract knowledge from the target text through the target knowledge extraction model to obtain the target entities and the relationships between the target entities; A graph construction module, configured to associate the target entities and the relationships between the target entities with the ontology graph of the emergency plan knowledge graph to construct an emergency plan knowledge graph.
9. A computer device, which includes a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory. The at least one instruction, at least one program, the code set or the instruction set is loaded and executed by the processor to implement the emergency plan knowledge graph construction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that At least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the emergency plan knowledge graph construction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Event graph construction method based on social media
CN108763333A
Text topic generation method and device and electronic equipment
CN111241282A