A chapter-level contract extraction method based on paragraph interval division

Through the chapter-level contract extraction method based on paragraph interval division, using chapter information and pre-training models, the problems of incomplete extraction and low accuracy caused by the inability to effectively utilize chapter information in the existing technology are solved, and the long high accuracy rate is achieved Text feature extraction and confusing field recognition.

CN114757172BActive Publication Date: 2025-02-07SHANGHAI OUYE FINANCIAL INFORMATION SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210286174.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2025-02-07
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

When the prior art performs chapter-level text element extraction, the chapter information cannot be effectively utilized, resulting in incomplete extraction and low accuracy, especially the recognition error rate of confusing fields is high.

Method used

Using the chapter-level contract extraction method based on paragraph interval division, by obtaining the chapter-level text to be extracted, segmenting paragraphs according to preset separators, extracting chapter information and adding it to paragraph text, using the pre-trained model and attention mechanism Perform text encoding and characterization aggregation, and extract element information based on conditional random fields.

Benefits of technology

When facing long text content, long text element information can be extracted with a higher accuracy rate, which improves the accuracy of confusing fields from 80% to 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114757172B_ABST
    Figure CN114757172B_ABST
Patent Text Reader

Abstract

The present invention provides a chapter-level contract extraction method based on paragraph interval division, firstly obtaining a chapter-level text, then performing paragraph segmentation on the chapter-level text, and splitting it into multiple paragraph texts; based on the pattern of chapter information in the chapter-level text, combined with regular expressions, extracting the corresponding chapter text content, and obtaining the index subscript of the chapter information; obtaining the chapter to which each paragraph text belongs through the index subscript of the chapter information, and adding it to the starting position of the paragraph text; encoding the sentences in the paragraph text after adding the chapter content, and aggregating the text information of each sentence from the encoding result through an attention mechanism to obtain the text representation of each sentence; obtaining the context information of the corresponding sentence from the text representation through a conditional random field, and extracting the element information of the chapter-level text. The present invention adopts the paragraph-level text content as the model input, and can extract the element information of the long text with a high accuracy when facing the long text content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language technology, and in particular to a chapter-level contract extraction method based on paragraph interval division. Background Art

[0002] At present, when faced with the task of extracting text elements, the solution in the prior art is to divide the chapter-level text according to the paragraph content, and then use the single paragraph text as the basic unit as the model input. This makes it impossible for the model to use the chapter information of the current paragraph, lacks the restriction of chapter information, and will produce a bias for easily confused fields. In addition, since the existing task method cannot use chapter information, and the text content features of easily confused fields are not very different, and lacks the restriction of chapter information, the error rate of easily confused field information is high. Therefore, the current feature extraction model still has the following problems when extracting chapter-level feature information: (1) The chapter-level text paragraphs are long, and the current paragraph cannot use chapter information; (2) For easily confused fields, due to the small difference in text content features, it is easy to identify errors and the accuracy is low. Summary of the invention

[0003] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a chapter-level contract extraction method based on paragraph interval division, which is used to solve the problems of incomplete extraction and low accuracy when extracting text elements in the prior art.

[0004] To achieve the above-mentioned and other related purposes, the present invention provides a method for extracting chapter-level contracts based on paragraph interval division, the method comprising the following steps:

[0005] Obtaining the chapter-level text to be extracted from text elements;

[0006] Performing paragraph segmentation on the text content of the chapter-level text according to a preset delimiter, splitting the chapter-level text into multiple paragraph texts, and obtaining subscripts of all paragraph texts;

[0007] Based on the pattern of chapter information in the chapter-level text, combined with regular expressions, the corresponding chapter text content in the chapter-level text is extracted, and the index subscript of the chapter information corresponding to the chapter text content is obtained;

[0008] Obtain the chapter to which each paragraph text belongs through the index subscript of the chapter information, and add the corresponding chapter content to the starting position of the paragraph text;

[0009] Get the paragraph text after adding the chapter content, and record it as the target paragraph text;

[0010] Use the pre-trained model to encode the sentences in each target paragraph text, and aggregate the text information of each sentence from the encoding results through the attention mechanism to obtain the text representation of each sentence;

[0011] The context information of the corresponding sentence is obtained from the text representation of each sentence through the conditional random field, and the element information of the paragraph-level text is extracted.

[0012] Optionally, the sentences in each target paragraph text are encoded using a pre-trained model, and the text information of each sentence is aggregated from the encoding result through an attention mechanism to obtain the text representation of each sentence. The process includes:

[0013] Modeling the chapter information and each target paragraph text as a two-dimensional matrix consisting of a batch size and a text length;

[0014] Inputting the two-dimensional matrix into the pre-trained model for encoding, and obtaining a three-dimensional matrix consisting of batch size, text length, and hidden layer dimension;

[0015] Through the attention mechanism, the chapter information and the text information between sentences are aggregated to obtain a text representation containing the chapter information.

[0016] Optionally, the chapter information includes at least one of the following: Party A information, Party B information, and invoicing information.

[0017] Optionally, the preset delimiter includes a line break character.

[0018] Optionally, the text element fields extracted from the chapter-level text include at least one of the following: Party A's account name, Party B's account name, contract name, and contract number.

[0019] As described above, the present invention provides a chapter-level contract extraction method based on paragraph interval division, which has the following beneficial effects:

[0020] The present invention first obtains a chapter-level text to be subjected to text element extraction; then performs paragraph segmentation on the text content of the chapter-level text according to a preset separator, splits the chapter-level text into multiple paragraph texts, and obtains the subscripts of all paragraph texts; then extracts the corresponding chapter text content in the chapter-level text based on the pattern of chapter information in the chapter-level text and combines regular expressions, and obtains the index subscript of the chapter information corresponding to the chapter text content; and obtains the chapter to which each paragraph text belongs through the index subscript of the chapter information, and adds the corresponding chapter content to the starting position of the paragraph text; then obtains the paragraph text after adding the chapter content, which is recorded as the target paragraph text; and uses a pre-trained model to encode the sentences in each target paragraph text, and aggregates the text information of each sentence from the encoding result through an attention mechanism to obtain the text representation of each sentence; finally, obtains the context information of the corresponding sentence from the text representation of each sentence through a conditional random field, and extracts the element information of the chapter-level text. The present invention uses paragraph-level text content as a model input, and can extract long text element information with a high accuracy when facing long text content. In order to better utilize chapter information and distinguish easily confused field information, the present invention proposes an element extraction invention based on the division of paragraph intervals based on chapter information. At the same time, under the condition that the average accuracy of the current mainstream contract element extraction products in the industry is only 80%, and the accuracy of easily confused fields such as address and amount is only 75%, the present invention can extract easily confused element fields with an accuracy of 90%. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A flow chart of a method for extracting chapter-level contracts based on paragraph interval division provided by an embodiment;

[0022] Figure 2 A schematic diagram of the model structure in a chapter-level contract extraction method based on paragraph interval division provided by an embodiment. DETAILED DESCRIPTION

[0023] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0024] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0025] See also Figure 1 As shown, the present invention provides a chapter-level contract extraction method based on paragraph interval division, comprising the following steps:

[0026] Obtaining the chapter-level text to be extracted from text elements;

[0027] Performing paragraph segmentation on the text content of the chapter-level text according to a preset delimiter, splitting the chapter-level text into multiple paragraph texts, and obtaining subscripts of all paragraph texts;

[0028] Based on the pattern of chapter information in the chapter-level text and combined with regular expressions, the corresponding chapter text content in the chapter-level text is extracted, and the index subscript of the chapter information corresponding to the chapter text content is obtained; in this embodiment, the subscript of the chapter information is obtained from the subscripts of all paragraph texts.

[0029] Obtain the chapter to which each paragraph text belongs through the index subscript of the chapter information, and add the corresponding chapter content to the starting position of the paragraph text;

[0030] Get the paragraph text after adding the chapter content, and record it as the target paragraph text;

[0031] Use the pre-trained model to encode the sentences in each target paragraph text, and aggregate the text information of each sentence from the encoding results through the attention mechanism to obtain the text representation of each sentence;

[0032] The context information of the corresponding sentence is obtained from the text representation of each sentence through the conditional random field, and the element information of the paragraph-level text is extracted.

[0033] Specifically, in an exemplary embodiment, the sentences in each target paragraph text are encoded using a pre-trained model, and the text information of each sentence is aggregated from the encoding result through an attention mechanism to obtain the text representation of each sentence. The process includes:

[0034] Modeling the chapter information and each target paragraph text as a two-dimensional matrix consisting of a batch size and a text length;

[0035] Inputting the two-dimensional matrix into the pre-trained model for encoding, and obtaining a three-dimensional matrix consisting of batch size, text length, and hidden layer dimension;

[0036] Through the attention mechanism, the chapter information and the text information between sentences are aggregated to obtain a text representation containing the chapter information.

[0037] According to the above records, the chapter information in this method includes but is not limited to: Party A information, Party B information, and invoicing information. The preset separator includes a line break character, and the text element fields extracted from the chapter-level text include but are not limited to: Party A account name, Party B account name, contract name, and contract number.

[0038] See also Figure 2 As shown, the present invention also provides a chapter-level contract extraction method based on paragraph interval division, comprising the following steps:

[0039] 1. Paragraph segmentation: split the chapter-level text content into paragraph-level text content according to the original paragraphs and the text content according to the line break "\n", and obtain the subscripts of all paragraph texts.

[0040] 2. Chapter information extraction: According to the pattern of chapter information in the chapter text, such as "1.", use regular expressions to extract the corresponding chapter text content and obtain the index subscript of the chapter information.

[0041] 3. Paragraph interval division: Get the chapter to which each paragraph belongs through the chapter index subscript, and append the chapter content to the beginning of the paragraph.

[0042] 4. Model structure: In order to better distinguish easily confused fields, make full use of chapter information and structural information. Figure 2 shown.

[0043] 5. Each sentence is encoded through the pre-trained model, and then the internal information of the sentence is aggregated through the attention mechanism to obtain the representation of the sentence. Finally, the context information is obtained through the conditional random field, and the result is output.

[0044] In summary, the present invention provides a chapter-level contract extraction method based on paragraph interval division, which first obtains a chapter-level text to be subjected to text element extraction; then, the text content of the chapter-level text is segmented into paragraphs according to a preset delimiter, the chapter-level text is split into multiple paragraph texts, and the subscripts of all paragraph texts are obtained; then, based on the pattern of chapter information in the chapter-level text, combined with a regular expression, the corresponding chapter text content in the chapter-level text is extracted, and the index subscript of the chapter information corresponding to the chapter text content is obtained; and the chapter to which each paragraph text belongs is obtained through the index subscript of the chapter information, and the corresponding chapter content is added to the starting position of the paragraph text; then, the paragraph text after the chapter content is added is obtained, recorded as the target paragraph text; and the sentences in each target paragraph text are encoded using a pre-trained model, and the text information of each sentence is aggregated from the encoding result through an attention mechanism to obtain the text representation of each sentence; finally, the context information of the corresponding sentence is obtained from the text representation of each sentence through a conditional random field, and the element information of the chapter-level text is extracted. The present invention uses paragraph-level text content as model input, and can extract long text element information with a high accuracy when facing long text content. In addition, in order to better utilize chapter information and distinguish easily confused field information, the present invention proposes an element extraction invention based on the division of paragraph intervals based on chapter information. At the same time, under the current industry mainstream contract element extraction products, the average accuracy rate is only 80%, and the accuracy rate of easily confused fields such as address and amount is only 75%. Under the condition, the present invention can extract easily confused element fields with an accuracy rate of 90%.

[0045] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A chapter-level contract extraction method based on paragraph interval division, characterized in that: The method comprises the following steps: Obtaining the chapter-level text to be extracted from text elements; Performing paragraph segmentation on the text content of the chapter-level text according to a preset delimiter, splitting the chapter-level text into multiple paragraph texts, and obtaining subscripts of all paragraph texts; Based on the pattern of chapter information in the chapter-level text, combined with regular expressions, the corresponding chapter text content in the chapter-level text is extracted, and the index subscript of the chapter information corresponding to the chapter text content is obtained; Obtain the chapter to which each paragraph text belongs through the index subscript of the chapter information, and add the corresponding chapter content to the starting position of the paragraph text; Get the paragraph text after adding the chapter content, and record it as the target paragraph text; Use the pre-trained model to encode the sentences in each target paragraph text, and aggregate the text information of each sentence from the encoding results through the attention mechanism to obtain the text representation of each sentence; The context information of the corresponding sentence is obtained from the text representation of each sentence through the conditional random field, and the element information of the paragraph-level text is extracted.

2. The chapter-level contract extraction method based on paragraph interval division according to claim 1 is characterized in that: The pre-trained model is used to encode the sentences in each target paragraph text, and the text information of each sentence is aggregated from the encoding results through the attention mechanism. The process of obtaining the text representation of each sentence includes: Modeling the chapter information and each target paragraph text as a two-dimensional matrix consisting of a batch size and a text length; Inputting the two-dimensional matrix into the pre-trained model for encoding, and obtaining a three-dimensional matrix consisting of batch size, text length, and hidden layer dimension; Through the attention mechanism, the chapter information and the text information between sentences are aggregated to obtain a text representation containing the chapter information.

3. The chapter-level contract extraction method based on paragraph interval division according to claim 1 or 2 is characterized in that: The chapter information includes at least one of the following: Party A information, Party B information, and invoicing information.

4. The chapter-level contract extraction method based on paragraph interval division according to claim 1 or 2 is characterized in that: The preset delimiter includes a line break character.

5. The chapter-level contract extraction method based on paragraph interval division according to claim 1 or 2 is characterized in that: The text element fields extracted from the chapter-level text include at least one of the following: Party A's account name, Party B's account name, contract name, and contract number.

Citation Information

Patent Citations

  • Text segmentation method, related equipment and readable storage medium

    CN111199150A

  • Long text segmentation method and device, storage medium and electronic device

    CN113076720A