A document historical context extraction method and device based on information extraction

By combining deep learning models and rules, the historical context of documents can be automatically extracted, solving the problem of time-consuming and labor-intensive manual methods and improving the generalization and accuracy of document recognition.

CN116340505BActive Publication Date: 2026-04-24WUHAN TIANYU INFORMATION IND
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN TIANYU INFORMATION IND
Filing Date
2023-03-31
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing technologies, the extraction of the historical context of documents mainly relies on manual methods, which is time-consuming, labor-intensive, and cannot be extended or generalized, and cannot effectively identify new paradigms in document clauses.

Method used

Using an information extraction-based approach, deep learning models and rule combinations are employed to identify the relationships and timelines in documents. Through character cleaning, hierarchical representation, and named entity recognition, the historical context of the documents is generated.

Benefits of technology

It improves the generalization and accuracy of document history extraction, reduces the need for manual annotation, and can quickly identify modification and obsolescence relationships in various document types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340505B_ABST
    Figure CN116340505B_ABST
Patent Text Reader

Abstract

The application discloses a document historical context extraction method and device based on information extraction, and relates to the field of information extraction.The method comprises the following steps: obtaining a document, and performing cleaning processing on the document according to a set character cleaning rule to obtain a cleaned document; analyzing the content of clauses of the cleaned document, and performing hierarchical representation on the document according to the hierarchical serial numbers of the clauses; identifying the clause relationship and the clause time of the document based on a deep learning model, and outputting an identification result.The application can greatly improve the generalization and accuracy of the model, and can obtain strong generalization of the document context recognition ability only by using a small amount of labeled document files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information extraction, and specifically to a method and apparatus for extracting the historical context of documents based on information extraction. Background Technology

[0002] Currently, there are no intelligent methods for extracting the historical context of documents. The main approach is to use manual registration or corresponding rules to identify the modification and repeal relationships between clauses in the document, as well as the effective period of the clauses.

[0003] Therefore, manually extracting the historical context of a document leads to the following problems: 1. It requires a lot of manpower and time to organize, which is time-consuming, laborious, and slow in updating; 2. It cannot be extended and generalized to new paradigms in document clauses. Summary of the Invention

[0004] In view of the shortcomings of the existing technology, the purpose of this invention is to provide a document history context extraction method and device based on information extraction, which can greatly improve the generalization and accuracy of the model, and can obtain a document context recognition capability with strong generalization with only a small number of labeled document files.

[0005] To achieve the above objectives, this invention provides a document history context extraction method based on information extraction, which specifically includes the following steps:

[0006] The document is retrieved and cleaned according to the set character cleaning rules to obtain the cleaned document.

[0007] The document's clauses are parsed and the document is then hierarchically represented according to the hierarchical number of each clause.

[0008] The system uses a deep learning model to identify the relationships and dates of clauses in a document and outputs the identification results.

[0009] Based on the above technical solution, the specific steps of obtaining the document and cleaning it according to the set character cleaning rules to obtain the cleaned document include:

[0010] Obtain the document and clean it using regular expressions;

[0011] The original text of the clauses and paragraph structure are preserved during the cleaning process, resulting in a cleaned document.

[0012] Based on the above technical solutions,

[0013] The document being retrieved is in HTML format.

[0014] Once the cleaned documents are obtained, they will be output as a list.

[0015] Based on the above technical solution, the document is hierarchically represented according to the hierarchical sequence number of each clause. Specifically, the hierarchical representation of the document includes:

[0016] Based on regular expressions, identify the identifiers preceding each clause, and then:

[0017] If the logical order of the identifiers is correct, the hierarchy and sequence number of each clause can be obtained directly.

[0018] If the logical order of the identifiers is incorrect, the identifiers are corrected, and then the hierarchy and sequence number of each clause are obtained.

[0019] Based on the above technical solution, after obtaining the hierarchy and sequence number of each clause:

[0020] The data is stored using a key-value dictionary structure, where the key is the clause title and the corresponding level, and the value is the text content under the clause title.

[0021] Based on the above technical solution, the identification of clause relationships and clause time in a document using a deep learning model includes the following specific steps:

[0022] Based on the established rules, the clause name and document number in the clause are identified, and the clause and the identified clause name are connected;

[0023] The textcnn classification model is used to predict whether there are repeal and modification relationships in each clause, and the prediction results of the textcnn classification model are compared with the identification results of the set rules:

[0024] If they match, the prediction results are output, and the relationship between repeal and modification is identified by NER. The specific clauses in the clauses are identified and converted into uniform identifiers to determine the document to which the clauses belong.

[0025] If there is a discrepancy, the identification result of the set rules will be output, and the relationship between repeal and modification will be identified by NER. The specific clauses in the clauses will be identified and converted into uniform identifiers to determine the document to which the clauses belong.

[0026] Based on the above technical solutions,

[0027] The repeal and modification relationships include co-repeal, repealed, modified, modified, and no relationship;

[0028] The NER identification of the repeal and modification relationship specifically involves NER identification of co-repeal, repealed, modified, and modified.

[0029] Based on the above technical solution, the identification of clause relationships and clause dates in a document using a deep learning model includes the following specific steps for identifying the clause dates:

[0030] Based on the NER model, the document name, document number, start time, end time and clauses in the document are identified;

[0031] Input the identification results into the PLmarker relationship prediction model to predict clause name-document number, clause name-clause, clause name-start / end time, and clause-start / end time.

[0032] The time is parsed. For time points, the time is entered directly. For time intervals, the time is parsed into two corresponding time points and then entered.

[0033] Based on the above technical solution, the specific steps for outputting the recognition result include:

[0034] The identification results of the document's clause relationships and clause dates are combined to obtain the modification relationships between documents, clauses, and clauses, as well as the effective dates of documents and clauses, which are output as the document's historical context.

[0035] This invention provides a document history context extraction device based on information extraction, comprising:

[0036] The data cleaning module is used to acquire documents and clean them according to the set character cleaning rules to obtain cleaned documents.

[0037] The document parsing module is used to parse the clause content of the cleaned document and represent the document hierarchically according to the hierarchical number of each clause.

[0038] The information extraction module is used to identify the relationship between clauses and the time of clauses in a document based on a deep learning model, and output the identification results.

[0039] Compared with the prior art, the advantages of the present invention are as follows:

[0040] (1) No need to write rules according to various formats. Only a portion of the data of various formats is initially labeled. By training a deep learning model and using rules as an aid, the generalization and accuracy of the model can be greatly improved. Only a small number of labeled document files are needed to obtain a document context recognition capability with strong generalization.

[0041] (2) This invention uses natural language deep learning technology to perform cross-document character-level modeling. First, it identifies important entities in the document clauses, such as time, clause name, document number, etc. Then, it identifies the relationships between the entities, such as modification, repeal and subordinate relationships. Finally, it integrates the information extraction results to generate document historical context information. It has strong transferability and can be applied to clause documents of various types of content. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart of a document history context extraction method based on information extraction in an embodiment of the present invention;

[0044] Figure 2 A flowchart for identifying the relationships between clauses in a document;

[0045] Figure 3 A flowchart for identifying the dates of clauses in a document;

[0046] Figure 4 This is a schematic diagram of a document history context extraction device based on information extraction, according to an embodiment of the present invention. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.

[0048] See Figure 1 As shown in the figure, the document history context extraction method based on information extraction provided by this embodiment of the invention specifically includes the following steps:

[0049] S1: Obtain the document and clean it according to the set character cleaning rules to obtain the cleaned document;

[0050] In this invention, a document is obtained and cleaned according to a set character cleaning rule to obtain a cleaned document. The specific steps include:

[0051] S101: Obtain the document and clean it using regular expressions;

[0052] S102: The original text of the clauses and paragraph structure are preserved during the cleaning process to obtain the cleaned document.

[0053] It should be noted that the document is retrieved in HTML format; after the cleaned document is obtained, it is output as a list.

[0054] In practice, the document obtained from the webpage is in HTML format and contains a large number of special characters. Therefore, regular expressions are used to clean the document, retaining the original text of the clauses and the paragraph structure, and finally outputting it in list format.

[0055] S2: Parse the clause content of the cleaned document and represent the document hierarchically according to the hierarchical number of each clause;

[0056] In this invention, the document is represented hierarchically according to the hierarchical number of each clause. Specifically, the hierarchical representation of the document is as follows:

[0057] Based on regular expressions, identify the identifiers preceding each clause, and then:

[0058] If the logical order of the identifiers is correct, the hierarchy and sequence number of each clause can be obtained directly.

[0059] If the logical order of the identifiers is incorrect, the identifiers are corrected, and then the hierarchy and sequence number of each clause are obtained.

[0060] That is, the hierarchical sequence number of each clause after data cleaning is restored, such as 1, 1.1, 2, 2.1, 2.1.1... This is mainly done by identifying the identifiers before each clause through rules, such as the first clause, one, (1), 1, etc. By setting various regular expressions to identify the corresponding identifiers, the hierarchy and sequence number of each clause are obtained; For the like 1, 2, 2, 2, 3, 1, 1, 2..., the output is first checked using rules to correct rule errors, and then it is converted to obtain the directory number of the structure 1, 1.1, 1.2, 1.3, 1.3.1, 2, 3, 3.1.

[0061] In this invention, after obtaining the hierarchy and sequence number of each clause, a key-value dictionary structure is used for storage, where the key is the clause title and the corresponding hierarchy, and the value is the text content under the clause title.

[0062] S3: Based on a deep learning model, identify the relationship between clauses and the time of clauses in a document, and output the identification results.

[0063] In this invention, a deep learning model is used to identify the clause relationships and clause dates in a document. Specifically, the identification of the clause relationships includes the following steps:

[0064] S301: Based on the set rules, identify the clause name and document number in the clause, and connect the clause with the identified clause name; the set rules can be defined according to the identification needs.

[0065] S302: Based on the TextCNN classification model, predict whether there are repeal and modification relationships in each clause, and compare the prediction results of the TextCNN classification model with the identification results of the set rules:

[0066] If they match, the prediction result is output, and the repeal and modification relationship is identified by NER (Named Entity Recognition). The specific clauses in the clauses are identified and converted into uniform identifiers to determine the document to which the clauses belong.

[0067] If there is a discrepancy, the identification result of the set rules will be output, and the relationship between repeal and modification will be identified by NER. The specific clauses in the clauses will be identified and converted into uniform identifiers to determine the document to which the clauses belong.

[0068] It should be noted that the repeal and modification relationship includes co-repeal, repealed, modified, modified, and no relationship; the repeal and modification relationship is identified by NER identification, specifically, the co-repeal, repealed, modified, and modified relationships are identified by NER identification.

[0069] The following combination Figure 2 This section details the identification of clause relationships within a document, specifically identifying modification and repeal relationships between clauses, as well as the details of any modifications or repeals. First, rules are used to identify clause names and document numbers, excluding attachments. Clauses are then linked to their extracted names, masking any duplicate names found in other clauses. Next, a TextCNN classification model predicts the existence of repeal and modification relationships within each clause, categorizing them into five types: co-repeated, repealed, modified, modified, and no relationship. The classification results are compared with the rule results. Clauses belonging to the first four categories are then subjected to NER identification, primarily focusing on specific clauses such as Article 1 or Paragraph 1, converting them to uniform identifiers like 1.1 and 1. Relationship extraction is then performed using rules to determine which document the clause belongs to, and finally, a unified output is provided.

[0070] In this invention, a deep learning model is used to identify the clause relationships and clause dates in a document. Specifically, the identification of the clause dates includes the following steps:

[0071] S311: Based on the NER model, identify the clause name, document number, start time, end time and clause in the document;

[0072] S312: Input the identification results into the PLmarker relationship prediction model to predict clause name-document number, clause name-clause, clause name-start / end time, and clause-start / end time.

[0073] S313: Parse the time. For time points, fill in the time directly. For time intervals, parse the time into the corresponding two time points and then fill them in.

[0074] The following combination Figure 3 This section details the identification of document clause times, primarily focusing on recognizing the effective dates of each document and clause. First, the NER model, combined with rules, identifies five categories within the clauses: clause name, document number, start time, end time, and clause itself. These are then input into the PLmarker relationship prediction model, predicting four relationships: clause name-document number, clause name-clause, clause name-start / end time, and clause-start / end time, achieving an accuracy rate of 97.06%. After identifying the corresponding entity relationships, the time is parsed. Time entities are categorized into time points and time intervals. Time points can be directly entered; for special cases such as "date of publication," rules can be set to fill in the entered time. Time intervals require parsing into two corresponding time points before being entered.

[0075] In this invention, the specific steps for outputting the recognition results include: merging the recognition results of the document's clause relationships and clause times to obtain the modification relationships between documents, clauses, and clauses, as well as the effective times of documents and clauses, which are then output as the document's historical context.

[0076] In this invention, the identification of document clause relationships and clause times is achieved by using a pipeline structure to identify document time, modification relationships, etc. in stages and by function. This method avoids writing a large number of rules, has strong transferability, is not restricted by rules, and can greatly improve the accuracy and effectiveness of the model when combined with manual rule correction.

[0077] The document history extraction method based on information extraction in this invention does not require writing rules according to various layouts. It only uses a portion of the data of various layouts with initial labeling. By training a deep learning model and using rule assistance, the generalization and accuracy of the model can be greatly improved. Only a small number of labeled document files are needed to obtain a document history recognition capability with strong generalization. This invention uses natural language deep learning technology to perform character-level modeling across documents. It first identifies important entities in the document, such as time, clause name, document number, etc., then identifies the relationships between entities, such as modification, repeal, and subordinate relationships. Finally, the information extraction results are fused to generate document history information. It has strong transferability and can be applied to document files with various types of content.

[0078] In one possible implementation, the present invention also provides a readable storage medium located in a PLC (Programmable Logic Controller) controller. The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the document history context extraction method based on information extraction described below:

[0079] The document is retrieved and cleaned according to the set character cleaning rules to obtain the cleaned document.

[0080] The document's clauses are parsed and the document is then hierarchically represented according to the hierarchical number of each clause.

[0081] The system uses a deep learning model to identify the relationships and dates of clauses in a document and outputs the identification results.

[0082] Storage media may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0083] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.

[0084] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0085] See Figure 4 As shown in the figure, an embodiment of the present invention provides a document history context extraction device based on information extraction, which includes a data cleaning module, a document parsing module and an information extraction module.

[0086] The data cleaning module is used to acquire documents and clean them according to predefined character cleaning rules, resulting in a cleaned document. In other words, the data cleaning module cleans the document, removing irrelevant symbols and data from the clauses.

[0087] The document parsing module is used to parse the clause content of the cleaned document and represent the document hierarchically according to the hierarchical number of each clause. In other words, the function of the document parsing module is to parse the clause content in the document, structuring and hierarchizing the clause information for subsequent extraction of document context information.

[0088] The information extraction module is used to identify the clause relationships and clause dates in a document based on a deep learning model, and output the identification results. In other words, the information extraction module uses algorithms such as entity recognition and relation extraction to extract and identify key information such as clause names and dates from the document.

[0089] In this invention, the data cleaning module mainly cleans the special characters in the clauses, and after processing, a clean clause text without garbled characters or special characters is obtained; the document parsing module performs rule-based parsing on the cleaned clauses to obtain the sequence number of each clause; the information extraction module identifies the effective start time and modification relationship of the document and clauses respectively, and finally performs rule fusion output on the extraction results.

[0090] In practical use, the data cleaning module, document parsing module, and information extraction module are combined, and then deployed based on the Flask+Gunicorn development interface. The entire processing can be completed by calling the interface request.

[0091] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

[0092] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

Claims

1. A method for extracting the historical context of documents based on information extraction, characterized in that, Specifically, the following steps are included: The document is retrieved and cleaned according to the set character cleaning rules to obtain the cleaned document. The document's clauses are parsed and the document is then hierarchically represented according to the hierarchical number of each clause. The document uses a deep learning model to identify the relationships and dates between clauses and outputs the identification results. The method for identifying the clause relationships and timeframes in a document using a deep learning model includes the following specific steps: Based on the established rules, the clause name and document number in the clause are identified, and the clause and the identified clause name are connected; The textcnn classification model is used to predict whether there are repeal and modification relationships in each clause, and the prediction results of the textcnn classification model are compared with the identification results of the set rules: If they match, the prediction results are output, and the relationship between repeal and modification is identified by NER. The specific clauses in the clauses are identified and converted into uniform identifiers to determine the document to which the clauses belong. If there is a discrepancy, the identification result of the set rules will be output, and the relationship between repeal and modification will be identified by NER. The specific clauses in the clauses will be identified and converted into uniform identifiers to determine the document to which the clauses belong. The method for identifying the relationship between clauses and the time of clauses in a document based on a deep learning model includes the following specific steps for identifying the time of clauses: Based on the NER model, the document name, document number, start time, end time and clauses in the document are identified; Input the identification results into the PLmarker relationship prediction model to predict clause name-document number, clause name-clause, clause name-start / end time, and clause-start / end time. The time is parsed. For time points, the time is entered directly. For time intervals, the time is parsed into two corresponding time points and then entered. The specific steps for outputting the recognition result include: The identification results of the document's clause relationships and clause dates are combined to obtain the modification relationships between documents, clauses, and clauses, as well as the effective dates of documents and clauses, which are output as the document's historical context.

2. The document history context extraction method based on information extraction as described in claim 1, characterized in that, The steps of obtaining the document and cleaning it according to the set character cleaning rules to obtain the cleaned document include: Obtain the document and clean it using regular expressions; The original text of the clauses and paragraph structure are preserved during the cleaning process, resulting in a cleaned document.

3. The document history context extraction method based on information extraction as described in claim 2, characterized in that: The document being retrieved is in HTML format. Once the cleaned documents are obtained, they will be output as a list.

4. The document history context extraction method based on information extraction as described in claim 1, characterized in that, The document is hierarchically represented according to the hierarchical number of each clause. Specifically, the hierarchical representation of the document includes: Based on regular expressions, identify the identifiers preceding each clause, and then: If the logical order of the identifiers is correct, the hierarchy and sequence number of each clause can be obtained directly. If the logical order of the identifiers is incorrect, the identifiers are corrected, and then the hierarchy and sequence number of each clause are obtained.

5. The document history context extraction method based on information extraction as described in claim 4, characterized in that, Once the hierarchy and sequence number of each clause are obtained: The data is stored using a key-value dictionary structure, where the key is the clause title and the corresponding level, and the value is the text content under the clause title.

6. The document history context extraction method based on information extraction as described in claim 1, characterized in that: The repeal and modification relationships include co-repeal, repealed, modified, modified, and no relationship; The NER identification of the repeal and modification relationship specifically involves NER identification of co-repeal, repealed, modified, and modified.

7. A document history context extraction device based on information extraction, characterized in that, include: The data cleaning module is used to acquire documents and clean them according to the set character cleaning rules to obtain cleaned documents. The document parsing module is used to parse the clause content of the cleaned document and represent the document hierarchically according to the hierarchical number of each clause. The information extraction module is used to identify the relationship between clauses and the time of clauses in a document based on a deep learning model, and output the identification results. The method for identifying the clause relationships and timeframes in a document using a deep learning model includes the following specific steps: Based on the established rules, the clause name and document number in the clause are identified, and the clause and the identified clause name are connected; The textcnn classification model is used to predict whether there are repeal and modification relationships in each clause, and the prediction results of the textcnn classification model are compared with the identification results of the set rules: If they match, the prediction results are output, and the relationship between repeal and modification is identified by NER. The specific clauses in the clauses are identified and converted into uniform identifiers to determine the document to which the clauses belong. If there is a discrepancy, the identification result of the set rules will be output, and the relationship between repeal and modification will be identified by NER. The specific clauses in the clauses will be identified and converted into uniform identifiers to determine the document to which the clauses belong. The method for identifying the relationship between clauses and the time of clauses in a document based on a deep learning model includes the following specific steps for identifying the time of clauses: Based on the NER model, the document name, document number, start time, end time and clauses in the document are identified; Input the identification results into the PLmarker relationship prediction model to predict clause name-document number, clause name-clause, clause name-start / end time, and clause-start / end time. The time is parsed. For time points, the time is entered directly. For time intervals, the time is parsed into two corresponding time points and then entered. The specific steps for outputting the recognition result include: The identification results of the document's clause relationships and clause dates are combined to obtain the modification relationships between documents, clauses, and clauses, as well as the effective dates of documents and clauses, which are output as the document's historical context.

Citation Information

Patent Citations

  • Visual data conversion method and device, computer equipment and storage medium

    CN113627190A

  • Clause discovery for validation of documents

    US10162850B1