Pre-event text extraction method and device, and storage medium
By parsing and locating emergency response plan documents, and using UIE, TextCNN, and PL-Maker models to extract entities and relationships, the system achieves automated management of emergency response plan texts, solving the problem of low efficiency in emergency response plan document management and supporting the digital transformation of plan texts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN URBAN PUBLIC SAFETY & TECH INST CO LTD
- Filing Date
- 2023-02-21
- Publication Date
- 2026-06-05
AI Technical Summary
Emergency response plans are numerous, widely distributed, non-standardized, and constantly being updated. Existing methods of manually compiling these documents are labor-intensive and time-consuming, resulting in low information management efficiency. Traditional methods are insufficient to meet the needs of emergency response plans in terms of relevance, systematicness, and practicality.
This invention provides a method and apparatus for extracting emergency plan texts. By parsing the emergency plan document, locating the text block content, extracting entities and entity relationships, and using UIE model, TextCNN model and PL-Maker model to build relationships, the invention achieves automated management of emergency plan texts.
It improves the efficiency of information management of emergency response plan texts, supports the transformation and upgrading of massive emergency response plan texts from electronic to digital, and solves the problems of automatic extraction of key elements and relationship building.
Smart Images

Figure CN116340532B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to a method, apparatus and storage medium for extracting a pre-planned text. Background Technology
[0002] Emergency response plans are the core brain of emergency command and the guiding force for emergency response. The digitalization of emergency response plans is a crucial aspect of modernizing the emergency management system and capabilities. It can thoroughly address pain points such as weak targeting, incomplete systems, and insufficient practicality in emergency response plans. It is a product of the dual breakthroughs and integration of cognitive intelligence technology and emergency management systems. Given the diversity and interconnectedness of emergency response plans across different disaster chain scenarios and response units, traditional methods of plan development and management are insufficient to meet the increasingly demanding requirements for targeted, systematic, and practical emergency response.
[0003] Emergency response plan documents are numerous, and due to the aforementioned problems, they cannot effectively assist in decision-making during the handling of sudden events. Therefore, it is necessary to standardize and digitize emergency response plan documents for effective use. Furthermore, in the practical application of emergency response plan document organization, the inventors found that given the large number, wide distribution, lack of standardization, and continuous addition of new emergency response plan documents, existing manual document organization methods are labor-intensive, time-consuming, and lack the necessary personnel with the business knowledge and organizational skills to handle such a massive workload, resulting in low information management efficiency for emergency response plan texts.
[0004] Therefore, it is necessary to propose a solution to improve the efficiency of text information management. Summary of the Invention
[0005] The main purpose of this application is to provide a method, apparatus and storage medium for extracting contingency plan texts, which aims to improve the efficiency of information management of contingency plan texts.
[0006] To achieve the above objectives, this application provides a method for extracting contingency plan text, the method comprising:
[0007] In response to obtaining the contingency plan document, contingency plan data is obtained by parsing the contingency plan document.
[0008] Locate the text block content based on the aforementioned plan data;
[0009] Entities and entity relationships are extracted from the text block content, and relationships are constructed based on the entities and entity relationships.
[0010] The step of locating the text block content based on the pre-plan data includes:
[0011] Obtain the chapter directory and main text content of the contingency plan data, locate the chapter on organizational structure and responsibilities based on the chapter directory and main text content, and / or locate the chapter on scenario instructions for the organizational structure based on the chapter directory.
[0012] This application also proposes a plan text extraction device, the plan text extraction device comprising:
[0013] The data parsing module is used to parse the structured plan data based on the plan document in response to the acquisition of the plan document.
[0014] The text location module is used to locate text block content based on the structured plan data, specifically including: obtaining the chapter directory and main text content of the plan data, locating the organizational structure and responsibilities chapter based on the chapter directory and main text content, and / or locating the scenario instruction chapter of the organizational structure based on the chapter directory;
[0015] The entity extraction module is used to extract entities and entity relationships based on the content of the text block, and to build relationships based on the entities and entity relationships.
[0016] This application also proposes a computer-readable storage medium storing a pre-planned text extraction program, which, when executed by a processor, implements the steps of the pre-planned text extraction method as described above.
[0017] The contingency plan text extraction method, apparatus, and storage medium proposed in this application, in response to obtaining a contingency plan document, parse the contingency plan data from the document; locate text block content based on the contingency plan data; extract entities and entity relationships based on the text block content; and construct relationships based on the entities and entity relationships. Based on this application's solution, through contingency plan text parsing, text block content location, entity and entity relationship extraction, and relationship construction, the technical problems of automatically extracting key elements and constructing relationships in emergency contingency plan texts are solved. Furthermore, it supports the transformation and upgrading of massive amounts of contingency plan texts from electronic to digital, improving the information management efficiency of contingency plan texts. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the functional modules of the terminal equipment to which the text extraction device of this application belongs;
[0019] Figure 2 This is a flowchart illustrating a first exemplary embodiment of the text extraction method for the present application.
[0020] Figure 3 This is a flowchart illustrating the process of locating the organizational structure and responsibilities section in the second exemplary embodiment of the text extraction method for this application.
[0021] Figure 4 This is a flowchart illustrating the process of locating the contextual instruction chapter of an organization involved in the second exemplary embodiment of the text extraction method of this application.
[0022] Figure 5 This is a schematic diagram of the chapter directory involved in the fourth exemplary embodiment of the text extraction method of this application;
[0023] Figure 6 This is a schematic diagram of the parent-child hierarchical tree structure involved in the fourth exemplary embodiment of the text extraction method of this application.
[0024] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0025] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0026] Technical terms used in the embodiments of this application:
[0027] Document-oriented information extraction;
[0028] UIE model;
[0029] TextCNN model;
[0030] Solid markers;
[0031] Levitated markers.
[0032] Among these, document-oriented information extraction has always been at the forefront of text intelligence technology's practical application. Currently, in industry-implemented systems, apart from some practical results in extracting standardized documents for specific fields, there are no practically applicable systems for extracting diverse, non-standard format professional documents. The entire process of pre-planned information extraction involves text parsing, text block location, and text information extraction (including named entity recognition and relation extraction).
[0033] In the field of text parsing—that is, restoring PDF or Word documents to their original layout—there are numerous open-source tools, such as OpenCV, pdfplumber, Camelot, and Tabula. While these tools can extract text information from PDFs and Word documents containing text layers, they lose the original text's hierarchical information, such as the hierarchy of headings and text blocks. Therefore, these open-source tools cannot directly fulfill the requirement of restoring the original document's layout. Thus, how to restore such hierarchical layouts has become one of the problems that needs to be solved.
[0034] In terms of text block localization, specifically when the text we need to focus on only occupies a portion of the document, how do we locate the paragraphs we require based on information such as titles and body text? Essentially, this is a text classification problem. Currently, text-related algorithms in natural language processing are iterating and updating very rapidly. Before 2018, traditional algorithms such as XGBoost, TextCNN, FastText, and LSTM were commonly used. While these algorithms are simple and convenient, their significant drawback is insufficient context encoding. Since Google released the pre-trained BERT model in 2018, various BERT variants have emerged, such as Roberta, trained with larger datasets and more resources; XLNet, which uses a ranking language model; and Longformer, which supports longer contexts. These models are large-scale pre-trained language models based on general corpora. However, for specific business scenarios and tasks (such as information extraction), fine-tuning requires a large amount of data to achieve good results. The subsequent emergence of T5 (Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer) brought a new paradigm to pre-training, allowing almost all NLP tasks to be transformed into a seq2seq model, and also sparked the wave of prompt learning. Large pre-trained models can incorporate additional business knowledge into the model through prompts. Therefore, for specific business scenarios, how to effectively input business knowledge into the model has become one of the problems that pre-plan text analysis needs to solve.
[0035] In terms of text information extraction, named entity recognition (NER) involves extracting desired entities from filtered text. Current NER methods can be broadly categorized into three types based on the annotation methods used:
[0036] 1) BIO's labeling system: The main model under this system is LSTM+CRF. This solution is suitable for situations where there are few entity label categories and no entity nesting. It is simple and easy to implement.
[0037] (ii) Pointer labeling: Mark the start and end of each span. For multi-segment extraction problems, this is transformed into N binary classifications (N is the sequence length). If multiple categories are involved, it can be transformed into a cascaded pointer labeling (C pointer networks, where C is the total number of categories). In fact, pointer labeling has become a powerful tool for unifying entity, relation, and event extraction.
[0038] (iii) Multi-head labeling: Labeling each token pair essentially involves constructing an N*N classification matrix (where N is the sentence length), which can be used for entity or relation extraction. The key is how to powerfully represent and construct this classification matrix. In fact, multi-head labeling has become the preferred tool for many state-of-the-art entity and relation extraction methods.
[0039] Entities in the contingency plan text can include a wide range of entities such as organizations, responsibilities, scenarios, instructions, responders, and respondees, as well as long entities, nested entities, and discontinuous entities. Therefore, choosing a reasonable annotation framework and model is one of the problems that needs to be solved in the named entity recognition stage.
[0040] Relation extraction of entities involves identifying relationships among the extracted entities and constructing triples by associating pairs of entities. Relation extraction models fall into two paradigms depending on the process:
[0041] (i) Pipeline Model: Entities are extracted first, then relationships are determined. A well-known algorithm is Chen Danqi's "A Frustratingly Easy Approach for Joint Entity and Relation Extraction," whose main contribution is the design of a very simple end-to-end relation extraction method. This method uses two independent encoders for entity extraction and relation recognition, respectively, and surpasses all previous joint models using the same pre-trained model. Learning different contextual representations of entities and relations separately is more effective than jointly learning them. Integrating entity category information at the input layer of the relation model is crucial. The algorithm proposes a novel and effective approximation method that achieves an 8-16x speedup in inference with minimal accuracy degradation.
[0042] (ii) Joint Extraction Mode: Extracting entities and relations together. A typical model is TPLinker: Single-stage Joint Extraction of Entities and Relations Through Token PairLinking. Its highlight is that TPLinker unifies the extraction annotation framework into a character pair linking problem, i.e., the token pair linking problem. TPLinker can solve both the overlapping relation problem and the exposure bias problem. TPLinker is a single-stage decoding model, and there is no difference in the extracted triples between the training and inference stages.
[0043] Among these methods, the Pipeline approach is easy to implement, offers high flexibility in its two-stage extraction models, and allows for the use of independent datasets for the entity and relation models. However, it suffers from the following drawbacks: error accumulation, where errors in entity extraction negatively impact the performance of subsequent relation extraction; entity redundancy, as pairing extracted entities before relation classification introduces redundant information from candidate entity pairs without relationships, increasing the error rate and computational complexity; and missing interactions, as it ignores the inherent connections and dependencies between the two tasks.
[0044] Joint extraction methods share encoders during the construction of entity and relation models, design a unified joint extraction annotation framework, achieve joint extraction, and resolve exposure bias. They can also handle complex nested NER and complex overlapping relation extraction. However, if joint extraction is used to extract from the prepared text, the following problems may arise: due to the excessive length of the prepared text, entity nesting, and complex relation construction, the semantic space of the model is prone to overfitting when the corpus is insufficient.
[0045] Each of the above methods has its own advantages and disadvantages. Considering the characteristics of the plan text, even if the current pre-trained model is powerful enough, it is still necessary to consider the sensitivity of the text embedding layer to the plan data, and at the same time, the consistency between the downstream task and the pre-training should also be considered.
[0046] UIE model
[0047] The UIE model is an open-source model from Baidu's information extraction team. UIE (Unified Structure Generation for Universal Information Extraction) is a unified text-to-structure generation framework for information extraction proposed by Dr. Lu in this ACL 2022 paper. UIE can: uniformly model different IE tasks; adaptively generate target structures; and uniformly learn general information extraction capabilities from different knowledge sources. This model is trained on a series of information extraction tasks using T5 on large-scale data, achieving excellent zero-shot performance for data in vertical domains.
[0048] TextCNN model
[0049] The TextCNN (Convolutional Neural Networks for Sentence Classification) model's core idea is to extract local features from text: it extracts N-gram information from the text using different convolutional kernel sizes (more precisely, kernel height), then uses max pooling to highlight the most crucial information extracted by each convolutional operation, concatenates the features, combines them through a fully connected layer, and finally trains the model using a cross-entropy loss function. The advantages of the TextCNN model are its simplicity, obvious results, and simple architecture that allows for easy modification.
[0050] Solid markers
[0051] The Solid markers method explicitly inserts solid markers at the beginning and end of a span to highlight it in the input text. For object-subject span pairs, it inserts a separate pair of solid markers before and after the subject span and object span, respectively. This method struggles with multiple object-subject pairs because it cannot distinguish between different objects and subjects within the same sentence, nor can it handle overlapping spans.
[0052] Levitated markers
[0053] The Levitated markers method first sets up a pair of levitated markers, making them share the same positional information as the boundary tokens of the span. Then, it binds the pair of levitated markers together using a directed attention mechanism. Specifically, the two markers in the levitated markers are made visible to each other in the attention mask matrix, but invisible to the text token and other levitated markers.
[0054] Therefore, the solution of this application utilizes cutting-edge cognitive intelligence technology and develops algorithms such as contingency plan text parsing, text block positioning, organizational structure and responsibility entity relationship extraction, and task instruction extraction to achieve automatic extraction and relationship construction of key elements such as organizational structure, responsibilities, scenarios, and instructions in emergency contingency plan texts, supporting the transformation and upgrading of massive contingency plan texts from electronic to digital.
[0055] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the proposed text extraction device belongs. The proposed text extraction device can be independent of the terminal device, capable of parsing proposed text, locating text blocks, extracting entities and entity relationships, and constructing entity relationships. It can be implemented on the terminal device in hardware or software form. The terminal device can be a smart mobile terminal with data processing capabilities, such as a mobile phone or tablet computer, or a fixed terminal device or server with data processing capabilities.
[0056] In this embodiment, the terminal device to which the pre-planned text extraction device belongs includes at least an output module 110, a processor 120, a memory 130, and a communication module 140.
[0057] The memory 130 stores the operating system and the pre-plan text extraction program. The pre-plan text extraction device can store information such as the acquired pre-plan document, the pre-plan data obtained from parsing the pre-plan document, the text block content located based on the pre-plan data, the entities and entity relationships extracted from the text block content, and the relationships built based on the entities and entity relationships in the memory 130. The output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with external devices or servers through the communication module 140.
[0058] When the pre-planned text extraction program in memory 130 is executed by the processor, it performs the following steps:
[0059] In response to obtaining the contingency plan document, contingency plan data is obtained by parsing the contingency plan document.
[0060] Locate the text block content based on the aforementioned plan data;
[0061] Entities and entity relationships are extracted from the text block content, and relationships are constructed based on the entities and entity relationships.
[0062] The step of locating the text block content based on the pre-plan data includes:
[0063] Obtain the chapter directory and main text content of the contingency plan data, locate the chapter on organizational structure and responsibilities based on the chapter directory and main text content, and / or locate the chapter on scenario instructions for the organizational structure based on the chapter directory.
[0064] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0065] Obtain the chapter title of each level of the chapter directory, and identify the organizational entity of the chapter title based on the chapter title and the named entity recognition model, wherein the named entity recognition model is trained based on the text content;
[0066] The chapter titles are categorized and tagged based on the organizational entity to obtain the tag conversion results for the chapter titles;
[0067] Based on the tag conversion results of the chapter titles and the UIE classification model, the chapters on organizational structure and responsibilities are located.
[0068] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0069] Obtain the chapter titles of each level of the chapter directory, and annotate the corpus based on the chapter titles to obtain the annotated chapter directory;
[0070] The chapter titles containing hierarchical information are obtained by processing the annotated chapter table of contents and title hierarchy information;
[0071] The organizational structure's contextual instruction chapters are obtained by locating chapter titles containing hierarchical information and using the TextCNN classification model.
[0072] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0073] Obtain the organizational structure and responsibilities section, and extract the organizational structure and responsibilities entities and entity relationships of the section content based on the organizational structure and responsibilities section;
[0074] Obtain the contextual instruction chapters of the organization, and extract the contextual instruction entities and entity relationships of the organization from the chapter content based on the contextual instruction chapters of the organization.
[0075] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0076] Obtain the organizational structure, responsibilities, entities, and relationships. Then, construct the organizational structure and responsibilities relationships using a subject-first PL-Maker model. The subject-first PL-Maker model is obtained by inputting business knowledge into the algorithm model for training based on the characteristics of the pre-plan text.
[0077] Obtain the contextual command entities and entity relationships of the organization, and construct the contextual command relationships of the organization using the subject-first PL-Maker model.
[0078] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0079] Obtain a watermarked PDF document, and remove the watermark from the watermarked PDF document to obtain a watermark-free PDF document;
[0080] The watermark-removed PDF document is then repaired and converted into a docx document;
[0081] The data is structured based on the docx document to obtain structured preliminary plan data.
[0082] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0083] The hierarchical structure is identified based on the table of contents numbers in the document to obtain the directory hierarchy information;
[0084] Chapter hierarchy information is obtained based on chapter titles, appendix titles, and / or ordered text annotations;
[0085] Match the directory hierarchy information and the chapter hierarchy information to construct the parent-child hierarchy relationship of the titles in the main text;
[0086] The hierarchical relationship between the titles and the text blocks in the body can be recovered by analyzing the relative positions of the titles in the body.
[0087] Furthermore, when the pre-selected text extraction program in memory 130 is executed by the processor, it also performs the following steps:
[0088] Obtain the chapter title and / or the attachment title, perform line parsing based on the chapter title and / or the attachment title, and generate a standard format chapter title and / or a standard format attachment title;
[0089] Obtain the chapter titles in the standard format, perform block parsing based on the chapter titles in the standard format, and generate a chapter table of contents in the standard format;
[0090] Obtain the attachment title in the standard format, perform block parsing based on the attachment directory in the standard format, and generate an attachment list in the standard format.
[0091] This embodiment, through the above-described solution, specifically involves responding to the acquisition of a contingency plan document, parsing the document to obtain contingency plan data, locating text block content based on the contingency plan data, extracting entities and entity relationships from the text block content, and constructing relationships based on the entities and entity relationships. Based on this application's solution, by parsing the contingency plan text, locating text block content, extracting entities and entity relationships, and constructing relationships, the technical problems of automatically extracting key elements and constructing relationships in emergency contingency plan texts are solved. Furthermore, it supports the transformation and upgrading of massive amounts of contingency plan texts from electronic to digital, improving the information management efficiency of contingency plan texts.
[0092] Based on, but not limited to, the terminal device architecture described above, this application proposes method embodiments.
[0093] First Embodiment
[0094] Reference Figure 2 , Figure 2 This is a flowchart illustrating a first exemplary embodiment of the proposed text extraction method of this application. The executing entity of this embodiment can be a proposed text extraction device, a proposed text extraction terminal device, or a server. This embodiment uses a proposed text extraction device as an example, which can be integrated into a terminal device such as a smartphone or tablet computer with data processing capabilities. In this embodiment, the proposed text extraction method includes:
[0095] Step S10: In response to obtaining the plan document, the plan data is obtained by parsing the plan document.
[0096] Specifically, in response to obtaining the contingency plan document, contingency plan data is obtained by parsing the obtained contingency plan document. The contingency plan document serves as an action guide for various organizations under disaster conditions, covering aspects such as organizational structure, responsibilities, scenarios, and instructions / actions. Optionally, the contingency plan document can be parsed using OCR, text rule parsing algorithms, or multimodal LayoutL algorithms, etc.
[0097] For example, the current parsing of the plan document only calls the text information, and the utilization rate of the information at the PDF image level is still not high. However, in this example, when parsing the plan document based on the model annealing algorithm, deep learning can be used to conduct multimodal research on the document. By using the multimodal information of the document, the PDF or Word document can be parsed by an algorithm combining NLP and CV, and better parsing results can be obtained.
[0098] Step S20: Locate the text block content based on the pre-plan data.
[0099] Furthermore, as one implementation, step S20 above, locating the text block content saving according to the pre-plan data, may include:
[0100] Obtain the chapter directory and main text content of the contingency plan data, locate the chapter on organizational structure and responsibilities based on the chapter directory and main text content, and / or locate the chapter on scenario instructions for the organizational structure based on the chapter directory.
[0101] It should be noted that, in this embodiment, the text block content located based on the parsed contingency plan data mainly involves chapter content containing two key elements: the organizational structure and its corresponding responsibilities, and the organizational structure's instructions and actions under different scenarios. In other embodiments, chapter content containing other elements in the contingency plan document can also be located based on relevant contingency plan data.
[0102] Specifically, the chapter directory and main text of the contingency plan data are obtained, and the chapter on organizational structure and responsibilities is located based on the obtained chapter directory and main text, and / or, the chapter on scenario instructions of the organizational structure is located based on the obtained chapter directory.
[0103] By following the steps above, we can locate the sections in the contingency plan document that describe the organization's responsibilities or scenario instructions, reduce the boundaries of text blocks, and reduce invalid contextual information for subsequent information extraction.
[0104] More specifically, in locating the chapters on organizational structure and responsibilities, the paragraphs to be extracted are analyzed based on the information in their context. Since the distribution of organizational structure and responsibilities within the context is relatively concentrated, and the heading information is relatively ambiguous, it is not possible to determine their location solely using the headings. Therefore, the characteristics of the heading information and the main body content of the paragraph are considered together. In locating the chapters on situational instructions within the organizational structure, because the distribution of situational instructions within the context is relatively scattered, and the heading information is relatively clear, the location of the specific chapter can be determined using only the heading information.
[0105] Step S30: Extract entities and entity relationships based on the text block content, and build relationships based on the entities and entity relationships.
[0106] Specifically, entities and entity relationships are extracted from the content of the located text blocks, and then relationships are constructed based on the extracted entities and entity relationships. The text block content may include one or more of the following: an organizational structure and responsibilities section and an organizational structure contextual instructions section.
[0107] More specifically, if the located text block content is the "Organizational Structure and Responsibilities" section, then named entity recognition is performed based on this section to extract entities and entity relationships. After extraction, an organizational structure tree is constructed based on the extracted entities and relationships. This tree presents the organizational structure, with nodes representing organizations and their attributes representing their responsibilities. Entity extraction for organizational structures and responsibilities can utilize pointer annotation, which has the advantage of handling nested and complex entities. Entity relationship extraction for organizational structures and responsibilities can be performed in stages, rather than a joint extraction approach. This is because the entities described in the organizational structure and responsibilities section of the plan exhibit the following characteristics: long entities, nested entities, and discontinuous entities. Relationship construction exhibits the following characteristics: one-to-many, many-to-one, and complex relationships. Therefore, using a staged approach to extract entities and relationships allows for intervention at each stage using additional knowledge.
[0108] If the located text block contains the scenario-based instructions section of an organization, then the organization's task data in the contingency plan is identified based on this section, and the task data is extracted. This extraction includes: task executor extraction, task action content extraction, and task triggering conditions extraction (emergency response level, early warning response level, scenario). By establishing relationships between the extracted content, a scenario-instruction-task table is output.
[0109] This embodiment, through the above-described solution, specifically involves responding to the acquisition of a contingency plan document, parsing the document to obtain contingency plan data, locating text block content based on the contingency plan data, extracting entities and entity relationships from the text block content, and constructing relationships based on the entities and entity relationships. Based on this application's solution, by parsing the contingency plan text, locating text block content, extracting entities and entity relationships, and constructing relationships, the technical problems of automatically extracting key elements and constructing relationships in emergency contingency plan texts are solved. Furthermore, it supports the transformation and upgrading of massive amounts of contingency plan texts from electronic to digital, improving the information management efficiency of contingency plan texts.
[0110] Second Embodiment
[0111] Based on the first embodiment described above, in this embodiment, the step of locating the organizational structure and responsibility chapters according to the chapter directory and main text content may include:
[0112] Step S211: Obtain the chapter title of each level of chapter directory, and identify the organizational entity of the chapter title based on the chapter title and the named entity recognition model, wherein the named entity recognition model is trained based on the text content.
[0113] Specifically, the chapter titles of each level of the preliminary plan data are obtained. Based on the obtained chapter titles, the organizational entities in the chapter titles are identified using a named entity recognition (NER) model. The NER model is trained using the main text content of the preliminary plan data. Optionally, the NER model is a fine-tuned version of the UIE model using the main text content. This NER model can remove invalid information from chapter titles, identify organizational entities, and simplify the original chapter titles after identification, facilitating subsequent classification model judgment.
[0114] For example, refer to Figure 3 To obtain all directories under each first-level chapter of a draft plan, we denote each first-level chapter directory and all its subdirectories as Ci, where Ci consists of chapter titles (t1, t2, ..., tn). For each chapter title (t1, t2, ..., tn) in Ci, we first perform stop word cleaning to remove interfering information such as numbers, special characters, and chapter identifiers (e.g., "Chapter 1"), resulting in Ci'. For example, ['1 General Principles', '1.1 Compilation'] becomes ['General Principles', 'Compilation'].
[0115] The NER model was trained as follows: A small sample of organizational structures and corresponding responsibilities were manually selected from the pre-defined plan. Pointer annotation was used to label the entities [organizational structure and personnel role]. Then, the UIE model was fine-tuned on the collected dataset to obtain an NER model capable of recognizing [organizational structure and personnel role].
[0116] Based on the NER model, each chapter title (t1, t2, ..., tn) in Ci' is subjected to NER entity recognition, and the recognized entities are replaced with entity labels (the label set for the NER entity recognition process is: organization, personnel role, and responsibility). For titles where NER recognition is empty, the original title content is retained, resulting in (t1', t2', ..., tn'). The process of entity recognition for titles is as follows:
[0117] ['General Principles', 'Purpose of Compilation', 'Compilation Principles', 'Organization and Responsibilities', 'Emergency Command Center and Responsibilities', 'Emergency Command Center Office and Responsibilities', 'Emergency Rescue Teams and Responsibilities'] After entity recognition by NER, the Emergency Command Center, Emergency Command Center Office, and Emergency Rescue Teams are all identified as organizational structures. Therefore, this data will be replaced with: ['General Principles', 'Purpose of Compilation', 'Compilation Principles', 'Organization and Responsibilities', '[Organization] and Responsibilities', '[Organization] and Responsibilities', '[Organization] and Responsibilities'].
[0118] Step S212: Based on the organizational entity, the chapter title is categorized and tagged to obtain the tag conversion result of the chapter title.
[0119] Specifically, each chapter title (t1', t2', ..., tn') is categorized and labeled based on the identified organizational entity to unify the entities in the chapter titles after NER (Network Entity Recognition) and reduce invalid information in the classification model. Optionally, the label content is [0, 1], where 0 indicates that it is not a paragraph describing the organization and its responsibilities, and 1 indicates that it is a paragraph title describing the organization and its responsibilities. The transformation model uses UIE (Unified Institutional Entity Recognition), and the result is (positive, negative). Negative: indicates that the title does not belong to [organization], positive: indicates that the title belongs to [organization].
[0120] For example, the dataset ['General Principles, Category [Positive, Negative]', 'Purpose of Compilation, Category [Positive, Negative]', 'Compilation Principles, Category [Positive, Negative]', 'Organization and Responsibilities, Category [Positive, Negative]', '[Organization] and Responsibilities, Category [Positive, Negative]', '[Organization] Responsibilities, Category [Positive, Negative]'] is input into the model for binary classification. The model infers and obtains the label transformation results of the chapter titles [Negative, Negative, Negative, Positive, Positive, Positive, Positive]. Among them, the paragraphs corresponding to the titles judged as positive are the target paragraphs / chaps.
[0121] Step S213: Based on the tag conversion results of the chapter titles and the UIE classification model, the chapter is located to obtain the chapter on organizational structure and responsibilities.
[0122] Specifically, based on the tag conversion results of the chapter titles and the UIE classification model, the content blocks of the chapters on organizational structure and responsibilities are obtained through filtering and positioning according to rules.
[0123] Furthermore, as one implementation, the step of locating the contextual instruction chapter of the organization based on the chapter directory may include:
[0124] Step S221: Obtain the chapter titles of each level of the chapter directory, and annotate the corpus according to the chapter titles to obtain the annotated chapter directory;
[0125] Step S222: Process the annotated chapter directory and title hierarchy information to obtain chapter titles containing hierarchy information.
[0126] Step S223: Based on the chapter titles containing hierarchical information and the TextCNN classification model, the chapter is located to obtain the contextual instruction chapters of the organization.
[0127] For example, the chapter titles of each level of the chapter directory in the contingency plan data are obtained, where each chapter title contains heading level information. The chapter titles are then annotated with corpus data to obtain the annotated chapter directory shown in Table 1 below:
[0128] Table of Contents Heading Level Table of contents Directory Tags 1 General Principles 0 1.1 Purpose of compilation 0 1.2 Basis for compilation 0 1.3 Disaster Classification 0 1.4 Compilation Principles 0 1.5 Scope of application 0 2 Organizational structure and responsibilities 0 2.1 District Forest Fire Prevention Command and its member units 0 2.2 District Forest Fire Prevention Command Office 0 2.3 Street Forest Fire Prevention Command 0 3 Operating mechanism 0 3.1 Pre-monitoring and early warning 1 4 Rainstorm warning 1 5 Emergency Response 2 5.1 General Requirements 2 5.2 Emergency Response Action 2 5.2.1 Level of Attention Emergency Response 2 5.2.2 Level IV Emergency Response 2 6 Emergency support measures 3 7 Key points for on-site handling 4
[0129] Table 1: Annotated Chapter List
[0130] The tags include: negative, early warning, emergency response, key points of on-site response, and emergency support. The definitions of the titles are shown in Table 2 below:
[0131] Label Tag definition 0 Negative: Non-target sections, such as: General Provisions, Organizational Structure, Annexes, Post-Disaster Management, etc. 1 Early Warning: The section on early warning response task instructions is usually located in: Operational Mechanism - Prevention, Monitoring and Early Warning - Early Warning 2 Emergency Response: This section covers scenario-based task instructions, including content related to emergency response actions. It is typically found under: Operational Mechanisms - Emergency Response and Rescue (excluding post-incident handling and on-site handling points). 3 Emergency Support: This section describes detailed instructions for pre-event, during-event, and post-event support. It is typically found under the sections on Emergency Support / Preparation and Support / Support Measures. 4 Key points for on-site handling: The key points for on-site handling are usually described in more detail than the handling measures, and are typically found under: Operational Mechanism - Emergency Response and Rescue - Key Points for On-site Handling.
[0132] Table 2: Location Label Table for Organizational Contextual Instruction Paragraphs
[0133] Since chapter titles contain hierarchical information, the chapter titles containing hierarchical information are obtained by processing the annotated chapter table of contents and title hierarchy information. The data processing procedure is shown in Table 3 below:
[0134] title Table of Contents 1 General Principles 1.1 General Provisions ## Purpose of Compilation 1.2 General Provisions ## Basis for Compilation 1.3 General Principles ## Working Principles 1.4 General Principles ## Disaster Classification 1.5 General Provisions ## Scope of Application 2 Organizational structure and responsibilities 2.1 Organizational Structure and Responsibilities: ## District Forest Fire Prevention Command and its member units 2.2 Organizational Structure and Responsibilities of the District Forest Fire Prevention Command Office 2.3 Organizational Structure and Responsibilities ## Street Forest Fire Prevention Command 3 Operating mechanism 3.1 Operational Mechanism ##Pre-monitoring and Early Warning 3.1.1 Operational Mechanism ##Pre-monitoring and Early Warning ##Prevention 3.1.2 Operational Mechanism ##Pre-monitoring and Early Warning ##Monitoring 3.1.3 Operational Mechanism ##Pre-monitoring and Early Warning ##Early Warning 3.1.3.1 Operational Mechanism ##Pre-monitoring and Early Warning ##Early Warning ##Early Warning Classification
[0135] refer to Figure 4 At the data processing level, the body text of the subheading will be concatenated with the body text of the parent heading, using ## as the separator. The pre-set heading hierarchy in the contingency plan is four levels: 1, 1.1, 1.1.1, and 1.1.1.1.
[0136] Let the text of the original title be x_i, where i represents the i-th level (i∈[1,4]). After passing through Tencent's word vector encoding layer C, the encoded text is a vector c_i, where:
[0137] The first level of data input is: c_1
[0138] The second level of data input is: c_1, c_2
[0139] The data input for the third level is: c_1, c_2, c_3
[0140] The data input for the fourth level is: c_1, c_2, c_3, c_4
[0141] The data at each level above is processed through a linear layer to obtain the result L_i. Then, L_i is processed by the TextCNN classification model to locate the chapter and obtain the contextual instruction chapter of the organization.
[0142] This embodiment's solution develops its own chapter location algorithm based on the UIE and TextCNN models. The UIE-based organizational structure and responsibility chapter location method is a text block location method that combines rich body text information with headings. The TextCNN-based organizational structure and contextual instruction chapter location method is a text block location method that focuses on hierarchical heading semantic analysis. These two solutions in this embodiment exhibit excellent generalization performance, considering not only the body text information but also the encoding of hierarchical heading information, making text location more flexible and significantly improving the precision and recall of the proposed solution.
[0143] Third Embodiment
[0144] Based on the first or second embodiment described above, in this embodiment, the steps of extracting entities and entity relationships based on the text block content may include:
[0145] Step S311: Obtain the organizational structure and responsibilities section, and extract the organizational structure and responsibilities entities and entity relationships of the section content based on the organizational structure and responsibilities section.
[0146] Specifically, the system retrieves the identified organizational structure and responsibility sections, and then extracts the organizational structure and responsibility entities and their relationships from the section content through phased extraction. Optionally, the phased extraction can employ a UIE model.
[0147] For example, the organizational structure and responsibilities section of the location identification is obtained, and the entity labels in the corpus are labeled using pointer annotation on the doccano annotation platform. The entity labels can include organizations (such as emergency organizations, permanent organizations, or special organizations); permanent organization roles, which refer to the personnel in the [permanent organization]; emergency organization personnel roles, which refer to the personnel in the [emergency organization]; long entities, which refer to text fragments containing multiple organizations, which need to be processed separately later; and responsibilities, which refer to the responsibilities undertaken by the [organization] in emergency events.
[0148] When the model input is: {"text": "Professional emergency rescue teams. Each team is responsible for on-site emergency response and support for hazardous chemical accidents according to its own characteristics, collaborates with comprehensive emergency rescue teams to complete rescue tasks, provides professional technical support, and accepts command from the on-site leader of the comprehensive emergency rescue team. An emergency duty system is established, emergency duty personnel are assigned, daily training and assessment are strengthened, practical skills are improved, and the rescue team plays a role in preventative inspections and safety technical services."}, then the model output will be: Professional emergency rescue teams [Institution, 0.99]. Each team is responsible for on-site emergency response and support for hazardous chemical accidents according to its own characteristics, collaborates with comprehensive emergency rescue teams [Institution, 0.96] to complete rescue tasks, provides professional technical support, and accepts command from the on-site leader of the comprehensive emergency rescue team [Emergency Institution Role, 0.94]. An emergency duty system is established, emergency duty personnel are assigned, daily training and assessment are strengthened, practical skills are improved, and the rescue team plays a role in preventative inspections and safety technical services [Responsibilities, 0.98].
[0149] The original output of the model was: [{"text": "Comprehensive Emergency Rescue Team", "start": 40, "end":49, "probability": 0.9639429281364187, "label": "Institution"}, {"text": "Professional Emergency Rescue Team", "start": 0, "end": 8, "probability": 0.9922333970707946, "label": "Institution"}, {"text": "On-site Leader of Comprehensive Emergency Rescue Team", "start": 71, "end": 86, "probability": 0.9407459274707719, "label": "Role of Emergency Organization"}, {"text": "Each team is responsible for on-site emergency response and support for hazardous chemical accidents according to their respective characteristics, collaborates with comprehensive emergency rescue teams to complete rescue missions, provides professional technical support, and accepts command from the on-site leader of the comprehensive emergency rescue team. An emergency duty system is established, emergency duty personnel are assigned, daily training and assessments are strengthened, practical skills are improved, and the rescue team plays a role in preventative inspections and safety technical services."
[0150] Step S312: Obtain the scenario instruction chapter of the organization, and extract the scenario instruction entity and entity relationship of the organization from the chapter content based on the scenario instruction chapter of the organization.
[0151] Specifically, the scenario instruction chapters of the located organization are obtained, and the scenario instruction entities of the organization and their relationships are extracted from the chapter content. Optionally, the scenario instruction chapter extraction of the organization can use the UIE model.
[0152] It should be noted that the extraction of scenario instructions is more challenging than the extraction of organizational structures and responsibilities because the contingency plans involve a wide range of areas, and the governance of labels is far more difficult than that of labels for organizational responsibilities. Therefore, the definition of scenario instructions needs to meet not only the business's requirements for labels, but also the model's definition of labels.
[0153] Furthermore, as one implementation, the above-described steps for establishing relationships based on the entities and their relationships may include:
[0154] Step S321: Obtain the organizational structure and responsibility entities and entity relationships, and construct the organizational structure and responsibility relationships by using the subject-first PL-Maker model. The subject-first PL-Maker model is obtained by inputting business knowledge into the algorithm model for training based on the characteristics of the pre-plan text.
[0155] Step S322: Obtain the context command entities and entity relationships of the organization, and construct the context command relationships of the organization using the subject-first PL-Maker model.
[0156] It should be noted that the subject-first PL-Marker is based on the (Packed LevitatedMarker for Entity and Relation Extraction) relation classification model. This model is divided into a NER (Nearest Entity Relationship) phase and a RE (Relation Extraction) phase, but only the RE phase is used in the process of establishing relationships between organizations and responsibilities. The RE phase of this model uses a combination of solid markers and levitated markers, with solid markers marking the subject span and levitated markers marking candidate objects.
[0157] For example, suppose the input sequence is X, and the subject span is... and its candidate objectspans: The specific steps are as follows:
[0158] For each subject span, a solid marker ([S] and [ / S]) is inserted at the beginning and end, respectively. Then, its corresponding candidate object spans are appended to the text using dangling markers ([O] and [ / O]). The sentence X={x1, ..., xn} is then transformed into the following formula 1 (where the symbol ∪ represents shared position embedding):
[0159] (1)
[0160] Feed the training instances into PLM, for each span pair in the sample, span pair = The characterization of solid markers before and after the subject span and and the characterization of levitated markers for a pair of object spans. and When spliced together, this represents the span pair as shown in Formula 2 below:
[0161] (2)
[0162] Optionally, the PL-marker can be modified based on the characteristics of the preliminary plan text: Strategy 1: There is a clear order in the correspondence between organizational structures and responsibilities. After the subject is fixed in its corresponding position, the object should appear after the subject, not before it. The boundary information of other objects remains suspended after the sentence. Strategy 2: Long entities and organizations are not used as subjects. Strategy 3: Symmetric labels are removed from the paper, as there are no symmetric labels in the preliminary plan data. Strategy 4: The distribution of the preliminary plan data is long-tailed, so Focal loss is used for imbalanced training.
[0163] For example, the text could read: "Professional emergency rescue teams. Each team, based on its specific characteristics, is responsible for on-site emergency response and support in hazardous chemical accidents. They collaborate with comprehensive emergency rescue teams to complete rescue missions, provide professional technical support, and are under the command of the on-site supervisor of the comprehensive emergency rescue team. An emergency duty system is established, emergency duty personnel are assigned, daily training and assessments are strengthened, practical skills are improved, and the rescue teams play a role in preventative inspections and safety technical services."
[0164] The entities identified after the entity extraction model are:
[0165] Organizations: Professional emergency rescue teams, comprehensive emergency rescue teams;
[0166] Emergency response agency role: On-site leader of a comprehensive emergency rescue team;
[0167] Responsibilities: Each team is responsible for on-site emergency response and support in hazardous chemical accidents, based on their respective strengths; they collaborate with comprehensive emergency rescue teams to complete rescue missions and provide professional technical support; and they operate under the command of the on-site supervisor of the comprehensive emergency rescue team. An emergency duty system will be established, emergency duty personnel will be assigned, daily training and assessments will be strengthened to improve practical skills, and the rescue teams will play a role in preventative inspections and safety technical services.
[0168] The sentence output after processing by the module's packaging strategy:
[0169] [S]Specialized Emergency Rescue Teams[ / S] are responsible for on-site emergency response and support in hazardous chemical accidents, based on their respective strengths. They collaborate with comprehensive emergency rescue teams to complete rescue missions, provide professional technical support, and are under the command of the on-site supervisor of the comprehensive emergency rescue team. An emergency duty system is established, with designated personnel on duty. Daily training and assessments are strengthened to improve practical skills and leverage the role of rescue teams in preventative inspections and safety technical services.
[0170] Relationship tags: The relationships involved here are triple tags, such as organization-abbreviation-organization, organization-superior-institution, and organization-responsibility-organization.
[0171] This embodiment, through the above-described scheme, uses the subject-first PL-Marker algorithm. Based on the original PL-Marker algorithm, it explicitly inputs business knowledge into the algorithm model according to the characteristics of the pre-plan text, making the model more adaptable to the characteristics of the pre-plan text and significantly improving the information management efficiency of the pre-plan text.
[0172] Fourth embodiment
[0173] Based on the first, second, or third embodiment described above, in this embodiment, the step of obtaining the plan data by parsing the plan document may include:
[0174] Step S11: Obtain the watermarked PDF document and remove the watermark from the watermarked PDF document to obtain the watermark-free PDF document.
[0175] Step S12: Repair the content of the watermark-removed PDF document and convert it into a docx document;
[0176] Step S13: Perform data structuring based on the docx document to obtain structured preliminary plan data.
[0177] Specifically, the process involves acquiring a PDF document containing text. If the PDF has a watermark, PyPDF4 is used to remove it. Then, the Abbyy module is called to repair the content of the watermark-removed PDF and convert it into a docx document. Finally, POI is used to parse the document to obtain the proposed data. The data parsed by POI does not contain structured information, so it needs to be structured according to the layout characteristics of the proposed text. The document content repair strategies can include: removing redundant spaces; correcting incorrectly recognized characters, numbers, and symbols; and restoring header and footer recognition.
[0178] Optionally, if the PDF document does not have a watermark, the Abbyy module is called for further data structuring.
[0179] Compared to existing technologies, this embodiment converts PDF to Word and then uses POI to read the content of the Word document, which allows for the acquisition of richer information and facilitates the subsequent restoration of hierarchical structure information.
[0180] Furthermore, as one implementation, the above-described steps for data structuring based on the docx document may include:
[0181] Step S131: Identify the hierarchical structure based on the directory number in the document to obtain the directory hierarchy information.
[0182] Specifically, the hierarchical structure is identified based on the table of contents numbers in the document to obtain the table of contents hierarchy information. Optionally, a parent-child hierarchy tree of headings can be constructed using a recursive method based on the potential hierarchy information of the table of contents numbers.
[0183] For example, refer to Figure 5Among them, 1.1, 1.2, and 1.3 belong to 1. General Principles 1, and 2. Organizational Structure 1 and 1. General Principles 1 are at the same level. Based on the above hierarchical information, the following can be constructed using a recursive method of dynamic programming: Figure 6 The parent-child hierarchical tree structure is shown.
[0184] Step S132: Obtain chapter hierarchy information based on chapter titles, attachment titles, and / or ordered text annotations.
[0185] Specifically, chapter hierarchy information is marked for chapter titles, appendix titles, and / or ordered text. For example, the marking format uses various combinations of (character + number + symbol) regular expressions to restore the parent-child structure of all serial numbers.
[0186] For example: [Attachment Title]: F1, F2.1, F3.1.1 can be summarized as regular expressions using symbols + numbers;
[0187] [Chapter Title]: 1, 1.1, 1.1.1 summarized as regular expressions for numbers;
[0188] [Ordered text]: A1, A2, A1.1 are summarized as regular expressions using symbols and numbers;
[0189] [Unnumbered ordered text]: A1, A2, A1.1 Regular expressions for symbols and numbers.
[0190] Step S133: Match the directory hierarchy information and the chapter hierarchy information, and construct the parent-child hierarchy relationship of the titles in the main text.
[0191] Step S134: Recover the hierarchical relationship between the title and the text block based on the relative position of the title in the main text.
[0192] Furthermore, as one implementation, step S132 above, obtaining chapter hierarchy information based on chapter titles, appendix titles, and / or ordered text annotations, may include:
[0193] Step S1321: Obtain the chapter title and / or the attachment title, perform line parsing based on the chapter title and / or the attachment title, and generate a standard format chapter title and / or a standard format attachment title;
[0194] Step S1322: Obtain the chapter titles in the standard format, perform block parsing based on the chapter titles in the standard format, and generate a chapter directory in the standard format;
[0195] Step S1323: Obtain the attachment title in the standard format, perform block parsing based on the attachment directory in the standard format, and generate an attachment list in the standard format.
[0196] It should be noted that, since different contingency plans have different data structures, and manually drafted plans often have inconsistencies in structure, it is necessary to ensure that the original data structure of the contingency plan is not modified while simultaneously generating a standardized and uniformly formatted contingency plan data. This requires employing different strategies for data structuring based on the specific data types. The main strategies are line-level parsing and block-level parsing, among which:
[0197] [Row Parsing]: Performs additional processing on the current row; the parsed data is different from the original data.
[0198] For example, the chapter title is parsed, the original serial number is removed, and a standard format chapter title is generated;
[0199] For example, the attachment title is parsed to generate a standard format attachment title. If there is only a serial number and no title, the serial number of the attachment is selected and appended with the attachment information to form the standard format attachment title.
[0200] [Block parsing]: Performs additional processing on the current data block, resulting in a parsed data block that is different from the original data block.
[0201] For example, the table of contents is parsed and a new version is generated using the chapter titles. The newly generated table of contents may have more or fewer lines than the original table of contents, but the standard is consistent.
[0202] For example, the attachment list may not exist before parsing; after parsing, a standard-format attachment list is generated based on the attachments. This generated attachment list can be used to quickly locate attachments.
[0203] Optionally, the strategies employed for structuring different types of data may also include preserving the original state and temporarily ignoring it, wherein:
[0204] [Keep as is]: No additional processing is performed on the data after parsing. For example, the main text is not parsed and remains as is.
[0205] [Temporarily Ignored]: Since only text and table format data need to be parsed at present, image and flowchart format data are temporarily ignored and removed from the data during reading. In the future, if front-end display issues are considered, they may be stored as data items, but they will not be used as input during information extraction.
[0206] This embodiment of the solution is based on processing each element of the preliminary layout with different strategies, which can obtain information-rich hierarchical text information, including not only the main text content, but also the hierarchical relationship between the title and the main text blocks.
[0207] Furthermore, this application also proposes a plan text extraction device, which includes:
[0208] The data parsing module is used to parse the plan data according to the plan document in response to obtaining the plan document;
[0209] The text location module is used to locate the content of text blocks according to the contingency plan data, specifically including: obtaining the chapter directory and main text content of the contingency plan data, locating the chapter on organizational structure and responsibilities according to the chapter directory and main text content, and / or locating the chapter on scenario instructions of the organizational structure according to the chapter directory;
[0210] The entity extraction module is used to extract entities and entity relationships based on the content of the text block, and to build relationships based on the entities and entity relationships.
[0211] The principle and implementation process of extracting the pre-plan text in this embodiment are explained in the above embodiments, and will not be repeated here.
[0212] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a pre-planned text extraction program, which, when executed by a processor, implements the steps of the pre-planned text extraction method as described above.
[0213] Since the text extraction program of this plan adopts all the technical solutions of all the aforementioned embodiments when it is executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be repeated here.
[0214] Compared to existing technologies, the contingency plan text extraction method, apparatus, and storage medium proposed in this application, in response to obtaining a contingency plan document, parse the contingency plan data from the document; locate text block content based on the contingency plan data; extract entities and entity relationships based on the text block content; and construct relationships based on the entities and entity relationships. Based on this application's solution, through contingency plan text parsing, text block content location, entity and entity relationship extraction, and relationship construction, the technical problems of automatically extracting key elements and constructing relationships in emergency contingency plan texts are solved. Furthermore, it supports the transformation and upgrading of massive amounts of contingency plan texts from electronic to digital, improving the efficiency of contingency plan text information management.
[0215] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0216] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0217] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.
[0218] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for extracting contingency plan text, characterized in that, The method for extracting the contingency plan text includes: In response to obtaining the contingency plan document, contingency plan data is obtained by parsing the contingency plan document. Locate the text block content based on the aforementioned plan data; Entities and entity relationships are extracted from the text block content, and relationships are built based on the entities and entity relationships; wherein, the entity extraction of organizational structure and responsibilities adopts the pointer annotation method, and the entity relationship extraction of organizational structure and responsibilities adopts the staged extraction and building method. The step of locating the text block content based on the pre-plan data includes: Obtain the chapter directory and main text content of the contingency plan data, locate the chapter on organizational structure and responsibilities based on the chapter directory and main text content, and / or locate the chapter on scenario instructions of the organizational structure based on the chapter directory; The step of establishing relationships based on the entities and the entity relationships includes: Obtain the organizational structure, responsibilities, entities, and relationships. Then, construct the organizational structure and responsibilities relationships using a subject-first PL-Maker model. The subject-first PL-Maker model is obtained by inputting business knowledge into the algorithm model for training based on the characteristics of the pre-plan text. Obtain the contextual command entities and entity relationships of the organization, and construct the contextual command relationships of the organization using the subject-first PL-Maker model.
2. The method for extracting the plan text as described in claim 1, characterized in that, The steps for locating the chapters containing organizational structure and responsibilities based on the chapter table of contents and main text include: Obtain the chapter title of each level of the chapter directory, and identify the organizational entity of the chapter title based on the chapter title and the named entity recognition model, wherein the named entity recognition model is trained based on the text content; The chapter titles are categorized and tagged based on the organizational entity to obtain the tag conversion results for the chapter titles; Based on the tag conversion results of the chapter titles and the UIE classification model, the chapters on organizational structure and responsibilities are located.
3. The method for extracting the plan text as described in claim 1, characterized in that, The step of locating the contextual instruction chapter of the organization based on the chapter directory includes: Obtain the chapter titles of each level of the chapter directory, and annotate the corpus based on the chapter titles to obtain the annotated chapter directory; The chapter titles containing hierarchical information are obtained by processing the annotated chapter table of contents and title hierarchy information; The organizational structure's contextual instruction chapters are obtained by locating chapter titles containing hierarchical information and using the TextCNN classification model.
4. The method for extracting the plan text as described in any one of claims 1, 2, or 3, characterized in that, The step of extracting entities and entity relationships based on the text block content includes: Obtain the organizational structure and responsibilities section, and extract the organizational structure and responsibilities entities and entity relationships of the section content based on the organizational structure and responsibilities section; Obtain the contextual instruction chapters of the organization, and extract the contextual instruction entities and entity relationships of the organization from the chapter content based on the contextual instruction chapters of the organization.
5. The method for extracting the plan text as described in claim 1, characterized in that, The step of obtaining the plan data by parsing the plan document includes: Obtain a watermarked PDF document, and remove the watermark from the watermarked PDF document to obtain a watermark-free PDF document; The watermark-removed PDF document is then repaired and converted into a docx document; The data is structured based on the docx document to obtain structured preliminary plan data.
6. The method for extracting the plan text as described in claim 5, characterized in that, The step of structuring data based on the docx document includes: The hierarchical structure is identified based on the table of contents numbers in the document to obtain the directory hierarchy information; Chapter hierarchy information is obtained based on chapter titles, appendix titles, and / or ordered text annotations; Matching is performed based on the directory hierarchy information and the chapter hierarchy information to construct the parent-child hierarchy relationship of the titles in the main text; The hierarchical relationship between the titles and the text blocks in the body can be recovered by analyzing the relative positions of the titles in the body.
7. The method for extracting the plan text as described in claim 6, characterized in that, The step of obtaining chapter hierarchy information based on chapter titles, appendix titles, and / or ordered text annotations includes: Obtain the chapter title and / or the attachment title, perform line parsing based on the chapter title and / or the attachment title, and generate a standard format chapter title and / or a standard format attachment title; Obtain the chapter titles in the standard format, perform block parsing based on the chapter titles in the standard format, and generate a chapter table of contents in the standard format; Obtain the attachment title in the standard format, perform block parsing based on the attachment directory in the standard format, and generate an attachment list in the standard format.
8. A pre-plan text extraction device, characterized in that, The contingency plan text extraction device includes: The data parsing module is used to parse the structured plan data based on the plan document in response to the acquisition of the plan document. The text location module is used to locate text block content based on the structured plan data, specifically including: obtaining the chapter directory and main text content of the plan data, locating the organizational structure and responsibilities chapter based on the chapter directory and main text content, and / or locating the scenario instruction chapter of the organizational structure based on the chapter directory; The entity extraction module is used to extract entities and entity relationships based on the text block content, and to build relationships based on the entities and entity relationships. Specifically, it includes: obtaining the organizational structure and responsibility entities and entity relationships, and building the organizational structure and responsibility relationships using a subject-first PL-Maker model, wherein the subject-first PL-Maker model is obtained by inputting business knowledge into the algorithm model for training based on the characteristics of the pre-plan text; obtaining the organizational structure's contextual instruction entities and entity relationships, and building the organizational structure's contextual instruction relationships using the subject-first PL-Maker model; wherein the entity extraction of organizational structure and responsibility adopts pointer annotation, and the entity relationship extraction of organizational structure and responsibility adopts a staged extraction and construction method.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plan text extraction program, which, when executed by a processor, implements the steps of the plan text extraction method as described in any one of claims 1-7.