Contract information extraction method and device

By using an information set extraction model to automatically learn entity relationships in contract text, the problems of format diversity and named entity recognition errors in contract information extraction are solved, achieving efficient and accurate contract information extraction.

CN114492410BActive Publication Date: 2025-10-24BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210103391.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2025-10-24
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

In existing technologies, contract texts come in various formats, and it is difficult to cover all situations using predefined rules. Errors in named entity recognition models affect the determination of entity relationships, resulting in low efficiency and low accuracy in extracting contract information.

Method used

By acquiring the target contract text, extracting the target paragraphs and inputting them into a pre-trained information set extraction model, the information set extraction model automatically learns the relationships between entities and determines the contract information corresponding to the contract party identifier.

Benefits of technology

It improves the efficiency and accuracy of contract information extraction, avoids the limitations of manual rules, and ensures the accurate extraction of the relationship between entity information and contract party identifiers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492410B_ABST
    Figure CN114492410B_ABST
Patent Text Reader

Abstract

The application provides a contract information extraction method and device, wherein the contract information extraction method comprises the following steps: obtaining a target contract text, extracting a target paragraph in the target contract text, and the target paragraph containing contract party entity information; inputting the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains a contract party identifier, an information category and contract party entity information, and the information set extraction model is trained based on a first sample paragraph carrying an information set label; determining at least one target information set corresponding to the target contract party identifier; and determining contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set. The information set extraction model is used to automatically learn the relationship between entities, thereby avoiding the limitation of using artificial rules to determine the information set, improving the efficiency of determining the contract information, and improving the accuracy of the contract information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a contract information extraction method. The present application also relates to a contract information extraction device, a computing device, and a computer-readable storage medium. BACKGROUND

[0002] Artificial intelligence (AI) refers to the ability of an engineered (i.e., designed and manufactured) system to perceive the environment, and the ability to acquire, process, apply, and represent knowledge. Natural language processing, robots, and computer vision are the three most popular industries in artificial intelligence. The development status of key technologies in the field of artificial intelligence includes machine learning, knowledge graph, natural language processing, computer vision, human-computer interaction, biometric identification, virtual reality / augmented reality, and other key technologies. With the development of computer technology, the field of natural language processing has also developed rapidly. Natural language processing (NLP) is an important research direction in the field of computer science, which studies various theories and methods that can realize effective communication between people and computers using natural language. Specific forms of natural language processing include machine translation, text summarization, text classification, text proofreading, information extraction, speech synthesis, speech recognition, etc. Natural language processing faces four major challenges: first, there is uncertainty in morphology, syntax, semantics, pragmatics, and phonetics at different levels; second, new vocabulary, terminology, semantics, and grammar lead to unpredictable unknown language phenomena; third, insufficient data resources make it difficult to cover complex language phenomena; fourth, the ambiguity and complex interrelationships of semantic knowledge are difficult to describe with simple mathematical models, and semantic computing requires a large number of nonlinear calculations.

[0003] Written language refers to the language used when writing and reading articles. Information to be expressed or recorded can be recorded and saved through the form of text and written language. Text refers to the form of written language, which is usually a complete, systematic sentence or a combination of multiple sentences. A text can be a sentence, a paragraph, or a chapter, such as documents, documents, etc. recorded in writing. Traditional texts are generally saved on paper.

[0004] Text is also a type of computer document. With the increasingly wide application of computer technology, the application of electronic text is also becoming more and more widespread, and various types of text can be obtained on the network. In particular, some documents with fixed format requirements, such as various contracts, agreements, and proof documents.

[0005] With the advent of the big data era, the number of contract texts is also increasing, in order to reduce the data processing amount, the information of the contract text needs to be extracted. Extracting contract party information from the contract text is a key part of contract information extraction, and contract party information extraction not only involves entity recognition, but also needs to find the relationship between entities. In the prior art, the contract party information in the contract text is extracted by using a named entity recognition model, and only the corresponding entity can be recognized, and the relationship between entities can only be determined by pre-defined rules; in addition, the format of the contract text is various, and it is difficult to cover all possible cases using pre-defined rules, and the error of the named entity recognition model result will directly affect the subsequent relationship determination between entities. Therefore, an effective scheme is needed to solve the above problems. SUMMARY

[0006] Therefore, the embodiments of the present application provide a contract information extraction method to solve the technical defects in the prior art. The embodiments of the present application also provide a contract information extraction device, a computing device, and a computer readable storage medium.

[0007] According to a first aspect of the embodiments of the present application, a contract information extraction method is provided, comprising:

[0008] obtaining a target contract text, and extracting a target paragraph in the target contract text, wherein the target paragraph contains contract party entity information;

[0009] inputting the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains contract party identification, information category and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, and the information set label includes a contract party identification label, an information category label and a contract party entity information label;

[0010] determining at least one target information set corresponding to the target contract party identification;

[0011] determining the contract information corresponding to the target contract party identification according to the information category and the contract party entity information in each target information set.

[0012] According to a second aspect of the embodiments of the present application, a contract information extraction device is provided, comprising:

[0013] The extraction module is configured to obtain a target contract text, and extract a target paragraph in the target contract text, wherein the target paragraph contains contract party entity information;

[0014] The input module is configured to input the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains a contract party identifier, an information category, and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, and the information set label includes a contract party identifier label, an information category label, and a contract party entity information label.

[0015] The first determination module is configured to determine at least one target information set corresponding to the target contract party identifier.

[0016] The second determination module is configured to determine contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set.

[0017] According to a third aspect of the embodiments of the present application, a computing device is provided, comprising:

[0018] a memory and a processor;

[0019] The memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the steps of the contract information extraction method.

[0020] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement the steps of the contract information extraction method.

[0021] According to a fifth aspect of the embodiments of the present application, a chip is provided, which stores computer instructions, and the computer instructions are executed by the chip to implement the steps of the contract information extraction method.

[0022] The contract information extraction method provided by the present application comprises the following steps: obtaining a target contract text, extracting a target paragraph in the target contract text, inputting the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, further determining at least one target information set corresponding to a target contract party identifier, and determining contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set. Through the above method, the target paragraph is input into the pre-trained information set extraction model to determine at least one information set corresponding to the target paragraph. While extracting the contract party entity information, the information category representing the relationship between the entity information and the contract party identifier is also extracted. The information set extraction model is used to automatically learn the relationship between entities, avoiding the limitations of using artificial rules to determine the information set. The efficiency of determining the contract information is improved, and the accuracy of the contract information is also improved. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 is a structural schematic diagram of a contract information extraction system according to an embodiment of the present application;

[0024] Figure 2 is a flowchart of a contract information extraction method according to an embodiment of the present application;

[0025] Figure 3 is a flowchart of a method for obtaining a target contract text in a contract information extraction method according to an embodiment of the present application;

[0026] Figure 4 is a flowchart of a method for determining a target paragraph in a contract information extraction method according to an embodiment of the present application;

[0027] Figure 5 is a flowchart of a method for determining an initial paragraph in a contract information extraction method according to an embodiment of the present application;

[0028] Figure 6 is a flowchart of a method for determining an information set in a contract information extraction method according to an embodiment of the present application;

[0029] Figure 7 is a flowchart of a method for determining a contract party identifier in a contract information extraction method according to an embodiment of the present application;

[0030] Figure 8 is a flowchart of a method for training an information set extraction model in a contract information extraction method according to an embodiment of the present application;

[0031] Figure 9 is a flowchart of a method for adjusting parameters in a contract information extraction method according to an embodiment of the present application;

[0032] Figure 10 is a flowchart of a method for training a classification model in a contract information extraction method according to an embodiment of the present application;

[0033] Figure 11A is a flowchart of a method for obtaining a target contract text in a contract information extraction method according to an embodiment of the present application;

[0034] Figure 11B is a processing flowchart of a method for obtaining a target contract text in a contract information extraction method according to an embodiment of the present application;

[0035] Figure 12 is a flowchart of a method for training a contract basic information extraction model in a contract information extraction method according to an embodiment of the present application;

[0036] Figure 13 is a processing flowchart of a contract information extraction method provided by an embodiment of the present application;

[0037] Figure 14 is a structural schematic diagram of a contract information extraction device provided by an embodiment of the present application;

[0038] Figure 15 is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0039] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details, and it is understood that the present application is not limited to the embodiments described herein. In other instances, well-known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the present application.

[0040] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present application. As used in one or more embodiments of the present application and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present application, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0041] It is to be understood that the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise. It is to be further understood that the terms "comprises," "comprising," "includes," "including," "has," "having" and the like, when used in one or more embodiments of the present application, specify the presence of stated features, integers, steps, operations, elements, and / or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0042] First, the noun terms related to one or more embodiments of the present application are explained.

[0043] Entity: refers to an object or thing in the real world that objectively exists and can be distinguished from each other. For example, a person's name, an address name, a contract name, a date, and the like.

[0044] Named entity recognition: refers to identifying entities with specific meanings in natural language text, mainly including names, place names, organization names, proper nouns, and the like.

[0045] Information set extraction: extracting specified types of entity, relationship, event and other factual information from natural language text, and forming structured data output, such as extracting triplets <e1, r, e2> from natural language text, where e1, e2 are identified entities, and r represents the relationship between entities, and such as extracting contract party identification, information category and contract party entity information from contract text, and combining contract party identification, information category and contract party entity information into an information set.

[0046] Bidirectional Encoder Representation from Transformers (BERT) model based on converter: a bidirectional attention neural network model, which is a pre-training technology for natural language processing, that is, a pre-training language model, through a large amount of data training, the BERT model can extract relationship features at multiple different levels, obtain word meaning according to sentence context, avoid ambiguity, and thus more comprehensively reflect sentence semantics.

[0047] Basic contract information: refers to some basic information in the contract text, including at least one of the following: contract name, signing date, contract effective date, contract termination date, contract number, contract resource, etc.

[0048] Next, the application scenario of the contract information extraction method provided by the embodiments of the present application is described.

[0049] Extracting contract information from contract party identification text is a key part of contract text information extraction, and the extraction of contract information not only involves the recognition of entity information, but also finds the relationship between entities. Using a named entity recognition model to extract contract party information from contract text can only recognize the corresponding entity, and the relationship between entities can only be determined by predefined rules. In addition, the format of the contract text is various, and it is difficult to cover all possible cases using predefined rules, and the error of the named entity recognition model result will directly affect the subsequent judgment of the relationship between entities. That is, most of the current contract information extraction generally uses a named entity recognition model, or uses a regular method combined with some predefined rules to extract basic information such as contract names from contract text. For contract party information, the contract party company name, contract party role name and other entity information are generally found first, and then the predefined rules are used to link the contract party company name and its corresponding contract party role name and other information together.

[0050] Therefore, the application provides a contract information extraction method. The method comprises the following steps: obtaining a target contract text, extracting a target paragraph in the target contract text, inputting the target paragraph into a pre-trained information set extraction model, obtaining at least one information set corresponding to the target paragraph, determining at least one target information set corresponding to a target contract party identifier, and determining contract information corresponding to the target contract party identifier according to information categories in each target information set and contract party entity information. The target paragraph is input into the pre-trained information set extraction model, at least one information set corresponding to the target paragraph is determined, the contract party entity information is extracted, and the information category of the relationship between the entity information and the contract party identifier is also extracted. The information set extraction model is used to automatically learn the relationship between entities, the limitation of using artificial rules to determine the information set is avoided, the efficiency of determining the contract information is improved, and the accuracy of the contract information is improved.

[0051] In the application, a contract information extraction method is provided. The application also relates to a contract information extraction device, a computing device, and a computer readable storage medium, which are described in detail in the following embodiments.

[0052] The execution subject of the contract information extraction method provided in the embodiments of the application can be a server or a terminal, and the embodiments of the application do not limit this. In addition, the terminal can be any electronic product that can perform human-computer interaction with a user, for example, a PC (Personal Computer), a mobile phone, a PPC (Pocket PC), a tablet computer, and the like. The server can be a server, a server cluster composed of multiple servers, or a cloud computing service center, and the embodiments of the application do not limit this.

[0053] Taking the terminal as an example, the terminal extracts target paragraphs in the target contract text after obtaining the target contract text, wherein the target paragraphs contain contract party entity information; then the target paragraphs are input into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraphs, wherein the information set contains a contract party identifier, an information category, and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, and the information set label includes a contract party identifier label, an information category label, and a contract party entity information label; then at least one target information set corresponding to the target contract party identifier is determined; and contract information corresponding to the target contract party identifier is determined according to the information category and the contract party entity information in each target information set. Moreover, when extracting the target paragraphs in the target contract text, a classification model can be used, and at least one contract entity and a corresponding entity type in the target paragraphs can be extracted after obtaining the target paragraphs, at which time a contract basic information extraction model is used, and the classification model, the contract basic information extraction model, and the information set extraction model can be trained by a server and sent to the terminal.

[0054] Figure 1 FIG. 1 is a structural schematic diagram of a contract information extraction system according to an embodiment of the present application.

[0055] Taking the server 102 as an example, the terminal 104 uploads the target contract text, the server 102 receives the target contract text through a communication unit 102-1, that is, the server 102 obtains the target contract text, then a extraction unit 102-2 extracts target paragraphs in the target contract text, wherein the target paragraphs contain contract party entity information; then an input unit 102-3 inputs the target paragraphs into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraphs, wherein the information set contains a contract party identifier, an information category, and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, and the information set label includes a contract party identifier label, an information category label, and a contract party entity information label; then a target information set determination unit 102-4 determines at least one target information set corresponding to the target contract party identifier; and a contract information determination unit 102-5 determines contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set. Then the communication unit 102-1 can feed back the contract information to the terminal 104. In addition, the server 102 can train the classification model, the contract basic information extraction model, and the information set extraction model by itself, and use the trained classification model when extracting the target paragraphs in the target contract text.

[0056] In the embodiment of the present application, the target paragraph is input into the pre-trained information set extraction model to determine at least one information set corresponding to the target paragraph. While extracting the contract party entity information, the information category representing the relationship between the entity information and the contract party identifier is also extracted. The information set extraction model is used to automatically learn the relationship between entities, avoiding the limitations of using artificial rules to determine information sets. This not only improves the efficiency of determining contract information, but also improves the accuracy of contract information.

[0057] Figure 2 A flowchart of a contract information extraction method according to an embodiment of the present application is shown, including steps 202 to 208.

[0058] Step 202: Obtain a target contract text and extract a target paragraph in the target contract text, wherein the target paragraph contains contract party entity information.

[0059] The execution subject of the contract information extraction method can be a computing device with contract information extraction function, such as a server, terminal, etc. with contract information extraction function.

[0060] Specifically, a contract refers to the behavior of at least two parties reaching an agreement on a matter; a contract text represents a written expression recording the content of the contract in the form of text; a target contract text refers to a contract text to be extracted contract information; entity information refers to the content describing an entity, such as a person's name, place name, organization name, proper noun, etc.; a contract party refers to a party participating in a contract; contract party entity information refers to entity information related to a contract party, such as the address, name, contact information, etc. of a certain contract party; a target paragraph refers to a paragraph in the target contract text containing contract party entity information.

[0061] In practical applications, the file format type of the target contract text can be document format (DOC, Document), text format (txt), picture format, or portable document format (PDF, Portable Document Format), which is not limited by the present application. There are many ways to obtain the target contract text, for example, a contract party can send an acquisition instruction for the target contract text to the execution subject, and accordingly, the execution subject starts to acquire the target contract text after receiving the instruction; or the server can automatically acquire the target contract text to be extracted contract information every preset time interval, for example, the server with contract information extraction function automatically acquires the target contract text in the specified access area after a preset time interval; or the terminal with contract information extraction function automatically acquires the target contract text stored locally after a preset time interval. The present specification does not limit the way to obtain the target contract text.

[0062] Further, based on obtaining the target contract text from which the contract information is to be extracted, the subject performs an extraction operation on the target contract text, so as to extract a target paragraph in the target contract text that carries the contract entity information.

[0063] In a possible implementation of the embodiments of the present disclosure, after obtaining the target contract text, the contract entity information in the target contract text can be determined by an entity information recognition method, and then the paragraph information to which each contract entity information belongs is determined, and further, the target paragraph in the target contract text is extracted according to the paragraph information. In this way, the accuracy of determining the target paragraph can be improved.

[0064] For example, after obtaining the target contract text, the target contract text is recognized by the entity information recognition method, and two contract entity information are determined. Then the first contract entity information is in the third paragraph of the target contract text, and the second contract entity information is in the eighth paragraph of the target contract text. The paragraph information corresponding to the first contract entity information is "the third paragraph", and the paragraph information corresponding to the second contract entity information is "the eighth paragraph". Further, the target paragraph in the target contract text is extracted according to the paragraph information "the third paragraph" and "the eighth paragraph".

[0065] In another possible implementation of the embodiments of the present disclosure, after obtaining the target contract text, the contract entity information in each paragraph of the target contract text can be recognized (each paragraph can be recognized at the same time, or each paragraph can be recognized one by one), the paragraphs in the target contract text are classified, the paragraphs containing the contract entity information are classified into a first category, and the paragraphs not containing the contract entity information are classified into a second category. Then, according to the first category of paragraphs, the target paragraph in the target contract text is extracted. In this way, the speed of extracting the target paragraph can be improved.

[0066] For example, after obtaining the target contract text, the contract entity information in each paragraph of the target contract text is recognized. The target contract text has 10 paragraphs, of which the first paragraph, the second paragraph, the fifth paragraph and the seventh paragraph contain contract entity information and belong to the first category, and the third paragraph, the fourth paragraph, the sixth paragraph, the eighth paragraph, the ninth paragraph and the tenth paragraph do not contain contract entity information and belong to the second category. Then, according to the first paragraph, the second paragraph, the fifth paragraph and the seventh paragraph belonging to the first category, the target paragraph in the target contract text is extracted.

[0067] It should be noted that the target contract text can have only one target paragraph, or can have multiple target paragraphs. The number of target paragraphs needs to be determined according to the actual content of the target contract text.

[0068] Step 204: input the target paragraph into the pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains a contract party identifier, an information category, and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, and the information set label includes a contract party identifier label, an information category label, and a contract party entity information label.

[0069] Specifically, the information set extraction model is a language model based on deep learning, and the information set of the target paragraph can be obtained through the information set extraction model; the contract party identifier refers to an identifier representing a certain contract party, such as A representing the first contract party and B representing the second contract party, or 1 representing the first contract party and 2 representing the second contract party; the information category refers to the category of the contract party entity information, such as the contract party entity information being "a city b district", and the information category being "address"; the first sample paragraph refers to a training sample used to train the information set extraction model, and the information set label and the contract party identifier label, the information category label, and the contract party entity information label in the information set label are used to supervise the training effect of the information set extraction model.

[0070] In a possible implementation manner of the embodiments of the present specification, after the target paragraph is determined, the target paragraph needs to be input into the trained information set extraction model, and then the information set extraction model can first extract each contract party entity information in the target paragraph, then identify the information category of any one contract party entity information, and determine the contract party identifier corresponding to the contract party entity information according to the position information of the contract party entity information in the target paragraph, and further determine an information set according to the contract party entity information, the information category of the contract party entity information, and the contract party identifier corresponding to the contract party entity information. Then, according to the above method, other contract party entity information is traversed, so as to determine all information sets corresponding to the target paragraph. In this way, the accuracy and speed of determining the information set can be improved.

[0071] Exemplarily, assuming that the target paragraph is "they are a city c company and a city d company", the target paragraph is input into the information set extraction model, and two contract party entity information "a city c company" and "a city d company" are extracted, then the information category of "a city c company" is identified as "company name", and then since "a city c company" is the first contract party entity information with the information category of "company name" in the target paragraph, it is determined that the contract party identifier corresponding to "a city c company" is "A", and the first information set includes "A", "company name", and "a city c company". Similarly, the second information set can be obtained for the contract party entity information "a city d company", wherein the second information set includes "B", "company name", and "a city d company".

[0072] In another possible implementation of the embodiments of the present disclosure, after the target paragraph is determined, the target paragraph needs to be input into the trained information set extraction model, and then the information set extraction model performs contract party identification on the target paragraph to obtain at least one contract party identifier. Then, for any one contract party identifier, at least one contract party entity information corresponding to the contract party identifier in the target paragraph is determined, and the information category of each contract party entity corresponding to the contract party identifier is identified, and further, at least one information set is determined according to the contract party identifier, the at least one contract party entity information corresponding to the contract party identifier, and the information category. Then, the other contract party identifiers are traversed according to the above method, so as to determine all information sets corresponding to the target paragraph. In this way, the accuracy and speed of determining the information set can be improved.

[0073] For example, it is assumed that the target paragraph is "they are a city c company and a city d company", the target paragraph is input into the information set extraction model, the information set extraction model performs contract party identification on the target paragraph to obtain two contract party identifiers "A" and "B", and then for the contract party identifier "A", one contract party entity information "a city c company" corresponding to "A" is found in the target paragraph, and then the information category of "a city c company" is identified as "company name", that is, the first information set includes "A", "company name" and "a city c company". Similarly, for the contract party entity information "a city d company", a second information set can be obtained, wherein the second information set includes "B", "company name" and "a city d company".

[0074] In addition, the information set can be represented in the format of a triple, and according to the above example, the triple of the first information set is represented as <A, company name, a city c company>, and the triple of the second information set is represented as <B, company name, a city d company>.

[0075] It should be noted that no matter what way is used, at least one information set corresponding to the target paragraph is obtained by the information set extraction model, the number of the obtained information sets is the same as the number of the contract party entity information in the target paragraph, and the information set corresponds to the contract party entity information one by one.

[0076] Step 206: determining at least one target information set corresponding to the target contract party identifier.

[0077] Specifically, the target contract party identifier can be any one contract party identifier, and the target information set refers to an information set containing the same contract party identifier as the target contract party identifier.

[0078] In actual application, after obtaining the information sets, any contract party identifier, i.e. target contract party identifier, is needed to be compared with the contract party identifiers in each information set. If the same, the information set with the same contract party identifier and target contract party identifier is determined as target information set.

[0079] For example, there are four information sets, the contract party identifier of the first information set is f1, the contract party identifier of the second information set is f2, the contract party identifier of the third information set is f2, and the contract party identifier of the fourth information set is f1. Assuming that the target contract party identifier is f1, the target contract party identifier is compared with the contract party identifiers of the four information sets respectively, and the first information set and the fourth information set are determined as target information set.

[0080] In addition, after obtaining the information sets, the information sets with the same contract party identifier can be divided into a group, i.e. if there are N kinds of contract party identifiers in all information sets, all information sets can be divided into N groups, wherein N is a positive integer. Then the target contract party identifier is matched with the contract party identifiers corresponding to each group, and each information set contained in the group matched successfully is determined as target information set. In this way, the target contract party identifier is compared with the contract party identifiers of each information set, and only the target contract party identifier is compared with the contract party identifiers corresponding to a small number of groups, which reduces the data processing amount of the execution subject and can effectively improve the efficiency of determining the target information set.

[0081] Referring to Table 1, Table 1 is eight information sets and contract party identifiers, wherein the contract party identifiers of information set one, information set three, information set four and information set seven are all V1, and information set one, information set three, information set four and information set seven are divided into a group, and the contract party identifiers corresponding to the group are all V1; the contract party identifiers of information set two, information set five, information set six and information set eight are all V2, and information set two, information set five, information set six and information set eight are divided into a group, and the contract party identifiers corresponding to the group are all V2. If the target contract label is V1, information set one, information set three, information set four and information set seven in the group are determined as target information set respectively; if the target contract label is V2, information set two, information set five, information set six and information set eight in the group are determined as target information set respectively.

[0082] Table 1 Eight information sets and contract party identifiers

[0083] Information Set One Two Three Four Five Six Seven Eight Contractor Identification V1 V2 V1 V1 V2 V2 V1 V2

[0084] It should be noted that in the case where the target contract text contains multiple target paragraphs, when determining the at least one target information set corresponding to the target contract party identifier, the target information set is determined from the information sets corresponding to all target paragraphs. For example, if there are two target paragraphs, the information set corresponding to the first target paragraph has 8, and the information set corresponding to the second target paragraph has 20, then the at least one target information set corresponding to the target contract party identifier is determined from the 28 information sets. In this way, when determining the contract information corresponding to the target contract party identifier according to the target information set, the comprehensiveness and accuracy of the contract information can be ensured.

[0085] Step 208: Determine the contract information corresponding to the target contract party identifier according to the information category and contract party entity information in each target information set.

[0086] Specifically, the contract information refers to the relevant information of the contract party.

[0087] In actual application, after determining the at least one target information set corresponding to the target contract party identifier, the information category and contract party entity information in each target information set can be integrated or merged according to the preset template, and then the contract information corresponding to the target contract party identifier is generated.

[0088] For example, the preset template is "target contract party identifier: contract party entity information 1 (information category 1), contract party entity information 2 (information category 2), …, contract party entity information M (information category M)", where M is a positive integer. Assuming that the target contract party identifier is "Party A", referring to Table 2, Table 2 is four target information sets - information set 1 to information set 4, where information set 1 is "Party A company name certain technology company", information set 2 is "Party A company address certain city district", information set 3 is "Party A representative person Xiaohong", and information set 4 is "Party A contact number 1234567". According to the preset template, the information category and contract party entity information of information set 1 to information set 4 are merged, and the contract information corresponding to the target contract party identifier is obtained. "Party A: certain technology company (company name), certain city district (company address), Xiaohong (representative), 1234567 (contact number)".

[0089] Table 2 Four information sets

[0090] Target Information Set Information Set 1 Information Set 2 Information Set 3 Information Set 4 Contractor Identification Party A Party A Party A Party A Information Category Company Name Company Address Representative Contact Number Contractor Entity Information Some Technology Company Some City, Some District Xiaohong 1234567

[0091] In the above embodiment, by acquiring the target contract text, a target paragraph in the target contract text is extracted, and then the target paragraph is input into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph. Further, at least one target information set corresponding to the target contract party identifier is determined, and contract information corresponding to the target contract party identifier is determined according to the information category and the contract party entity information in each target information set. Through the above method, the target paragraph is input into the pre-trained information set extraction model, at least one information set corresponding to the target paragraph is determined, and the information category representing the relationship between the entity information and the contract party identifier is extracted at the same time as the contract party entity information. The information set extraction model is used to automatically learn the relationship between entities, avoiding the limitations of using artificial rules to determine information sets. Not only the efficiency of determining contract information is improved, but also the accuracy of contract information is improved.

[0092] Figure 3 According to an embodiment of the present application, a method for acquiring a target contract text is provided. The flowchart of the method comprises steps 302 to 304.

[0093] Step 302: Acquire an initial contract text.

[0094] Step 304: In the case where the format of the initial contract text is a non-target format, convert the format of the initial contract text into a target format to obtain a target contract text.

[0095] Specifically, the initial contract text refers to the contract text directly acquired, which represents the textual expression of recording the contract content in the form of text. The target format can be any specified format, such as any one of the document format (DOC, Document), the text format (txt), the picture format, the portable document format (PDF), etc. The non-target format refers to other formats different from the target format. Preferably, the target format is the text format (txt), and the non-target format is other formats except the text format (txt).

[0096] In practical applications, there are various ways to acquire the initial contract text. For example, a contract party can send an acquisition instruction of the initial contract text to a server, and accordingly, the execution subject starts to acquire the initial contract text after receiving the instruction. Alternatively, the server can automatically acquire the initial contract text of the contract information to be extracted every preset time interval. For example, after a preset time interval, the server with the contract information extraction function automatically acquires the initial contract text in the specified storage area. Alternatively, after a preset time interval, the terminal with the contract information extraction function automatically acquires the initial contract text stored locally. The present specification does not make any limitation on the way of acquiring the initial contract text.

[0097] Further, based on the obtained initial contract text, the execution subject identifies the format of the initial contract text, and then compares the format of the initial contract text with the target format. If they are the same, the initial contract text is directly determined as the target contract text. If they are not the same, the format of the initial contract text is a non-target format, and the format of the initial contract text needs to be converted into the target format, so as to obtain the target contract text.

[0098] Exemplarily, the target format is a text format (txt), and when the execution subject identifies that the format of the initial contract text is a text format (DOC), all text contents in the initial contract text are extracted, a text of the text format (txt) is newly created, and the extracted text contents are stored in the text, so as to obtain the target contract text in the text format.

[0099] Exemplarily, the target format is a text format (txt), and when the execution subject identifies that the format of the initial contract text is a picture format or a portable document format (PDF), an optical character recognition (OCR) technology is used to perform text extraction on the initial contract text: a character region is identified, the character region is subjected to rectangular segmentation, is split into different characters, the characters are classified, and text contents are identified. Then, a text of the text format (txt) is newly created, the extracted text contents are stored in the text, so as to obtain the target contract text in the text format.

[0100] It should be noted that steps 302-304 are a specific implementation of the above-mentioned step 202 of "obtaining the target contract text".

[0101] In the embodiment of the application, the initial contract text is obtained, and then it is judged whether the format of the initial contract text is the target format. If yes, it indicates that the format of the initial contract text is standard, and the initial contract text can be directly used as the target contract text. If not, it indicates that the format of the initial contract text is not standard, and therefore, the format of the initial contract text needs to be converted into the target format. The initial contract text after the format conversion is determined as the target contract text, which can avoid the influence of the non-standard format on the extraction of the target paragraph, improve the accuracy of determining the target paragraph, and further improve the efficiency of determining the contract information.

[0102] Figure 4 is a flowchart of a method for determining a target paragraph in a contract information extraction method according to an embodiment of the application, comprising steps 402-408.

[0103] Step 402: Extract at least one initial paragraph in the target contract text, wherein the initial paragraph contains contract party entity information.

[0104] Step 404: determine the paragraph serial number of each initial paragraph in the target contract text.

[0105] Step 406: integrate the multiple initial paragraphs with serial numbers connected to obtain a target paragraph.

[0106] Step 408: determine the initial paragraph without adjacent paragraph serial number as a target paragraph.

[0107] Specifically, the initial paragraph refers to the paragraph containing the entity information of the contract party in the target contract text; the paragraph serial number represents the position of the initial paragraph in the target contract text, for example, if the paragraph serial number is 1, it means that the initial paragraph is the first paragraph in the target contract text, and if the paragraph serial number is 8, it means that the initial paragraph is the eighth paragraph in the target contract text.

[0108] In actual application, after obtaining the target contract text, the entity information of the contract party in the target contract text can be determined by the entity information recognition method, and then the paragraph containing each contract party entity information is determined as an initial paragraph to obtain at least one initial paragraph. Further determine the paragraph serial number of each initial paragraph in the target contract text, and determine whether there are multiple initial paragraphs with serial numbers connected according to the paragraph serial number of each initial paragraph, if there are, then integrate the multiple initial paragraphs with serial numbers connected, that is, according to the order of the paragraph serial number, connect the tail of the initial paragraph with the paragraph serial number in front with the head of the initial paragraph with the paragraph serial number behind, to obtain a target paragraph, and then determine the initial paragraph without adjacent paragraph serial number as a target paragraph; if not, each initial paragraph is determined as a target paragraph.

[0109] For example, after obtaining the target contract text, 8 contract party entity information are determined by identifying the target contract text through the entity information identification method. Then the first contract party entity information is in the first paragraph (first initial paragraph) of the target contract text, the second contract party entity information is in the second paragraph (second initial paragraph) of the target contract text, the third contract party entity information and the fourth contract party entity information are in the fourth paragraph (third initial paragraph) of the target contract text, the fifth contract party entity information is in the sixth paragraph (fourth initial paragraph) of the target contract text, the sixth contract party entity information is in the seventh paragraph (fifth initial paragraph) of the target contract text, the seventh contract party entity information is in the eighth paragraph (sixth initial paragraph) of the target contract text, and the eighth contract party entity information is in the ninth paragraph (seventh initial paragraph) of the target contract text, that is, seven initial paragraphs are determined. Then the paragraph numbers of the first initial paragraph to the seventh initial paragraph are obtained, which are 1, 2, 4, 6, 7, 8 and 9 respectively. Among them, the paragraph number 1 and the paragraph number 2 are connected, so the first initial paragraph and the second initial paragraph are integrated to obtain the first target paragraph; the paragraph number 4 does not exist adjacent paragraph number, so the third initial paragraph is determined as the second target paragraph; the paragraph number 6, the paragraph number 7, the paragraph number 8 and the paragraph number 9 are connected, so the fifth initial paragraph to the eighth initial paragraph are integrated to obtain the third target paragraph. That is, 3 target paragraphs are determined.

[0110] In the above example, it is assumed that the first initial paragraph is "Party A is a city c company." and the second initial paragraph is "Party B is a city d company.", then the first initial paragraph and the second initial paragraph are integrated, that is, the tail of "Party A is a city c company." is connected with the head of "Party B is a city d company.", and the obtained first target paragraph is "Party A is a city c company. Party B is a city d company."

[0111] It should be noted that steps 402-408 are a specific implementation of the above-mentioned step 202 of "extracting target paragraphs in the target contract text".

[0112] In the embodiments of the present application, at least one initial paragraph containing contract party entity information in the target contract text is extracted first, then the paragraph numbers of the initial paragraphs in the target contract text are determined, then the multiple initial paragraphs connected by the paragraph numbers are integrated to obtain the target paragraph, and the initial paragraph without adjacent paragraph number is determined as the target paragraph. Not only can the number of initial paragraphs avoid the information set extraction model processing multiple times, but also based on the characteristic that the contract party entity information of the same information type of each contract party in the contract text appears in pairs, each target paragraph can contain contract entity information of the same information type of each contract party, further improving the efficiency of the information set extraction model, thereby improving the accuracy of the finally determined contract information.

[0113] Figure 5 The method for determining the initial paragraph in the contract information extraction method provided by the embodiment of the application is a flowchart of a method for determining an initial paragraph, and includes steps 502 to 504.

[0114] Step 502: Determine whether each paragraph in the target contract text contains contract party entity information by using a pre-trained classification model, wherein the classification model is trained based on sample texts carrying paragraph labels, and the paragraph label is a paragraph containing contract party entity information in the sample text.

[0115] Step 504: If yes, the paragraph containing the contract party entity information is determined as the initial paragraph.

[0116] Specifically, the classification model is a language model based on deep learning, and the initial paragraph containing the contract party entity information can be extracted by using the classification model. The classification model can be a Bidirectional Encoder Representation from Transformers (BERT) model based on a transformer, or a Fully Convolution Network (FCN) model, or other neural network models based on deep learning, and the application does not limit the classification model. The sample text refers to a training sample used to train the classification model, and the paragraph label is used to supervise the training effect of the classification model.

[0117] In actual application, after the target contract text is obtained, the target contract text can be input into the trained classification model, the classification model analyzes each paragraph in the target contract text, for any one of the paragraphs, the classification model extracts contract party entity information in the paragraph or detects whether the paragraph contains contract party entity information, if the extraction is successful or the contract party entity information is detected, the paragraph is determined as the initial paragraph, if the extraction fails or the contract party entity information is not detected, the paragraph is determined as a normal paragraph. Then the determined initial paragraph is output.

[0118] For example, the target contract text contains two paragraphs: the first paragraph is “They are a city c company and a city d company respectively.”, and the second paragraph is “Welcome to the joy, with drums and gongs.”, wherein “a city c company” and “a city d company” are contract party entity information. The target contract text is input into the trained classification model, the classification model detects the contract party entity information in the first paragraph and does not detect the contract party entity information in the second paragraph, and then the first paragraph is determined as the initial paragraph and the second paragraph is determined as the normal paragraph. Then the initial paragraph is output.

[0119] It should be noted that steps 502-504 are a specific implementation of step 402 described above.

[0120] In the embodiment of the present application, by inputting the target contract into the classification model, the classification model determines whether each paragraph in the target contract text contains contract party entity information, determines the paragraph containing the contract party entity information as the initial paragraph and outputs it, thereby improving the efficiency of determining the initial paragraph and avoiding the problem of manual labeling error.

[0121] Figure 6 The method for determining the information set in the contract information extraction method provided by the embodiment of the present application is a flowchart of the method, comprising steps 602 to 606.

[0122] It is worth noting that the information set extraction model includes a contract party identification layer and a relationship extraction layer.

[0123] Step 602: input the target paragraph into the contract party identification layer to obtain the contract party identifier corresponding to the target paragraph.

[0124] Step 604: input the target paragraph and the contract party identifier corresponding to the target paragraph into the relationship extraction layer to obtain the information category corresponding to the contract party identifier and the contract party entity information.

[0125] Step 606: according to the contract party identifier and the information category and the contract party entity information corresponding to the contract party identifier, determine at least one information set corresponding to the target paragraph.

[0126] Specifically, the contract party identification layer refers to a processing layer for identifying the contract party identifier, which can be a processing layer trained based on the BERT model, or a processing layer trained based on the FCN model, or a processing layer trained based on other self-learning language models, which is not limited in the present application; the relationship extraction layer refers to a processing layer for identifying the contract party entity information corresponding to a contract party identifier and the information category corresponding to the contract party entity information, which can also be a processing layer trained based on the BERT model, or a processing layer trained based on the FCN model, or a processing layer trained based on other self-learning language models, which is not limited in the present application.

[0127] In actual application, after the target paragraph is determined, the target paragraph needs to be input into the contract party identification layer of the information set extraction model, and then the contract party identification layer analyzes the text in the target paragraph, determines the contract party identifier corresponding to the target paragraph according to the analysis result, and obtains at least one contract party identifier. Then the target paragraph and the determined contract party identifier are input into the relationship extraction layer of the information set extraction model, and for any one of the contract party identifiers, the relationship extraction layer obtains the contract party entity information corresponding to the contract party identifier from the target paragraph, and identifies the information category of the contract party entity information, that is, obtains the contract party entity information and the information category corresponding to the contract party identifier. Thus, the contract party identifier and the information category and the contract party entity information corresponding to the contract party identifier are combined to generate at least one information set corresponding to the contract party identifier. All contract party identifiers are traversed to determine at least one information set corresponding to each contract party identifier, that is, at least one information set corresponding to the target paragraph is determined.

[0128] For example, the target paragraph is "They are Li from h1 department and Zhang from h2 department respectively.", the target paragraph "They are Li from h1 department and Zhang from h2 department respectively." is input into the contract party identification layer, and the contract party identification layer obtains two contract party identifiers: the first party and the second party. Then the contract party identifiers "the first party" and "the second party" and the target paragraph "They are Li from h1 department and Zhang from h2 department respectively." are input into the relationship extraction layer: it is identified that the entity information corresponding to "the first party" includes "h1 department" and "Li", and it is identified that the information category of "h1 department" is "department name" and the information category of "Li" is "representative person", and then two information sets are generated: the first information set "the first party department name h1 department" and the second information set "the first party representative person Li"; it is identified that the entity information corresponding to "the second party" includes "h2 department" and "Zhang", and it is identified that the information category of "h2 department" is "department name" and the information category of "Zhang" is "representative person", and then two information sets are generated: the third information set "the second party department name h2 department" and the fourth information set "the second party representative person Zhang". That is, four information sets corresponding to the target paragraph are obtained.

[0129] It should be noted that steps 602-606 are a specific implementation of step 204 described above.

[0130] In the embodiment of the present application, the target paragraph is input into the contract party identification layer to obtain the contract party identifier corresponding to the target paragraph, then the target paragraph and the contract party identifier corresponding to the target paragraph are input into the relationship extraction layer to obtain the information category and the contract party entity information corresponding to the contract party identifier, and then the at least one information set corresponding to the target paragraph is determined according to the contract party identifier and the information category and the contract party entity information corresponding to the contract party identifier. The corresponding relationship between the contract party identifier and the contract party information can be determined at the same time as the contract party identifier and the contract party entity information are extracted, and the information category is determined. The relationship between entities is automatically learned by using the information set extraction model, which avoids the limitation of using artificial rules to determine the corresponding relationship between the contract party identifier and the contract party information, thereby improving the efficiency of determining the information set and the contract information.

[0131] Figure 7 The flowchart of the method for determining the contract party identifier in the contract information extraction method provided by the embodiment of the present application is shown in FIG. 7.

[0132] It is worth noting that the contract party identification layer includes a vector conversion unit and a matrix change unit.

[0133] Step 702: input the target paragraph into the vector conversion unit to obtain the vector corresponding to each character unit in the target paragraph.

[0134] Step 704: input the vector corresponding to each character unit into the matrix change unit respectively to obtain the probability value of each character unit with respect to each contract party identifier.

[0135] Step 706: for any character unit in each character unit, the contract party identifier corresponding to the target probability value corresponding to the character unit is determined as the contract party identifier corresponding to the character unit, wherein the target probability value is a probability value greater than a preset value.

[0136] Specifically, the vector conversion unit is used to convert natural language text into a vector; the matrix change unit is used to perform matrix transformation on the vector and calculate a probability value. The matrix change unit can be a fully connected layer of a neural network model. The probability value represents the possibility of a character unit belonging to a certain contract party identifier. The greater the probability value, the higher the possibility of the character unit belonging to a certain contract party identifier, and vice versa. The character unit is a unit that constitutes the target paragraph. The character unit can be a character or a word. Preferably, the character unit is a character.

[0137] In actual application, the target paragraph is input to the vector conversion unit of the contract party identification layer. Each character unit in the target paragraph is converted into a vector one by one or simultaneously by the vector conversion unit, and the character unit and the vector correspond to each other, that is, the vector corresponding to each character unit is obtained. Then, the vector corresponding to each character unit is input to the matrix change unit, and matrix transformation and calculation are performed, and then the probability value of each character unit relative to each contract party identifier is obtained. For each character unit, the plurality of probability values of the character unit are compared with the preset value. The probability value greater than the preset value is determined as the target probability value (preferably, the maximum probability value is determined as the target probability value), and the contract party identifier corresponding to the target probability value is determined as the contract party identifier corresponding to the character unit. All character units in the target paragraph are traversed, and the contract party identifier corresponding to each character unit is determined, that is, the contract party identifier corresponding to the target paragraph is determined.

[0138] It should be noted that steps 702-706 are a specific implementation of step 602 described above.

[0139] In the embodiment of the application, the target paragraph is input to the vector conversion unit to obtain the vector corresponding to each character unit in the target paragraph, and then the vector corresponding to each character unit is input to the matrix change unit to obtain the probability value of each character unit relative to each contract party identifier. Then, for any character unit in each character unit, the contract party identifier corresponding to the target probability value of the character unit is determined as the contract party identifier corresponding to the character unit, which can extract the contract party identifier while ensuring the accuracy of the extracted contract party identifier, thereby improving the efficiency of determining the information set and the contract information.

[0140] Figure 8 The flowchart of the method for training the information set extraction model according to the contract information extraction method provided in the embodiment of the application includes steps 802 to 810.

[0141] Step 802: Extract a first sample paragraph, input the first sample paragraph to the identification layer of the first network model, and obtain the predicted contract party identifier corresponding to the first sample paragraph.

[0142] Step 804: Input the first sample paragraph and the predicted contract party identifier to the extraction layer of the first network model to obtain the predicted information category and the predicted contract party entity information corresponding to the predicted contract party identifier.

[0143] Step 806: Determine the predicted information set corresponding to the first sample paragraph according to the predicted contract party identifier, the predicted information category and the predicted contract party entity information.

[0144] Step 808: Compare the predicted information set with the information set label carried by the first sample paragraph to obtain a difference value.

[0145] Step 810: If the difference value is greater than a preset threshold value, adjust the parameters of the identification layer and the extraction layer, and return to execute the step of extracting the first sample paragraph until a training stop condition is reached, stop training, and determine the trained identification layer, extraction layer, and first network model as the contract party identification layer, relationship extraction layer, and information set extraction model, respectively.

[0146] Specifically, the first network model is a language model based on deep learning, which is an information set extraction model that has not been trained; the identification layer refers to a contract party identification layer that has not been trained; the extraction layer refers to a relationship extraction layer that has not been trained; the difference value refers to a numerical value determined based on the difference between the predicted information set and the information set label; the preset threshold value refers to a numerical value set in advance to measure whether the information set extraction model meets the standard; and the training stop condition can be that the difference value is less than or equal to the preset threshold value, or that the number of iterations reaches a preset iteration value.

[0147] In actual application, a first sample paragraph can be extracted from the first sample paragraph training set, and then input into the identification layer of the first network model. The identification layer then parses the text in the first sample paragraph, and determines the predicted contract party identifier corresponding to the first sample paragraph according to the parsing result. Then the first sample paragraph and the predicted contract party identifier are input into the extraction layer, which obtains the predicted contract party entity information corresponding to the predicted contract party identifier from the first sample paragraph, and identifies the predicted information category of the predicted contract party entity information, i.e., obtains the predicted contract party entity information and the predicted information category corresponding to the predicted contract party identifier. The predicted contract party identifier, the predicted information category, and the predicted contract party entity information corresponding to the predicted contract party identifier are combined to generate a predicted information set. The predicted information set is compared with the information set label carried by the first sample paragraph, and a difference value is determined according to a preset difference algorithm. Then the difference value and the preset threshold value are compared. When the difference value is greater than the preset threshold value, the parameters of the identification layer and the extraction layer in the first initial model are adjusted, and then another first sample paragraph is extracted from the first sample paragraph training set for the next round of training. When the difference value is less than or equal to the preset threshold value, or the number of iterations reaches a preset iteration value, the training is stopped, and the trained first initial model is determined as the information set extraction model, i.e., the trained identification layer is determined as the contract party identification layer, and the trained extraction layer is determined as the relationship extraction layer.

[0148] It should be noted that steps 802-810 are a specific implementation of training the information set extraction model in steps 204 or 602.

[0149] In the embodiment of the present application, the first sample paragraph is input into the identification layer to obtain the predicted contract party identifier, then the first sample paragraph and the predicted contract party identifier are input into the extraction layer to obtain the predicted information category and the predicted contract party entity information, then the predicted contract party identifier, the predicted information category and the predicted contract party entity information are used to determine the predicted information set, and then the parameters of the identification layer and the extraction layer in the first initial model are adjusted according to the difference value between the predicted information set and the information set label until the training stop condition is reached, and the trained first initial model is determined as the information set extraction model, which can provide an effective method of determining the correspondence between the contract party identifier and the contract party information and determining the information category while extracting the contract party identifier and the contract party entity information, avoiding the limitation of determining the correspondence between the contract party identifier and the contract party information by using artificial rules, thereby improving the efficiency of determining the information set and the contract information.

[0150] Figure 9 The flowchart of the method for adjusting parameters in the contract information extraction method provided by the embodiment of the present application comprises steps 902 to 908.

[0151] Step 902: Compare the predicted contract party identifier with the contract party identifier label to obtain a first difference value.

[0152] Step 904: Compare the predicted contract party identifier with the contract party identifier label, the predicted information category with the information category label, and the predicted contract party entity information with the contract party entity information label to obtain a second difference value.

[0153] Step 906: If the first difference value is greater than a first preset threshold value in the preset threshold value, adjust the parameters of the identification layer.

[0154] Step 908: If the second difference value is greater than a second preset threshold value in the preset threshold value, adjust the parameters of the extraction layer.

[0155] Specifically, the first difference value refers to the prediction result of the contract layer, that is, the difference value determined by the predicted contract party identifier and the contract party identifier label; the second difference value refers to the prediction result of the extraction layer, that is, the difference value determined by the predicted contract party identifier and the contract party identifier label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label; the first preset threshold value refers to a preset value for measuring whether the identification layer meets the standard; the second preset threshold value refers to a preset value for measuring whether the extraction layer meets the standard.

[0156] In actual application, the predicted contract party identifier is compared with the contract party identifier label, a first difference value is determined according to a preset first difference algorithm, and then the predicted contract party identifier and the contract party identifier label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label are compared respectively, and then a second difference value is determined according to a preset second difference algorithm. In the case where the first difference value is greater than a first preset threshold, the parameters of the recognition layer are adjusted, and in the case where the second difference value is greater than a second preset threshold, the parameters of the extraction layer are adjusted, and then a first sample paragraph is extracted from the first sample paragraph training set again for the next round of training. When the first difference value is less than or equal to the first preset threshold and the second difference value is less than or equal to the second preset threshold, or the number of iterations reaches a preset iteration value, the training is stopped, and the trained first initial model is determined as the information set extraction model, that is, the trained recognition layer is determined as the contract party recognition layer, and the trained extraction layer is determined as the relationship extraction layer.

[0157] In addition, according to the predicted contract party identifier and the contract party identifier label, a loss function of the recognition layer can be calculated to generate the first difference value, where the loss function can be a logarithmic loss function, a cross-entropy loss function, a maximum loss function, etc.

[0158] It should be noted that the loss function can be used to evaluate the degree of difference between the predicted result and the true result of the model, and the better the loss function, the better the performance of the model. Different types of models generally use different loss functions. The cross-entropy loss function is essentially a logarithmic likelihood function and can be used in binary classification and multi-classification tasks. When the calculated loss value is large, it indicates that the error between the true result and the predicted result is large, and the parameters of the model can be updated quickly at this time. When the calculated loss value is small, it indicates that the error between the true result and the predicted result is small, and the parameters of the model can be updated slowly at this time. Using the cross-entropy loss function can avoid gradient dispersion when calculating the gradient.

[0159] In actual application, models are generally divided into two categories: classification models and regression models. For classification models, the cross-entropy loss function is generally used first to avoid gradient dispersion. Since the recognition layer in this application actually identifies which contract party identifier in the first sample paragraph, it is actually a classification model, and therefore the cross-entropy loss function is used first in the embodiments of this application to train the recognition layer.

[0160] In specific implementation, the first difference value determined based on the predicted contract party identifier and the contract party identifier label can be calculated by the following formula (1):

[0161]

[0162] Wherein, LOSS1 represents the first difference value, i.e., the loss value of the identification layer, N represents the number of categories to be identified by the identification layer, y(i) represents the contract party identification label, i.e., the true result, and f(x(i)) represents the predicted contract party identification output by the identification layer, i.e., the predicted result.

[0163] In a possible implementation, the identification layer is a neural network model, and when the parameters of the identification layer are adjusted based on the calculated first difference value, the parameters of the identification layer can be adjusted through the back propagation of the first difference value. Specifically, after the first difference value is calculated, the first difference value can be passed to the last layer of the identification layer. The first difference value can represent the size of the current error, so the last layer can automatically adjust its own parameters according to the received first difference value. Then the last layer can pass the first difference value to the previous layer in reverse, and the previous layer can also automatically adjust its own parameters according to the received first difference value, and so on, until the first difference value is passed to the first layer of the identification layer, and one parameter adjustment is completed.

[0164] It should be noted that the contract party identification label is the true result of the first sample paragraph, and the predicted contract party identification is the predicted result of the first sample paragraph. By calculating the first difference value, the difference between the predicted result and the true result of the identification layer can be intuitively shown, and the identification layer can be trained and the parameters can be adjusted based on the first difference value, which can effectively improve the training rate and the training effect of the identification layer.

[0165] In addition, based on the predicted contract party identification and the contract party identification label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label, a loss function of the extraction layer can be calculated to generate a second difference value, wherein the loss function can be a logarithmic loss function, a cross-entropy loss function, a maximum loss function, etc. Like the identification layer, the extraction layer actually identifies which contract party identification the corresponding predicted information set in the first sample paragraph belongs to, i.e., it is actually a kind of classification model, so the cross-entropy loss function is preferred for training the extraction in the embodiments of the present application.

[0166] In a specific implementation, the second difference value can be calculated based on the predicted contract party identification and the contract party identification label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label, by the following formula (2):

[0167]

[0168] wherein LOSS2 represents the second difference value, i.e., the loss value of the extraction layer, M represents the number of categories to be extracted by the extraction layer, y(i) represents the contract party identification label, i.e., the true result, f(x(i)) represents the predicted contract party identification, i.e., the predicted result, q(i) represents the information category label, i.e., the true result, f(p(i)) represents the predicted information category, i.e., the predicted result, h(i) represents the contract party entity information label, i.e., the true result, and f(g(i)) represents the predicted contract party entity information, i.e., the predicted result.

[0169] In a possible implementation, the extraction layer is a neural network model, and when the parameters of the extraction layer are adjusted based on the calculated second difference value, the parameters of the extraction layer can be adjusted through the back propagation of the second difference value. Specifically, after the second difference value is calculated, the second difference value can be passed to the last layer of the extraction layer. The second difference value can represent the size of the current error, and thus the last layer can automatically adjust its own parameters according to the received second difference value. Then, the last layer can pass the second difference value to the previous layer in reverse, and the previous layer can also automatically adjust its own parameters according to the received second difference value. This process is repeated until the second difference value is passed to the first layer of the extraction layer, and one round of parameter adjustment is completed.

[0170] It should be noted that the contract party identification label, the information category label, and the contract party entity information label are the true results of the first sample paragraph, and the predicted contract party identification, the predicted information category, and the predicted contract party entity information are the predicted results of the first sample paragraph. By calculating the second difference value, the difference between the predicted results and the true results of the extraction layer can be intuitively shown, and the extraction layer can be trained based on the second difference value to adjust the parameters, which can effectively improve the training rate and the training effect of the extraction layer.

[0171] It should be noted that steps 902-904 are a specific implementation of step 808, and steps 906-908 are a specific implementation of step 810.

[0172] In the embodiments of the present application, the first difference value is determined by comparing the predicted contract party identifier and the contract party identifier label, the second difference value is determined by comparing the predicted contract party identifier and the contract party identifier label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label, then the parameters of the recognition layer are adjusted when the first difference value is greater than the first preset threshold, and the parameters of the extraction layer are adjusted when the second difference value is greater than the second preset threshold. In this way, the first initial model is adjusted by the two difference values, which can accelerate the training efficiency of the first initial model, make the first initial model converge quickly, and thus provide an effective method of determining the correspondence between the contract party identifier and the contract party information and determining the information category while extracting the contract party identifier and the contract party entity information, avoiding the limitations of determining the correspondence between the contract party identifier and the contract party information using artificial rules, thereby improving the efficiency of determining the information set and the contract information.

[0173] Figure 10 The flowchart of the method for training the classification model in the contract information extraction method provided by the embodiments of the present application comprises steps 1002 to 1006.

[0174] Step 1002: Extracting a sample text, inputting the sample text into the second network model to obtain a predicted paragraph in the sample text.

[0175] Step 1004: Determining a first loss value according to the predicted paragraph and the paragraph label carried by the sample text.

[0176] Step 1006: If the first loss value is greater than a first preset loss value, adjusting the parameters of the second network model, and returning to execute the step of extracting the sample text until a training stop condition is reached, stopping training, and determining the second network model that has completed training as the classification model.

[0177] Specifically, the second network model is a language model based on deep learning, which is a classification model that has not been trained; the first loss value is a value determined based on the difference between the predicted paragraph and the paragraph label; the first preset loss value is a value set in advance to measure whether the classification model meets the standard; the training stop condition can be that the first loss value is less than or equal to the first preset loss value, or that the number of iterations reaches a preset iteration value.

[0178] In actual application, a sample text can be extracted from the sample text training set, and then the sample text is input into the second network model. Then the second network model parses the paragraphs in the sample text, and determines the predicted paragraph corresponding to the sample text according to the parsing result. Further, the predicted paragraph is compared with the paragraph label carried by the sample text, and the first loss value is determined according to the preset loss function. Then the first loss value and the first preset loss value are compared, and in the case that the first loss value is greater than the first preset loss value, the parameters of the second initial model are adjusted. Then a sample text is extracted from the sample text training set again for the next round of training. When the first loss value is less than or equal to the first preset loss value, or the number of iterations reaches the preset iteration value, the training is stopped, and the trained second initial model is determined as the classification model.

[0179] In addition, according to the predicted paragraph and the paragraph label, the loss function of the second network model can be calculated to generate the first loss value, wherein the loss function can be a logarithmic loss function, a cross-entropy loss function, a maximum loss function, etc.

[0180] It should be noted that the loss function can be used to evaluate the difference between the predicted result and the true result of the model. The better the loss function, the better the performance of the model. Different types of models generally use different loss functions. The cross-entropy loss function is essentially a logarithmic likelihood function, which can be used in binary classification and multi-classification tasks. When the first loss value is large, it indicates that the error between the true result and the predicted result is large, and the parameters of the model can be updated quickly. When the first loss value is small, it indicates that the error between the true result and the predicted result is small, and the parameters of the model can be updated slowly. Using the cross-entropy loss function can avoid gradient dispersion when calculating the gradient.

[0181] In actual application, models are generally divided into two categories: classification models and regression models. For classification models, the cross-entropy loss function is generally used to avoid gradient dispersion. Since the second network model in this application is actually identifying which paragraph in the sample text contains the contract party entity information, it is actually a classification model. Therefore, the cross-entropy loss function is used to train the second network model in the embodiments of the application.

[0182] In specific implementation, the first loss value determined based on the predicted paragraph and the paragraph label can be calculated by the following formula (3):

[0183]

[0184] Wherein, LOSS3 represents the first loss value of the second network model, L represents the number of categories that need to be classified by the second network model, s(i) represents the paragraph label, i.e. the real result, and f(t(i)) represents the predicted paragraph output by the second network model, i.e. the predicted result.

[0185] In a possible implementation, the second network model is a neural network model, and when the parameters of the second network model are adjusted based on the calculated first loss value, the parameters of the second network model can be adjusted through the back propagation of the first loss value. Specifically, after the first loss value is calculated, the first loss value can be passed to the last layer of the second network model. The first loss value can represent the size of the current error, so the last layer can automatically adjust its own parameters according to the received first loss value. Then the last layer can pass the first loss value back to the previous layer. After the previous layer receives the first loss value, it can also automatically adjust its own parameters according to the received first loss value. In this way, the first loss value is passed to the first layer of the second network model, and one parameter adjustment is completed.

[0186] It should be noted that the paragraph label is the real result of the sample text, and the predicted paragraph is the predicted result of the sample text. The difference between the predicted result and the real result of the second network model can be intuitively shown by calculating the first loss value. Then the second network model is trained based on the first loss value, and the parameters are adjusted, which can effectively improve the training rate of the second network model and the training effect of the recognition layer.

[0187] It should be noted that steps 1002-1006 are a specific implementation of training the classification model in step 502.

[0188] In the embodiments of the present application, by extracting the sample text, the sample text is input into the second network model to obtain the predicted paragraph in the sample text. Then, according to the predicted paragraph and the paragraph label carried by the sample text, the first loss value is determined. Then, if the first loss value is greater than the first preset loss value, the parameters of the second network model are adjusted, and the step of extracting the sample text is returned to be executed until the training stopping condition is reached, the training is stopped, and the second network model that is determined to be trained is determined as the classification model. An effective method for extracting the initial paragraph carrying the contract party entity information in the target contract text is provided, the efficiency of determining the initial paragraph is improved, and the problem of manual labeling error is avoided.

[0189] Figure 11A According to the contract information extraction method provided in the embodiments of the present application, the flow chart of the method for obtaining the target contract text comprises steps 1102 to 1104.

[0190] Step 1102: input the target paragraph into the pre-trained contract basic information extraction model to obtain at least one contract entity in the target paragraph and a corresponding entity type, wherein the contract basic information extraction model is trained based on a second sample paragraph carrying an entity label and an entity type label.

[0191] Step 1104: merge the at least one contract entity and the corresponding entity type and the target contract party identifier into corresponding contract information to obtain contract text information corresponding to the target contract text.

[0192] Specifically, the contract basic information extraction model is a language model based on deep learning. Through the contract basic information extraction model, the contract entity of the target paragraph and the entity type corresponding to the contract entity can be obtained. The contract basic information extraction model can be a bidirectional encoder representation from transformers (BERT) model based on a transformer, can also be a model combining a BERT model and conditional random fields (CRF), and can also be other deep learning neural network models, which are not limited in the present application. The contract entity refers to an object or thing in the target paragraph that exists objectively in the real world and can be distinguished from each other, such as a person's name, an address name, a contract name, a date, etc. The entity type refers to the type of the contract entity, for example, if the contract entity is "January 1, 2020", the entity type is "signing date". The second sample paragraph refers to a training sample used to train the contract basic information extraction model. The entity label and the entity type label are used to supervise the training effect of the contract basic information extraction model.

[0193] In a possible implementation of the embodiment of the present disclosure, after the target paragraph is determined, the target paragraph needs to be input into the trained contract basic information extraction model, and then the contract basic information extraction model analyzes the target paragraph. Each contract entity in the target paragraph can be extracted first, and then the entity type of any one contract entity is identified. Alternatively, one contract entity is extracted from the target paragraph, and the entity type of the contract entity is identified. Then, the next contract entity is extracted from the target paragraph, and so on. In this way, the speed and accuracy of extracting contract entities and corresponding entity types can be improved. Further, the contract information corresponding to at least one contract entity and the corresponding entity type and the target contract party identifier is merged to obtain the contract text information corresponding to the target contract text. In this way, the contract basic information (at least one contract entity and the corresponding entity type) and the contract information corresponding to the target contract party identifier are extracted more accurately by combining multiple models. In addition, the two models can operate in parallel, and the accuracy of extraction is optimized without changing the calculation speed, and the efficiency of extracting the contract text information corresponding to the target contract text is improved.

[0194] Referring to Table 3, Table 3 is a contract text information, which includes four contract entities and corresponding entity types and contract information corresponding to two target contract party identifiers. The four contract entities and corresponding entity types are as follows: the contract entity “certain contract” corresponds to the entity type “contract name”, the contract entity “123123” corresponds to the entity type “contract number”, the contract entity “January 1, 2020” corresponds to the entity type “signing date”, and the contract entity “January 1, 2020” corresponds to the entity type “signing date”. The contract information corresponding to the two target contract party identifiers is as follows: the contract information corresponding to the target contract party identifier “contract party 1” and the contract information corresponding to the target contract party identifier “contract party 2”. The contract information corresponding to “contract party 1” includes: contract party role—party A, contract party name 1—23456 Co., Ltd., contract party address—A City B County, contract party telephone—1111111, and contract party representative—Xiaohua. The contract information corresponding to “contract party 2” includes: contract party role—party B, contract party name—654321 Co., Ltd., contract party address—C City D County, contract party telephone—2222222, and contract party representative—Xiaocao.

[0195] Table 3 is a contract text information

[0196]

[0197]

[0198] Referring to Figure 11B , Figure 11BA processing flowchart of a method for obtaining a target contract text in a contract information extraction method provided by an embodiment of the present application is shown: first, the target contract text is obtained, and then target paragraphs are extracted from the target contract text. Further, the target paragraphs are processed in two ways: first, the contract information corresponding to the target contract party identifier is determined, that is, the target paragraphs are input into the information set extraction model to obtain at least one information set corresponding to the target paragraphs, at least one target information set corresponding to the target contract party identifier is determined, and the contract information corresponding to the target contract party identifier is determined according to the information categories and contract party entity information in each target information set; second, at least one contract entity and the corresponding entity type are determined, that is, the target paragraphs are input into the contract basic information extraction model to obtain at least one contract entity in the target paragraphs and the corresponding entity type. Finally, the contract information corresponding to the target contract party identifier and the at least one contract entity and the corresponding entity type are merged to determine the contract text information corresponding to the target contract text.

[0199] In an embodiment of the present application, the target paragraphs are input into the pre-trained contract basic information extraction model to obtain at least one contract entity in the target paragraphs and the corresponding entity type, wherein the contract basic information extraction model is trained based on the second sample paragraphs carrying entity labels and entity type labels; the at least one contract entity and the corresponding entity type and the contract information corresponding to the target contract party identifier are merged into the contract text information corresponding to the target contract text, which can extract contract basic information (at least one contract entity and the corresponding entity type) based on the contract basic information extraction model, extract contract information based on the information set extraction model, combine multiple models to more accurately determine contract basic information and contract information, in addition, the two models can operate in parallel, optimize the extraction accuracy under the condition of unchanged calculation speed, and improve the efficiency of extracting the contract text information corresponding to the target contract text.

[0200] Figure 12 A flowchart of a method for training a contract basic information extraction model in a contract information extraction method provided by an embodiment of the present application is shown, which includes steps 1202 to 1206.

[0201] Step 1202: Extract the second sample paragraph, input the second sample paragraph into the third network model, and obtain the predicted contract entity in the second sample paragraph and the corresponding predicted entity type.

[0202] Step 1204: Determine the second loss value according to the predicted contract entity, the predicted entity type, and the entity label and the entity type label carried by the second sample paragraph.

[0203] Step 1206: If the second loss value is greater than the second preset loss value, the parameters of the third network model are adjusted, and the step of extracting the second sample paragraph is executed again until the training stopping condition is reached, the training is stopped, and the third network model after training is completed is determined as the contract basic information extraction model.

[0204] Specifically, the third network model is a language model based on deep learning, which is a classification model that has not been trained; the second loss value is a value determined based on the difference between the predicted contract entity and the corresponding predicted entity type, entity label and entity type label; the second preset loss value is a value set in advance, which is used to measure whether the contract basic information extraction model meets the standard; the training stopping condition can be that the second loss value is less than or equal to the second preset loss value, or the number of iterations reaches a preset iteration value.

[0205] In practical applications, a second sample paragraph can be extracted from the second sample paragraph training set, and then input into the third network model. Then the third network model analyzes the second sample paragraph, and determines the predicted contract entity and the corresponding predicted entity type in the second sample paragraph according to the analysis result. Further, the predicted contract entity and the corresponding predicted entity type are compared with the entity label and the entity type label carried by the second sample paragraph, and the second loss value is determined according to the preset loss function. Then the size of the second loss value and the second preset loss value is compared, and the parameters of the third initial model are adjusted in the case that the second loss value is greater than the second preset loss value. Then a second sample paragraph is extracted from the second sample paragraph training set again for the next round of training. When the second loss value is less than or equal to the second preset loss value, or the number of iterations reaches a preset iteration value, the training is stopped, and the third initial model after training is determined as the classification model.

[0206] In addition, according to the predicted contract entity, the predicted entity type and the entity label and the entity type label carried by the second sample paragraph, the loss function of the third network model can be calculated to generate the second loss value, wherein the loss function can be a logarithmic loss function, a cross-entropy loss function, a maximum loss function, etc.

[0207] It should be noted that the loss function can be used to evaluate the difference between the prediction result of the model and the true result, the better the loss function, the better the performance of the model, and different types of models generally use different loss functions. The cross-entropy loss function is essentially a log-likelihood function and can be used in binary classification and multi-classification tasks. When the calculated second loss value is larger, it indicates that the error between the true result and the predicted result is larger, and the parameters of the model can be updated faster at this time. When the calculated second loss value is small, it indicates that the error between the true result and the predicted result is small, and the parameters of the model can be updated slowly at this time. Using the cross-entropy loss function can avoid gradient dispersion when calculating the gradient.

[0208] In practical applications, models are generally divided into two categories: classification models and regression models. For classification models, the cross-entropy loss function is generally used to avoid gradient dispersion. Since the third network model in the present application is actually used to identify which content in the second sample paragraph is a contract entity, it is actually a classification model. Therefore, the cross-entropy loss function is used to train the identification layer in the embodiments of the present application.

[0209] In specific implementations, the second loss value can be calculated based on the predicted contract entity, the predicted entity type, the entity label, and the entity type label by the following formula (4):

[0210]

[0211] Where LOSS4 represents the second loss value of the third network model, R represents the number of categories that need to be classified by the third network model, g(i) represents the entity label and the entity type label, i.e., the true result, and f(h(i)) represents the predicted contract entity and the predicted entity type output by the second network model, i.e., the predicted result.

[0212] In one possible implementation, the third network model is a neural network model. When adjusting the parameters of the third network model based on the calculated second loss value, the parameters of the third network model can be adjusted by the reverse gradient propagation of the second loss value. Specifically, after the second loss value is calculated, the second loss value can be passed to the last layer of the third network model. The second loss value can represent the size of the current error, so the last layer can automatically adjust its own parameters according to the received second loss value. Then the last layer can pass the second loss value to the previous layer in reverse, and the previous layer can also automatically adjust its own parameters according to the received second loss value after receiving the second loss value. In this way, the second loss value is passed to the first layer of the third network model, and one parameter adjustment is completed.

[0213] It should be noted that the entity label and entity type label are the actual results of the second sample paragraph, and the predicted contract entity and predicted entity type are the predicted results of the second sample paragraph. By calculating the second loss value, the difference between the predicted results and the actual results of the third network model can be intuitively shown. Based on the second loss value, the third network model is trained in a targeted manner and the parameters are adjusted, which can effectively improve the training rate of the third network model and the effect of the recognition layer training.

[0214] It should be noted that steps 1202 to 1206 are a specific implementation method for training the contract basic information extraction model in step 1102 above.

[0215] In an embodiment of the present application, by extracting a second sample paragraph, the second sample paragraph is input into the third network model to obtain the predicted contract entity and the corresponding predicted entity type in the second sample paragraph; the second loss value is determined based on the predicted contract entity, the predicted entity type, and the entity label and entity type label carried by the second sample paragraph; if the second loss value is greater than the second preset loss value, the parameters of the third network model are adjusted, and the step of extracting the second sample paragraph is returned to execute until the training stop condition is reached, the training is stopped, and the third network model that has completed the training is determined to be a contract basic information extraction model, which can provide an effective method for extracting the contract entities and the corresponding entity types contained in the target paragraph, improve the efficiency of determining the contract entities and the corresponding entity types, and avoid the problem of manual labeling errors.

[0216] The following combined Figure 13 , further describes the contract information extraction method. Figure 13 A processing flow chart of a contract information extraction method provided in an embodiment of the present application is shown, including steps 1302 to 1336.

[0217] Step 1302: extract a first sample paragraph, input the first sample paragraph into the recognition layer of the first network model, and obtain a predicted contract party identifier corresponding to the first sample paragraph.

[0218] Step 1304: Input the first sample paragraph and the predicted contract party identifier into the extraction layer of the first network model to obtain the predicted information category and predicted contract party entity information corresponding to the predicted contract party identifier.

[0219] Step 1306: Determine the prediction information set corresponding to the first sample paragraph based on the prediction contract party identifier, the prediction information category, and the prediction contract party entity information.

[0220] Step 1308: Compare the predicted information set with the information set label carried by the first sample paragraph to obtain a difference value.

[0221] The information set label includes a contract party identification label, an information category label, and a contract party entity information label.

[0222] Optionally, the comparison of the predicted information set and the information set label carried by the first sample paragraph includes:

[0223] The first difference value is obtained by comparing the predicted contract party identification and the contract party identification label.

[0224] The second difference value is obtained by comparing the predicted contract party identification and the contract party identification label, the predicted information category and the information category label, and the predicted contract party entity information and the contract party entity information label.

[0225] Step 1310: If the difference value is greater than a preset threshold value, the parameters of the recognition layer and the extraction layer are adjusted, and the step of extracting the first sample paragraph is executed until a training stop condition is reached, the training is stopped, and the recognition layer, the extraction layer, and the first network model that complete the training are determined as a contract party recognition layer, a relationship extraction layer, and an information set extraction model respectively.

[0226] Optionally, if the difference value is greater than the preset threshold value, the parameters of the recognition layer and the extraction layer are adjusted, including:

[0227] If the first difference value is greater than a first preset threshold value in the preset threshold value, the parameters of the recognition layer are adjusted.

[0228] If the second difference value is greater than a second preset threshold value in the preset threshold value, the parameters of the extraction layer are adjusted.

[0229] Step 1312: The sample text is extracted, and the sample text is input into the second network model to obtain a predicted paragraph in the sample text.

[0230] Step 1314: A first loss value is determined according to the predicted paragraph and a paragraph label carried by the sample text.

[0231] The paragraph label is a paragraph containing contract party entity information in the sample text.

[0232] Step 1316: If the first loss value is greater than a first preset loss value, the parameters of the second network model are adjusted, and the step of extracting the sample text is executed until a training stop condition is reached, the training is stopped, and the second network model that completes the training is determined as a classification model.

[0233] Step 1318: A second sample paragraph is extracted, and the second sample paragraph is input into a third network model to obtain a predicted contract entity and a corresponding predicted entity type in the second sample paragraph.

[0234] Step 1320: A second loss value is determined according to the predicted contract entity, the predicted entity type, and an entity label and an entity type label carried by the second sample paragraph.

[0235] Step 1322: If the second loss value is greater than the second preset loss value, adjust the parameters of the third network model, and return to execute the step of extracting the second sample paragraph until the training stopping condition is reached, stop training, and determine the third network model that has completed training as the contract basic information extraction model.

[0236] Step 1324: Obtain an initial contract text.

[0237] Step 1326: In the case where the format of the initial contract text is a non-target format, convert the format of the initial contract text into a target format to obtain a target contract text.

[0238] Step 1328: Determine a paragraph containing contract party entity information as an initial paragraph using a pre-trained classification model to obtain at least one initial paragraph.

[0239] The initial paragraph contains contract party entity information.

[0240] Step 1330: Determine the paragraph number of each initial paragraph in the target contract text.

[0241] Step 1332: Integrate multiple initial paragraphs connected by paragraph numbers to obtain a target paragraph; determine an initial paragraph that does not have an adjacent paragraph number as a target paragraph.

[0242] Step 1334: Input the target paragraph into the contract party identification layer of the information set extraction model to obtain the contract party identifier corresponding to the target paragraph.

[0243] The contract party identification layer includes a vector conversion unit and a matrix change unit.

[0244] Inputting the target paragraph into the contract party identification layer to obtain the contract party identifier corresponding to the target paragraph includes:

[0245] Inputting the target paragraph into the vector conversion unit to obtain the vector corresponding to each character unit in the target paragraph.

[0246] Inputting the vector corresponding to each character unit into the matrix change unit to obtain the probability value of each character unit with respect to each contract party identifier.

[0247] For any character unit in each character unit, the contract party identifier corresponding to the target probability value corresponding to the character unit is determined as the contract party identifier corresponding to the character unit, wherein the target probability value is a probability value greater than a preset value.

[0248] Step 1336: Input the target paragraph and the contract party identifier corresponding to the target paragraph into the relationship extraction layer of the information set extraction model to obtain the information category corresponding to the contract party identifier and the contract party entity information.

[0249] Step 1338: Determine at least one information set corresponding to the target paragraph based on the contract party identifier, the information category corresponding to the contract party identifier, and the contract party entity information.

[0250] Step 1340: Determine at least one target information set corresponding to the target contract party identifier.

[0251] Step 1342: Determine the contract information corresponding to the target contract party identifier based on the information category and contract party entity information in each target information set.

[0252] Step 1344: Input the target paragraph into the pre-trained contract basic information extraction model to obtain at least one contract entity and the corresponding entity type in the target paragraph;

[0253] Step 1346: Merge the contract information corresponding to the at least one contract entity, the corresponding entity type, and the target contract party identifier into contract text information corresponding to the target contract text.

[0254] The contract information method provided in the present application determines at least one information set corresponding to the target paragraph by inputting the target paragraph into a pre-trained information set extraction model. While extracting the entity information of the contracting parties, it also extracts the information category that characterizes the relationship between the entity information and the contracting party identifier. The information set extraction model is used to automatically learn the relationship between entities, avoiding the limitations of using manual rules to determine the information set, thereby improving not only the efficiency of determining contract information, but also the accuracy of contract information.

[0255] Corresponding to the above method embodiment, the present application also provides a contract information extraction device embodiment, Figure 14 FIG. 1 shows a schematic diagram of the structure of a contract information extraction device provided by an embodiment of the present application. Figure 14 As shown, the device includes:

[0256] An extraction module 1402 is configured to obtain a target contract text and extract a target paragraph from the target contract text, wherein the target paragraph contains the contract party entity information;

[0257] Input module 1404 is configured to input a target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set includes a contract party identifier, an information category, and contract party entity information, and the information set extraction model is trained based on a first sample paragraph carrying information set labels, wherein the information set labels include a contract party identifier label, an information category label, and a contract party entity information label;

[0258] A first determining module 1406 is configured to determine at least one target information set corresponding to the target contract party identifier;

[0259] The second determination module 1408 is configured to determine contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set.

[0260] Optionally, the extraction module 1402 is further configured to:

[0261] obtain the initial contract text;

[0262] convert the format of the initial contract text into the target format to obtain the target contract text, in a case where the format of the initial contract text is a non-target format.

[0263] Optionally, the extraction module 1402 is further configured to:

[0264] extract at least one initial paragraph in the target contract text, wherein the initial paragraph contains contract party entity information;

[0265] determine a paragraph serial number of each initial paragraph in the target contract text;

[0266] integrate a plurality of initial paragraphs with adjacent paragraph serial numbers to obtain a target paragraph;

[0267] determine an initial paragraph without an adjacent paragraph serial number as a target paragraph.

[0268] Optionally, the extraction module 1402 is further configured to:

[0269] use a pre-trained classification model to respectively determine whether each paragraph in the target contract text contains contract party entity information, wherein the classification model is trained based on sample texts carrying paragraph labels, and the paragraph label is a paragraph containing contract party entity information in the sample text;

[0270] if yes, determine the paragraph containing the contract party entity information as an initial paragraph.

[0271] Optionally, the information set extraction model comprises a contract party identification layer and a relationship extraction layer.

[0272] The input module 1404 is further configured to:

[0273] input the target paragraph into the contract party identification layer to obtain a contract party identifier corresponding to the target paragraph;

[0274] input the target paragraph and the contract party identifier corresponding to the target paragraph into the relationship extraction layer to obtain an information category and contract party entity information corresponding to the contract party identifier;

[0275] determine at least one information set corresponding to the target paragraph according to the contract party identifier and the information category and contract party entity information corresponding to the contract party identifier.

[0276] Optionally, the contract party identification layer comprises a vector conversion unit and a matrix transformation unit.

[0277] The input module 1404 is further configured to:

[0278] input the target paragraph into the vector conversion unit to obtain a vector corresponding to each character unit in the target paragraph;

[0279] input the vector corresponding to each character unit into the matrix transformation unit to obtain a probability value of each character unit with respect to each contract party identifier;

[0280] for any character unit in the character units, determine the contract party identifier corresponding to the target probability value of the character unit as the contract party identifier corresponding to the character unit, wherein the target probability value is a probability value greater than a preset value.

[0281] Optionally, the apparatus further comprises a first training module configured to:

[0282] extract a first sample paragraph, input the first sample paragraph into the identification layer of the first network model to obtain a predicted contract party identifier corresponding to the first sample paragraph;

[0283] input the first sample paragraph and the predicted contract party identifier into the extraction layer of the first network model to obtain a predicted information category corresponding to the predicted contract party identifier and predicted contract party entity information;

[0284] determine a predicted information set corresponding to the first sample paragraph according to the predicted contract party identifier, the predicted information category, and the predicted contract party entity information;

[0285] compare the predicted information set with an information set label carried by the first sample paragraph to obtain a difference value;

[0286] if the difference value is greater than a preset threshold, adjust parameters of the identification layer and the extraction layer, and return to perform the step of extracting the first sample paragraph until a training stop condition is reached, stop training, and determine that the identification layer, the extraction layer, and the first network model that have completed training are a contract party identification layer, a relationship extraction layer, and an information set extraction model, respectively.

[0287] Optionally, the first training module is further configured to:

[0288] compare the predicted contract party identifier with a contract party identifier label to obtain a first difference value;

[0289] compare the predicted contract party identifier with the contract party identifier label, the predicted information category with an information category label, and the predicted contract party entity information with a contract party entity information label to obtain a second difference value;

[0290] If the difference value is greater than a preset threshold, parameters of the recognition layer and the extraction layer are adjusted, including:

[0291] If the first difference value is greater than a first preset threshold in the preset threshold, parameters of the recognition layer are adjusted.

[0292] If the second difference value is greater than a second preset threshold in the preset threshold, parameters of the extraction layer are adjusted.

[0293] Optionally, the apparatus further comprises a second training module configured to:

[0294] extracting a sample text, inputting the sample text into a second network model to obtain a predicted paragraph in the sample text;

[0295] determining a first loss value according to the predicted paragraph and a paragraph label carried by the sample text;

[0296] If the first loss value is greater than a first preset loss value, adjusting parameters of the second network model, and returning to execute the step of extracting the sample text until a training stop condition is reached, stopping training, and determining the second network model that has completed training as a classification model.

[0297] Optionally, the apparatus further comprises a merging module configured to:

[0298] inputting the target paragraph into a pre-trained contract basic information extraction model to obtain at least one contract entity in the target paragraph and a corresponding entity type, wherein the contract basic information extraction model is trained based on a second sample paragraph carrying an entity label and an entity type label;

[0299] merging the at least one contract entity and the corresponding entity type and the target contract party identifier corresponding contract information into contract text information corresponding to the target contract text.

[0300] Optionally, the apparatus further comprises a third training module configured to:

[0301] extracting a second sample paragraph, inputting the second sample paragraph into a third network model to obtain a predicted contract entity in the second sample paragraph and a corresponding predicted entity type;

[0302] determining a second loss value according to the predicted contract entity, the predicted entity type, and the entity label and the entity type label carried by the second sample paragraph;

[0303] If the second loss value is greater than a second preset loss value, adjusting parameters of the third network model, and returning to execute the step of extracting the second sample paragraph until a training stop condition is reached, stopping training, and determining the third network model that has completed training as a contract basic information extraction model.

[0304] The contract information extraction device provided in the application extracts a target paragraph in a target contract text, inputs the target paragraph into a pre-trained information set extraction model, obtains at least one information set corresponding to the target paragraph, further determines at least one target information set corresponding to a target contract party identifier, and determines contract information corresponding to the target contract party identifier according to information categories and contract party entity information in each target information set. Through the above method, the target paragraph is input into the pre-trained information set extraction model, at least one information set corresponding to the target paragraph is determined, and the information categories representing the relationship between the entity information and the contract party identifier are extracted at the same time when the contract party entity information is extracted. The information set extraction model is used to automatically learn the relationship between entities, the limitations of using artificial rules to determine information sets are avoided, the efficiency of determining contract information is improved, and the accuracy of contract information is improved.

[0305] The above is a schematic scheme of the contract information extraction device of the embodiment. It should be noted that the technical scheme of the contract information extraction device belongs to the same concept as the technical scheme of the contract information extraction method described above, and the details of the technical scheme of the contract information extraction device that are not described in detail can be referred to the description of the technical scheme of the contract information extraction method. In addition, each component in the device embodiment should be understood as a function module that must be established to realize each step of the program flow or each step of the method. Each function module is not limited by actual functional segmentation or separation. The device claim defined by such a group of function modules should be understood as a function module architecture that mainly realizes the solution through the computer program recorded in the specification, and should not be understood as an entity device that mainly realizes the solution through hardware.

[0306] Figure 15 A structural block diagram of a computing device 1500 according to an embodiment of the application is shown. The components of the computing device 1500 include but are not limited to a memory 1510 and a processor 1520. The processor 1520 is connected to the memory 1510 through a bus 1530, and a database 1550 is used to save data.

[0307] The computing device 1500 also includes an access device 1540 that enables the computing device 1500 to communicate via one or more networks 1560. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of such networks, such as the Internet. The access device 1540 can include one or more of any type of network interface (for example, a network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, or the like.

[0308] In one embodiment of the present application, the above-described components of the computing device 1500, as well as Figure 15 other components not shown in FIG. 15, can be connected to each other through the bus. It should be appreciated that Figure 15 The computing device structure diagram shown is merely for the purpose of example, and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0309] The computing device 1500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, and the like), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smartwatch, smart glasses, and the like), or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 1500 can also be a mobile or stationary server.

[0310] The processor 1520 is configured to execute computer-executable instructions of the contract information extraction method.

[0311] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the contract information extraction method described above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the contract information extraction method.

[0312] An embodiment of the present application further provides a computer readable storage medium, which stores computer instructions, and the instructions are executed by a processor to be used for the contract information extraction method.

[0313] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the contract information extraction method described above belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the contract information extraction method.

[0314] An embodiment of the present application discloses a chip, which stores computer instructions, and the computer instructions are executed by a processor to realize the steps of the contract information extraction method as described above.

[0315] The specific embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0316] The computer instructions include computer program codes, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program codes, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.

[0317] It should be noted that, for the aforementioned method embodiments, the sequences of the described actions are not the only ones that can be performed to implement the present application. In some embodiments, the sequences of actions can be performed in different order or simultaneously. In some embodiments, other sequences of actions can be performed, which should be apparent to a person of ordinary skill in the art in light of the teachings of the present application.

[0318] In the above embodiments, the description of each embodiment focuses on different aspects, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0319] The preferred embodiments of the present application disclosed above are only used to illustrate the present application. The alternative embodiments do not describe all the details and limit the present application to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is limited by the claims and their full scope and equivalents.

Claims

1. A contract information extraction method characterized by comprising: The method comprises the following steps: obtaining a target contract text, and extracting a target paragraph in the target contract text, wherein the target paragraph contains contract party entity information; inputting the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains contract party identification, information category and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, the information set label includes a contract party identification label, an information category label and a contract party entity information label, the information set extraction model includes a contract party identification layer and a relation extraction layer, the contract party identification layer is used to obtain the contract party identification corresponding to the target paragraph based on the target paragraph, and the relation extraction layer is used to obtain the information category and the contract party entity information corresponding to the contract party identification based on the target paragraph and the contract party identification corresponding to the target paragraph; determining at least one target information set corresponding to a target contract party identification; determining contract information corresponding to the target contract party identification according to the information category and the contract party entity information in each target information set.

2. The method of claim 1, wherein, The method comprises the following steps: obtaining an initial contract text; in the case that the format of the initial contract text is a non-target format, converting the format of the initial contract text into a target format to obtain the target contract text.

3. The method of claim 1, wherein, The method comprises the following steps: extracting at least one initial paragraph in the target contract text, wherein the initial paragraph contains contract party entity information; determining the paragraph serial number of each initial paragraph in the target contract text; integrating a plurality of initial paragraphs with serial numbers connected to obtain a target paragraph; determining an initial paragraph without an adjacent paragraph serial number as a target paragraph.

4. The method of claim 3, wherein, The method comprises the following steps: using a pre-trained classification model to respectively judge whether each paragraph in the target contract text contains the contract party entity information, wherein the classification model is trained based on a sample text carrying a paragraph label, and the paragraph label is a paragraph containing contract party entity information in the sample text; if yes, the paragraph containing the contract party entity information is determined as an initial paragraph.

5. The method of claim 1, wherein, The method comprises the following steps: inputting the target paragraph into the contract party identification layer to obtain the contract party identification corresponding to the target paragraph; inputting the target paragraph and the contract party identification corresponding to the target paragraph into the relation extraction layer to obtain the information category and the contract party entity information corresponding to the contract party identification; determining at least one information set corresponding to the target paragraph according to the contract party identification and the information category and the contract party entity information corresponding to the contract party identification.

6. The method of claim 5, wherein, The contract party identification layer comprises a vector conversion unit and a matrix change unit. The method comprises the following steps: inputting the target paragraph into the vector conversion unit to obtain a vector corresponding to each character unit in the target paragraph; inputting the vector corresponding to each character unit into the matrix transformation unit to obtain a probability value of each character unit with respect to each contract party identifier; for any character unit in each character unit, determining the contract party identifier corresponding to the target probability value of the character unit as the contract party identifier corresponding to the character unit, wherein the target probability value is a probability value greater than a preset value.

7. The method of claim 5, wherein, Before the step of inputting the target paragraph into the pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, the method further includes: extracting a first sample paragraph, inputting the first sample paragraph into an identification layer of a first network model to obtain a predicted contract party identifier corresponding to the first sample paragraph; inputting the first sample paragraph and the predicted contract party identifier into an extraction layer of the first network model to obtain a predicted information category and a predicted contract party entity information corresponding to the predicted contract party identifier; determining a predicted information set corresponding to the first sample paragraph according to the predicted contract party identifier, the predicted information category, and the predicted contract party entity information; comparing the predicted information set with the information set label carried by the first sample paragraph to obtain a difference value; if the difference value is greater than a preset threshold, adjusting parameters of the identification layer and the extraction layer, and returning to execute the step of extracting a first sample paragraph until a training stop condition is reached, stopping training, and determining that the identification layer, the extraction layer, and the first network model completed training are a contract party identification layer, a relationship extraction layer, and an information set extraction model, respectively.

8. The method of claim 7, wherein, The step of comparing the predicted information set with the information set label carried by the first sample paragraph includes: comparing the predicted contract party identifier with the contract party identifier label to obtain a first difference value; comparing the predicted contract party identifier with the contract party identifier label, the predicted information category with the information category label, and the predicted contract party entity information with the contract party entity information label to obtain a second difference value; if the difference value is greater than a preset threshold, adjusting parameters of the identification layer and the extraction layer, and returning to execute the step of extracting a first sample paragraph until a training stop condition is reached, stopping training, and determining that the identification layer, the extraction layer, and the first network model completed training are a contract party identification layer, a relationship extraction layer, and an information set extraction model, respectively. The step of adjusting the parameters of the identification layer and the extraction layer includes: if the first difference value is greater than a first preset threshold in the preset threshold, adjusting the parameters of the identification layer; 9. The method of claim 4, wherein, if the second difference value is greater than a second preset threshold in the preset threshold, adjusting the parameters of the extraction layer. Before the step of determining whether each paragraph in the target contract text contains the contract party entity information by using the pre-trained classification model, the method further includes: extracting a sample text, inputting the sample text into a second network model to obtain a predicted paragraph in the sample text; determining a first loss value according to the predicted paragraph and the paragraph label carried by the sample text; if the first loss value is greater than a first preset loss value, adjusting the parameters of the second network model, and returning to execute the step of extracting a sample text until a training stop condition is reached, stopping training, and determining that the second network model completed training is a classification model.

10. The method according to any one of claims 1 to 9, characterized in that, The obtaining target contract text and extracting a target paragraph in the target contract text further include: inputting the target paragraph into a pre-trained contract basic information extraction model to obtain at least one contract entity and a corresponding entity type in the target paragraph, wherein the contract basic information extraction model is trained based on a second sample paragraph carrying an entity label and an entity type label; merging the at least one contract entity and the corresponding entity type and the target contract party identifier corresponding contract information into contract text information corresponding to the target contract text.

11. The contract information extraction method according to claim 10, characterized by, The inputting the target paragraph into a pre-trained contract basic information extraction model to obtain at least one contract entity and a corresponding entity type in the target paragraph further includes: extracting a second sample paragraph, inputting the second sample paragraph into a third network model to obtain a predicted contract entity and a corresponding predicted entity type in the second sample paragraph; determining a second loss value according to the predicted contract entity, the predicted entity type, and the entity label and the entity type label carried by the second sample paragraph; if the second loss value is greater than a second preset loss value, adjusting parameters of the third network model, and returning to execute the step of extracting a second sample paragraph until a training stop condition is reached, the training is stopped, and a third network model that is determined to be trained is a contract basic information extraction model.

12. A contract information extracting apparatus characterized by comprising: It includes: an extraction module configured to obtain a target contract text and extract a target paragraph in the target contract text, wherein the target paragraph contains contract party entity information; an input module configured to input the target paragraph into a pre-trained information set extraction model to obtain at least one information set corresponding to the target paragraph, wherein the information set contains contract party identifiers, information categories, and contract party entity information, the information set extraction model is trained based on a first sample paragraph carrying an information set label, the information set label includes a contract party identifier label, an information category label, and a contract party entity information label, the information set extraction model includes a contract party identification layer and a relationship extraction layer, the contract party identification layer is used to obtain a contract party identifier corresponding to the target paragraph based on the target paragraph, and the relationship extraction layer is used to obtain an information category and contract party entity information corresponding to the contract party identifier based on the target paragraph and the contract party identifier corresponding to the target paragraph; a first determination module configured to determine at least one target information set corresponding to a target contract party identifier; a second determination module configured to determine contract information corresponding to the target contract party identifier according to the information category and the contract party entity information in each target information set.

13. A computing device, comprising: It includes: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to realize the steps of the contract information extraction method in any one of claims 1 to 11.

14. A computer-readable storage medium storing computer instructions, wherein, The instructions are executed by the processor to realize the steps of the contract information extraction method in any one of claims 1 to 11.

15. A computer program product, characterised in that, Computer instructions which, when executed by a processor, implement the steps of the contract information extraction method of any one of claims 1 to 11.

Citation Information

Patent Citations

  • Information extraction method based on artificial intelligence, storage medium and related device

    CN111143536A