Contract text recognition method and device

By extracting the target text content in the contract text and combining it with type recognition and entity information extraction, it solves the problem of recognition errors based on deep learning models when training samples are limited, and achieves high efficiency and accuracy in contract text recognition.

CN114818718BActive Publication Date: 2024-09-17BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210582893.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2024-09-17
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

Contract text type recognition models based on deep learning are prone to recognition errors when training samples are limited, and are difficult to meet the needs for efficient and accurate recognition of long and multi-type contract texts.

Method used

By obtaining the contract text, extract the target text content that meets the preset conditions, perform type identification based on the characteristic information of the specified type, and extract entity information to determine the identification result of the contract text when the identification result is the specified type, reducing the amount of data processing and improving Recognition efficiency and accuracy.

Benefits of technology

It effectively reduces the data processing volume of type recognition, improves the efficiency and accuracy of contract text recognition, and improves the recognition accuracy of long and multi-type contract texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818718B
    Figure CN114818718B
Patent Text Reader

Abstract

The present application provides a contract text recognition method and device, wherein the contract text recognition method includes: extracting target text content that meets preset conditions in the contract text by acquiring the contract text, wherein the preset conditions are set based on characteristic information of a specified type; performing type recognition on the target text content to obtain the text type of the target text content; and extracting entity information in the target text content when the text type of the target text content is a specified type to determine the recognition result of the contract text. Through the above method, the data processing amount of type recognition can be greatly reduced, the efficiency of type recognition can be improved, and the accuracy of contract text recognition can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a contract text recognition method. The present application also relates to a contract text recognition device, a computing device, and a computer-readable storage medium. Background Art

[0002] Artificial Intelligence (AI) refers to the ability of engineered (i.e. designed and manufactured) systems to perceive the environment, as well as the ability to acquire, process, apply and represent knowledge. The development status of key technologies in the field of artificial intelligence, including machine learning, knowledge graphs, natural language processing, computer vision, human-computer interaction, biometrics, virtual reality / augmented reality and other key technologies.

[0003] With the continuous development of artificial intelligence technology, artificial intelligence technology has been deeply applied in the field of natural language processing, especially for contract texts. The introduction of artificial intelligence technology can realize the automatic identification of the type of contract text, which can greatly improve the efficiency of enterprises. In traditional artificial intelligence methods, the type of contract text can be obtained by directly inputting the contract text into a pre-trained type recognition model based on deep learning.

[0004] However, the length of contract texts is getting longer and longer, and the types of contracts are increasing. The deep learning-based type recognition model is limited by the training samples. When the training samples are limited, it is inevitable that there will be recognition errors. Therefore, it is necessary to provide a more efficient and accurate contract text recognition solution. Summary of the invention

[0005] In view of this, the embodiment of the present application provides a contract text recognition method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a contract text recognition device, a computing device, and a computer-readable storage medium.

[0006] According to a first aspect of an embodiment of the present application, a contract text recognition method is provided, comprising:

[0007] Acquire the contract text, and extract the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of the specified type;

[0008] Performing type recognition on the target text content to obtain the text type of the target text content;

[0009] When the text type is a specified type, entity information in the target text content is extracted to determine the recognition result of the contract text.

[0010] According to a second aspect of an embodiment of the present application, a contract text recognition device is provided, including:

[0011] A screening module is configured to obtain a contract text and extract target text content in the contract text that meets a preset condition, wherein the preset condition is set based on characteristic information of a specified type;

[0012] The recognition module is configured to perform type recognition on the target text content to obtain the text type of the target text content;

[0013] The extraction module is configured to extract entity information from the target text content when the text type is a specified type, and determine the recognition result of the contract text.

[0014] According to a third aspect of an embodiment of the present application, a computing device is provided, including:

[0015] Memory and processor;

[0016] The memory is used to store computer executable instructions, and when the processor executes the computer executable instructions, it implements the contract text recognition method provided in the first aspect of the embodiment of the present application.

[0017] According to the fourth aspect of the embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the contract text recognition method provided in the first aspect of the embodiment of the present application is implemented.

[0018] According to the fifth aspect of the embodiment of the present application, a chip is provided, which stores a computer program. When the computer program is executed by the chip, the contract text recognition method provided by the first aspect of the embodiment of the present application is implemented.

[0019] The contract text recognition method provided by the present application obtains the contract text, extracts the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of the specified type; performs type recognition on the target text content to obtain the text type of the target text content; and extracts the entity information in the target text content when the text type is the specified type, and determines the recognition result of the contract text. Through the above method, the target text content that meets the preset conditions is extracted from the contract text and the target text content is type recognized, which can greatly reduce the data processing amount of type recognition and improve the efficiency of type recognition. And when the text type of the target text content is the specified type, the entity information in the target text content is extracted to determine the recognition result of the contract text, and the target text content that meets the preset conditions in the contract text is extracted, combined with type recognition, the type of the contract text is preliminarily recognized, and then the entity information in the target text content of the specified type is extracted, and the recognition result of the contract text is determined in combination with the entity information, thereby improving the accuracy of contract text recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of the structure of a contract text recognition system provided according to an embodiment of the present application is shown;

[0021] Figure 2 A flowchart of a contract text recognition method provided according to an embodiment of the present application is shown;

[0022] Figure 3 A flowchart of extracting target text content in a contract text recognition method provided according to an embodiment of the present application is shown;

[0023] Figure 4 A flowchart of text classification model training in a contract text recognition method provided according to an embodiment of the present application is shown;

[0024] Figure 5 A flowchart of entity recognition model training in a contract text recognition method provided according to an embodiment of the present application is shown;

[0025] Figure 6 A flowchart of determining a recognition result of a contract text in a contract text recognition method provided according to an embodiment of the present application is shown;

[0026] Figure 7 A processing flow chart of a contract text recognition method applied to a receivables type contract provided in an embodiment of the present application is shown;

[0027] Figure 8 A schematic diagram of the structure of a contract text recognition device provided by an embodiment of the present application is shown;

[0028] Fig. 9 A structural block diagram of a computing device provided according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0030] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0031] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0032] First, the terms involved in one or more embodiments of the present invention are explained.

[0033] Information extraction: refers to the technology of extracting structured information from structured, semi-structured or unstructured text.

[0034] BERT (Bidirectional Encoder Representation from Transformers): an open source pre-trained language model.

[0035] Named Entity Recognition (NER): refers to the identification of entities with specific meanings in text, mainly including names of people, places, institutions, proper nouns, etc.

[0036] Text classification: refers to the classification of text into one or several categories in a given classification system.

[0037] Entity: refers to an entity word or phrase description with specific meaning in the text.

[0038] Account type: A text sentence that can reflect the role information of the payee and payee of the contract.

[0039] In the present application, a contract text recognition method is provided. The present application also relates to a contract text recognition device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0040] Figure 1 A structural diagram of a contract text recognition system provided according to an embodiment of the present application is shown.

[0041] Taking the execution subject as server 102 as an example, terminal 104 uploads the contract text, server 102 receives the contract text through communication unit 102-1, and acquisition unit 102-2 extracts the target text content that meets the preset conditions from the contract text, wherein the preset conditions are set based on the characteristic information of the specified type; then recognition unit 102-3 performs type recognition on the target text content to obtain the text type of the target text content; then, when the text type of the target text content is the specified type, entity information in the target text content is extracted through extraction unit 102-4 to determine the recognition result of the contract text. Afterwards, communication unit 102-1 can feed back the recognition result to terminal 104.

[0042] Figure 2 A flowchart of a contract text recognition method provided according to an embodiment of the present application is shown, which specifically includes steps 202 to 206, which will be described in detail below.

[0043] Step 202: Acquire the contract text, and extract the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of a specified type.

[0044] The executor of this application can be any electronic device with contract text recognition function, such as a smart phone, smart watch, desktop computer, laptop computer, server, etc.

[0045] In this embodiment, the contract text is first obtained, wherein the contract text refers to a written document used by the parties to record the contents of the contract. In practical applications, the contract text may be in a text format, a portable document format (PDF), a picture format, etc.

[0046] Accordingly, there are multiple ways to obtain the text content of contract texts in different formats. For example, when the contract text is in text format, the text content of the contract text is directly extracted by character recognition. For another example, when the contract text is in PDF format or image format, optical character recognition technology (OCR) can be used to parse the text content of the contract text. Specifically, for contract texts in PDF or image formats, OCR technology is used to identify text areas, and then the text areas are segmented into rectangles and split into different characters. The characters are then classified to identify the text content of the contract text.

[0047] After obtaining the contract text, it is necessary to extract the target text content that meets the preset conditions from the contract text, wherein the preset conditions are set based on the characteristic information of the specified type, and the specified type is a specific text type, which is set by the actual needs of contract text recognition. The text type refers to the text type of the text content in the contract text. The text type is generally determined by the characteristic information in the text content. The characteristic information represents the uniqueness of the specified type, which can be a word. In practical applications, the characteristic information can be the words in the text content that represent the role relationship between the two parties of the contract, such as "payment", "purchase", "borrowing", "rental", "transfer" and other words. Under the setting of the specified type as the account type, since the text content of the account type mainly expresses the transaction behavior relationship between the two parties of the contract, therefore, under the setting of the account type, the preset conditions are set based on the characteristic information of the transaction behavior relationship, such as "payment", "transfer" and other words that represent the transaction behavior relationship. For different contract text recognition needs, the preset conditions can be set according to the corresponding characteristic information representing the role relationship between the two parties of the contract, so as to meet the corresponding specified type setting.

[0048] As in the above example, the words that characterize the role relationship between the two parties in the text content of the contract text are generally behavioral relationship words. In this embodiment, a preset behavioral keyword library can be pre-established, and the preset behavioral keyword library includes multiple behavioral keywords under a specified type. The behavioral keywords are words that characterize the characteristics of the behavioral relationship. Then, based on the preset behavioral keyword library, the text content that matches the preset behavioral keyword library is extracted from the contract text as the target text content. Among them, the preset behavioral relationship word library can be in the form of a table, that is, each table unit records a behavioral keyword, or it can be in the form of a database, which is not specifically limited here.

[0049] Alternatively, multiple behavioral text contents of a specified type may be created in advance. The behavioral text contents characterize the behavioral characteristics and specifically describe the process of the behavior. They may be sentences manually edited based on experience. Then, the text contents in the contract text are matched with the pre-created behavioral text contents for semantic similarity, and the text contents in the contract text whose semantic similarity reaches a preset threshold are used as target text contents. Specifically, the semantic similarity matching may adopt a matching method based on the BERT model. The text contents and behavioral text contents in the contract text are respectively input into the pre-trained BERT model. The BERT model has a semantic recognition function. The BERT model will output the semantic information of each text content and the behavioral text content. Then, the semantic information of each text content and the semantic information of the behavioral text content are calculated for similarity. The speech information is generally in the form of a vector. Then, the specific similarity calculation method is to calculate the degree of overlap of the elements in the vector between the semantic information of each text content and the semantic information of the behavioral text content. The higher the degree of element overlap, the higher the similarity. In this way, the semantic similarity between each text content and the behavioral text content can be obtained.

[0050] In a possible implementation of the embodiment of the present application, the step of extracting the target text content that meets the preset conditions in the contract text can be specifically performed by Figure 3 way to achieve it. Figure 3 A flowchart of extracting target text content in a contract text recognition method provided in accordance with an embodiment of the present application is shown, which specifically includes the following steps:

[0051] Step 302: Divide the contract text to obtain the contents of each text in the contract text.

[0052] Step 304: For any text content, match the words in the text content with a preset behavior keyword library. If the matching result meets the preset matching condition, the text content is determined to be the target text content, wherein the preset behavior keyword library records behavior keywords under the specified type.

[0053] In this embodiment, after the contract text is obtained, the text content of the contract text must first be divided to obtain the text content of each part of the contract text.

[0054] There are many ways to divide the contract text, which can be divided based on punctuation marks or the number of words. Generally, a complete sentence can express the complete content of the contract. Therefore, it is generally divided based on the punctuation marks or characters that indicate the end of the complete sentence, such as a period, exclamation mark, line break, etc. That is, the two parts of the text content separated by the punctuation marks or characters that indicate the end of the complete sentence will be divided into different text contents. However, in some special cases, a complete sentence may contain multiple clauses, each of which may involve both parties to the contract. However, in some clauses, the two parties to the contract may not contain a behavioral relationship. For example, in a sentence "A and B go to the bank together, and A transfers 500,000 yuan to B through a bank account at the bank." It can be seen that the clause "A and B go to the bank together" does not contain a behavioral relationship. Therefore, in order to improve the accuracy and effectiveness of subsequent type recognition, in a preferred implementation, it can be divided according to punctuation marks or special characters. That is, when punctuation marks such as ",","!","!","?", etc. appear in the contract text, or when special characters such as line breaks appear in the contract text, the punctuation mark or special character is determined to be the end of the text content, and the text content is divided, that is, the two parts of the text content separated by punctuation marks or special characters will be divided into different text contents. For example, using the punctuation mark "," as a division method, "A and B go to the bank together, and A transfers 500,000 yuan to B through a bank account at the bank" can be divided into two clauses: "A and B go to the bank together" and "A transfers 500,000 yuan to B through a bank account at the bank." For example, using the punctuation mark "." as a dividing method, "A and B go to the bank together, and A transfers 500,000 yuan to B through his bank account" is divided into a clause "A and B go to the bank together, and A transfers 500,000 yuan to B through his bank account".

[0055] The text content of the contract text can also be divided using any neural network model such as the natural language processing model (NLP), the long short-term memory network model (LSTM), the convolutional neural network model (CNN), etc. Specifically, when using the neural network model for division, it is necessary to first obtain a large amount of sample text content as training samples, and then annotate the sample text content, that is, annotate the beginning and end of each sample text content, and then input the labeled sample text content into the neural network model for iterative training. After multiple iterations, when the loss value of the neural network model reaches the preset threshold, the training is completed. Then the contract text is input into the trained neural network model to achieve the division of the text content of the contract text.

[0056] After dividing the contract text and obtaining the various text contents in the contract text, any text content is segmented to obtain the various words in the text content. There are many methods for segmenting any text content, such as a segmentation method based on a neural network, a stuttering segmentation method, a segmentation method based on part of speech, etc. Among them, the segmentation method based on a neural network is to pre-train a neural network model using a preset dictionary library, and then input any text content into the trained neural network model for segmentation to obtain a segmentation result. It is also possible to pre-establish a keyword table, and then use the keyword matching method to segment any text content. The specific segmentation method used is not limited here, and any segmentation that can segment words that represent the role relationship between the two parties to the contract can be used.

[0057] After obtaining each word in any text content, each word is matched with a preset behavior keyword library. If the matching result meets the preset matching condition, the text content is determined to be the target text content, wherein the preset behavior keyword library records behavior keywords under the specified type.

[0058] Common contract texts usually contain text content of the type of accounts receivable. It is very uncommon to describe accounts receivable in one sentence, such as "Party A borrows RMB 5,000 from Party B." The content of the signed contract is very complicated. The first paragraph may describe the loan relationship between the two parties, and the specific amount will not be mentioned in the payment terms until many paragraphs later. There are even cases where the method of division is mentioned without mentioning the specific amount. These situations increase the difficulty of extracting and further interpreting the meaning of the contract.

[0059] In a possible implementation of the embodiment of the present application, the designated type may be an account type, and the preset behavior keyword library records the behavior keywords of the account type, for example, the behavior keywords of the account type may be keywords such as "borrowing", "paying", "lending", "repaying", and "repaying"; the words of a text content "Party A and Party B agree to lend Party B RMB 500 by bank transfer, and require Party B to repay within 10 working days." are "A", "lending", "B", "500", and "Yuan". The words of the text content are matched with the keywords in the preset behavior keyword library, and it is matched that the text content and the preset behavior keyword library both have "lending", which means that the match with the keywords in the keyword table is successful, and then the text content in the contract text "Party A and Party B agree to lend Party B RMB 500 by bank transfer, and require Party B to repay within 10 working days." is determined to be the target text content.

[0060] In another possible implementation of the embodiment of the present application, a matching threshold may be preset, and when the words in the text content successfully match the words in the preset behavior keyword library to reach the preset matching threshold, the text content is determined to be the target text content.

[0061] For example, the preset matching threshold is 2; the words in a text content "A lends B 500 yuan" are "A", "lend", "B", "500", "yuan" respectively; the behavior keywords of the account type can be keywords such as "borrow", "pay", "yuan". The words in the text content are matched with the keyword tables in the preset behavior keyword library, and it is matched that the text content and the preset behavior keyword library both have "lend" and "yuan", and the preset matching threshold is reached, then the text content "A lends B 500 yuan" in the contract text is determined as the target text content.

[0062] In another possible implementation of the embodiment of the present application, the preset matching condition may be that the proportion of words in the text content that match the preset behavior keyword library reaches a preset proportion threshold, that is, when the proportion of words in the text content that successfully match the preset behavior keyword library reaches a preset proportion threshold, the text content can be determined to be the target text content. The target text content is screened by using the proportion method, and the screening result is more accurate.

[0063] For example, the preset percentage threshold is 50%; the words in a text content "A lends B 500 yuan" are "A", "lend", "B", "500 yuan" respectively; the behavior keywords of the account type can be keywords such as "lend", "pay", "yuan". The words in the text content are matched with the keyword tables in the preset behavior keyword library, and it is matched that the text content and the preset behavior keyword library both have "lend" and "yuan", that is, the text content matches the preset behavior keyword library with two words, and the text content has a total of four words, then the proportion of the matched words is 50%, reaching the preset percentage threshold, and the text content "A lends B 500 yuan" in the contract text is determined as the target text content.

[0064] In the above implementation, the text content of the contract text is divided to obtain the various text contents in the contract text, and then for any text content, the words in the text content are matched with the preset behavior keyword library, and if the matching result meets the preset matching condition, the word is determined to be the target word. Through the above method, the target text content that meets the preset condition in the contract text can be screened out, which is used to identify the type of the target text content that meets the preset condition, greatly reducing the calculation amount of text classification and improving the efficiency of classifying the contract text.

[0065] Step 204: perform type identification on the target text content to obtain the text type of the target text content.

[0066] After extracting the target text content that meets the preset conditions from the contract text, it is necessary to perform type recognition on the target text content. By performing type recognition on the target text content, the text type of the target text content is obtained. The specific method of type recognition is not limited here. A type recognition scheme based on a neural network or a type recognition scheme based on a mapping table can be adopted. The following will introduce the type recognition scheme based on a neural network.

[0067] In a possible implementation of the embodiment of the present application, step 204 can be specifically implemented by the following steps:

[0068] The target text content is input into a text classification model to obtain a text type of the target text content, wherein the text classification model is pre-trained based on sample texts carrying type labels.

[0069] In this embodiment, the text classification model is used to classify the target text content, and the text classification model can be any neural network model such as NLP model, LSTM model, CNN model, etc. A type recognition scheme based on a neural network is adopted. Since the text classification model is pre-trained based on sample texts carrying type labels and is an end-to-end model, it has high text classification efficiency and accuracy.

[0070] In a possible implementation of the embodiment of the present application, before inputting the target text content into the text classification model to obtain the text type of the target text content, it is necessary to train the text classification model. The specific training method is as follows: Figure 4 As shown, Figure 4 A flowchart of text classification model training in a contract text recognition method provided in an embodiment of the present application is shown, which specifically includes the following steps:

[0071] Step 402: Obtain a first training set and a first sample text to be annotated, wherein the first training set includes a plurality of sample texts carrying type labels.

[0072] Step 404: Use the first training set to train the text classification model.

[0073] Step 406: Input the first sample text to be annotated into the trained text classification model to obtain a first prediction probability of whether the first sample text to be annotated is of a specified type.

[0074] Step 408: annotate the first sample text to be annotated based on the first prediction probability to obtain annotated first sample text.

[0075] Step 410: Add the annotated first sample text to the first training set to obtain an updated first training set, and continue to train the text classification model using the updated first training set.

[0076] The above method uses a weakly supervised approach to perform model training, which can update the training set of the text classification model, greatly expand the training set of the text classification model, and thereby effectively improve the accuracy of the text classification model.

[0077] In this embodiment, the first training set includes a plurality of sample texts with type labels, for example, the sample text "A lends B 500 yuan" carries the label "account type"; the sample text "B refuses to pay A 500 yuan" carries the label "non-account type", etc. The first sample text to be labeled refers to the sample text without type labels, for example, the first sample text to be labeled may be "A donates 500 yuan to B", "B collects 500 yuan from A", "B does not donate", etc. The first sample text to be labeled does not carry type labels.

[0078] In practical applications, the text classification model can be any neural network model such as an NLP model, an LSTM model, or a CNN model. After obtaining the first training set and the first sample text to be annotated, the text classification model is trained using the first training set. Specifically, multiple sample texts carrying type labels are input into the text classification model for iterative training. After multiple iterations, when the loss value of the text classification model reaches a preset threshold, a trained text classification model is obtained.

[0079] Then, the first sample text to be annotated is input into the trained text classification model to predict whether the first sample text to be annotated is of a specified type, thereby obtaining a first prediction probability of whether the first sample text to be annotated is of the specified type.

[0080] For example, the first sample text to be labeled "A donates 500 yuan to B" is input into the trained text classification model, and a prediction is made as to whether the first sample text to be labeled is of the account type, thereby obtaining a first prediction probability of whether the first sample text to be labeled is of the account type.

[0081] After obtaining the first prediction probability of whether the first sample text to be annotated is of the specified type, the type label of the first sample text to be annotated is determined based on the first prediction probability, and the first sample text to be annotated is annotated to obtain the annotated first sample text. Then, the annotated first sample text is added to the first training set to obtain an updated first training set, and the updated training set is used to continue training the text classification model.

[0082] For example, when the specified type is the account type, the first text to be annotated "A donated 500 yuan to B" is annotated as the account type to obtain the annotated first sample text, and then the annotated first sample text "A donated 500 yuan to B" with the account type label is added to the first training set to obtain an updated first training set, and the updated first training set is used to continue training the text classification model.

[0083] In the above method, the text classification model is trained by the first training set, and then the first sample text to be annotated is input into the trained text classification model to obtain the first prediction probability of whether the first sample text to be annotated is of the specified type, and then the first sample text to be annotated is annotated based on the first prediction probability to obtain the annotated first sample text, and finally the annotated first sample text is added to the first training set to obtain the updated first training set, and the text classification model is continued to be trained using the updated first training set. Through the above method, the training set of the text classification model can be updated, which greatly expands the training set of the text classification model, thereby effectively improving the accuracy of the text classification model. At the same time, based on the first prediction probability, the first sample text to be annotated is annotated, which reduces the workload of manual annotation of the sample text and improves the efficiency of text classification of the target text content.

[0084] In a possible implementation of the embodiment of the present application, the first sample text to be annotated is annotated based on the first prediction probability, which can be specifically implemented in the following manner:

[0085] When the first prediction probability reaches a first preset threshold, marking the first sample text to be marked as a first sample text of a specified type;

[0086] When the first prediction probability does not reach the first preset threshold, the first sample text to be annotated is annotated as a first sample text of a non-specified type.

[0087] In this embodiment, it is first necessary to input the first sample text to be annotated into the trained text classification model to obtain a first prediction probability of whether the first sample text to be annotated is of a specified type, and then compare the first prediction probability of whether it is of the specified type with a first preset threshold. When the first prediction probability reaches the first preset threshold, the first sample text to be annotated is annotated as the first sample text of the specified type; when the first prediction probability does not reach the first preset threshold, the first sample text to be annotated is annotated as the first sample text of a non-specified type.

[0088] For example, when the designated type is the account type and the first preset threshold is 80%, the first sample text to be labeled "A donates 500 yuan to B" is input into the trained text classification model, and the first predicted probability that the first sample text to be labeled "A donates 500 yuan to B" is the account type is 90%. Then the first sample text to be labeled "A donates 500 yuan to B" is labeled as the first sample text of the account type, that is, the first sample text after labeling.

[0089] For another example, the first sample text to be labeled "Yiwei Donation" is input into the trained text classification model, and the first prediction probability that the first sample text to be labeled "Yiwei Donation" is an account type is 30%. Then the first sample text to be labeled "Yiwei Donation" is labeled as the first sample text of the non-account type, that is, the first sample text after labeling.

[0090] In the above implementation, when the first prediction probability reaches the first preset threshold, the first sample text to be annotated is annotated as the first sample text of the specified type; when the first prediction probability does not reach the first preset threshold, the first sample text to be annotated is annotated as the first sample text of the non-specified type. Through the above method, the first sample text to be annotated can be accurately annotated, thereby expanding the training set of the text classification model and improving the accuracy of the text classification model.

[0091] Step 206: When the text type of the target text content is a specified type, extract entity information from the target text content to determine the recognition result of the contract text.

[0092] If the type of the target text content is identified as a specified type, entity information can be further extracted from the target text content. The entity information includes entity words with specific meanings in the target text content (such as specific parties to the contract text) and entity tags for the words, wherein the entity tags can characterize the role, attributes, etc. of the entity words. Therefore, based on the extracted entity information, the recognition result of the contract text can be determined more accurately. The specific method of entity extraction is not limited here. A neural network-based entity extraction scheme can be used, or a mapping table-based entity extraction scheme can be used. Below, the neural network-based entity extraction scheme will be introduced.

[0093] In a possible implementation of the embodiment of the present application, step 206 can be specifically implemented by the following steps:

[0094] The target text content is input into an entity recognition model to extract entity information in the target text content, wherein the entity recognition model is pre-trained based on sample texts of a specified type that carry entity label information.

[0095] The entity recognition model is used to extract entity information in the target text content of the specified type. In the present embodiment, the target text content is first input into the text classification model to identify whether the target text content is of the specified type. When the target text content is of the specified type, the target text content is input into the entity recognition model to extract the entity information in the target text content. A neural network-based entity recognition scheme is adopted. Since the entity recognition model is pre-trained based on sample texts of the specified type that carry entity tag information, and is an end-to-end model, it has high entity recognition efficiency and accuracy. Among them, the entity recognition model can adopt the model structure of LSTM plus conditional random fields (CRF, Conditional Random Fields), the model structure of BiLSTM plus CRF, and the model structure of BERT plus CRF, which is not specifically limited here.

[0096] For example, when the specified type is the account type, the target text content of the account type "A lends B 500 yuan" is input into the entity recognition model, and the entity information of the target text content "A lends B 500 yuan" is extracted as "A: payer; B: payee". Among them, "payer" is the entity label of the entity word "A", and "payee" is the entity label of the entity word "B".

[0097] In a possible implementation of the embodiment of the present application, before inputting the target text content into the entity recognition model and extracting the entity information in the target text content, the entity recognition model needs to be trained. The specific training method is as follows: Figure 5 As shown, Figure 5 A flowchart of entity recognition model training in a contract text recognition method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0098] Step 502: Obtain a second training set and a second sample text to be annotated, wherein the second training set includes a plurality of sample texts that carry entity label information and belong to a specified type.

[0099] Step 504: Use the second training set to train the entity recognition model.

[0100] Step 506: Input the second sample text to be annotated into the trained entity recognition model to obtain each entity word in the second sample text to be annotated, and a second predicted probability of the entity label information corresponding to each entity word.

[0101] Step 508: Based on the second prediction probability, label each entity word of the second sample text to be labeled to obtain a labeled second sample text.

[0102] Step 510: Add the labeled second sample text to the second training set to obtain an updated second training set, and continue to train the entity recognition model using the updated second training set.

[0103] Using the weakly supervised method for model training can update the training set of the entity recognition model, greatly expanding the training set of the entity recognition model, and thus effectively improving the accuracy of the entity recognition model.

[0104] In this embodiment, the second training set includes multiple sample texts of a specified type that carry entity label information. Taking the specified type as the account type as an example, the sample text "A lent 500 yuan to B" belongs to the account type and carries entity label information (that is, label the entity A with the payer label and the entity B with the payee label); the sample text "B paid 500 yuan to A" belongs to the account type and carries entity label information (that is, label the entity A with the payee label and the entity B with the payer label).

[0105] In practical applications, the entity recognition model can be any neural network model such as an NLP model, an LSTM model, or a CNN model. After obtaining the second training set and the second sample text to be labeled, the entity recognition model is trained using the second training set. Specifically, multiple sample texts of a specified type that carry entity label information are input into the entity recognition model for iterative training. After multiple iterations, when the loss value of the entity recognition model reaches a preset threshold, the trained entity recognition model is obtained.

[0106] Then, input the second sample text to be labeled into the trained entity recognition model to obtain each entity word in the second sample text to be labeled and the second prediction probability of the entity label information corresponding to each entity word. Based on the second prediction probability, label each entity word in the second sample text to be labeled to obtain the labeled second sample text. Then add the labeled second sample text to the second training set to obtain an updated second training set, and continue to train the entity recognition model using the updated training set.

[0107] For example, when the specified type is the account type, input the second sample text to be labeled "A donated 500 yuan to B" into the trained entity recognition model to obtain the second prediction probability of each entity word and the corresponding entity label information in "A donated 500 yuan to B", and label the entity word "A" as the payee and the entity word "B" as the payer based on the second prediction probability. Then add the labeled second sample text to the second training set to obtain an updated second training set, and continue to train the entity recognition model using the updated second training set.

[0108] Through the above method, the training set of the entity recognition model can be updated, which greatly expands the training set of the entity recognition model, thereby effectively improving the accuracy of the entity recognition model. At the same time, based on the second prediction probability, the second sample text to be annotated is annotated, which reduces the workload of manual annotation of the sample text and improves the efficiency of entity contract text recognition of the target text content.

[0109] In a possible implementation of the embodiment of the present application, labeling the second sample text to be labeled based on the second prediction probability includes:

[0110] When the second prediction probability reaches the second preset threshold, the entity label information is determined to be the target entity label information, and the entity words corresponding to the target entity label information are marked.

[0111] In this embodiment, the second sample text to be annotated needs to be input into the trained entity recognition model first, and the second predicted probability of each entity word in the second sample text to be annotated and the entity label information corresponding to each entity word is obtained. Then the second predicted probability is compared with the second preset threshold, and then based on the comparison result, each entity word of the second sample text to be annotated is annotated to obtain the annotated second sample text.

[0112] For example, when the specified type is the account type and the second preset threshold is 80%, the second sample text to be labeled "A donates 500 yuan to B" is input into the trained entity recognition model, and the entity words in the second sample text to be labeled are "A" and "B", and the second prediction probabilities corresponding to the entity word "A" are: 10% for the payee and 90% for the payer; the second prediction probabilities corresponding to the entity word "B" are: 90% for the payee and 10% for the payer. In the second prediction probability of the entity label information corresponding to the entity word "A", the second prediction probability of the label "payer" reaches the second preset threshold; in the second prediction probability of the entity label information corresponding to the entity word "B", the second prediction probability of the label "payee" reaches the second preset threshold. Based on the above second prediction probabilities, the entity word "A" in the second sample text to be labeled "A donates 500 yuan to B" is labeled as the payer, and the entity word "B" is labeled as the payee.

[0113] In the above implementation, when the second predicted probability of the entity tag information reaches the second preset threshold, the entity tag information is determined to be the target entity tag information, and the entity words corresponding to the target entity tag information are annotated. Through the above method, the second sample text to be annotated can be accurately annotated, thereby expanding the training set of the entity recognition model, thereby effectively improving the accuracy of the entity recognition model.

[0114] In a possible implementation of the embodiment of the present application, there are multiple target text contents of the specified type, that is, it can be identified in the contract text that the type of multiple target text contents is the specified type. Accordingly, the step of determining the recognition result of the contract text can be specifically performed by Figure 6 way to achieve it. Figure 6 A flowchart of determining a recognition result of a contract text in a contract text recognition method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0115] Step 602, performing information fusion processing on entity information in multiple pieces of target text content of a specified type to obtain an entity fusion result.

[0116] Step 604: calibrate each entity information using the entity fusion result to obtain the calibrated entity information.

[0117] Step 606, integrating the text type of the target text content and the corrected entity information to obtain the recognition result of the contract text.

[0118] In this embodiment, when there are multiple target text contents of the specified type, entity information can be extracted for each target text content of the specified type, and then the entity information in the multiple target text contents of the specified type is subjected to information fusion processing to obtain entity fusion results. Among them, information fusion processing refers to the process of analyzing multiple entity information, analyzing the unified law or rules of multiple entity information, and fusing multiple entity information into one entity information based on the analysis results. Further, the entity fusion results can be used to correct each entity information, so as to obtain the corrected entity information, and the text type of the target text content and the corrected entity information can be integrated to obtain the recognition result of the contract text to obtain the entity extraction result of the contract text. Among them, the entity extraction result of the contract text includes the text type of the target text content and the corrected entity information. Correcting each entity information means that the entity information that does not conform to the unified law or rule is processed accordingly based on the entity fusion result, which can be operations such as deletion and modification, so that all entity information can conform to the unified law or rule. Through the above method, the accuracy of extracting entity information of the contract text can be effectively improved.

[0119] In a possible implementation of the embodiment of the present application, the step of extracting entity information from the target text content can be specifically implemented in the following manner: selecting a preset number of target text contents of a specified type, and sequentially extracting entity information from the preset number of target text contents of a specified type. Accordingly, the above step 602 can be specifically implemented in the following manner: performing information fusion processing on the entity information in the preset number of target text contents of a specified type to obtain an entity fusion result.

[0120] There are multiple target text contents of a specified type. In order to further improve the processing efficiency, a preset number of target text contents can be selected from these target text contents for entity information extraction. In a specific implementation, the target text contents can be identified in turn. When a preset number (e.g., 2) of target text contents of a specified type are identified, the types of other target text contents are stopped. Of course, all target text contents can also be identified. After the text types of all target text contents are obtained, a preset number of target text contents of a specified type are selected. Then, the entity information in the preset number of target text contents of a specified type is fused to obtain an entity fusion result.

[0121] In a possible implementation of the embodiment of the present application, the entity information includes entity words in the target text content of the specified type, wherein the entity words in the target text content of the specified type carry corresponding entity tags. Accordingly, the above step 602 can be specifically implemented in the following manner: counting entity words with the same entity tag in multiple target text contents of the specified type; and obtaining entity fusion results based on the statistical results.

[0122] In this embodiment, the entity information includes entity words in the target text content of the specified type, and the entity words carry corresponding entity tags. After obtaining entity information in multiple target text contents of the specified type, it is necessary to count the entity words with the same entity tags in the multiple target text contents of the specified type according to the entity words in the entity information and the corresponding entity tags, and then obtain the entity fusion result according to the statistical results.

[0123] For example, for the target text content "A lends B 500 yuan", "B pays A 200 yuan", and "A donates 500 yuan to B", the entity information is as follows: In the entity information of the target text content "A lends B 500 yuan", the entity words are "A" and "B", among which the entity word "A" carries the entity tag "payee"; the entity word "B" carries the entity tag "payee". In the entity information of the target text content "B pays A 200 yuan", the entity words are "A" and "B", among which the entity word "A" carries the entity tag "payee"; the entity word "B" carries the entity tag "payee". In the entity information of the target text content "A donates 500 yuan to B", the entity words are "A" and "B", among which the entity word "A" carries the entity tag "payee"; the entity word "B" carries the entity tag "payee".

[0124] Statistically analyze the entity words with the same entity tags in the above target text content, and the statistical results are as follows: The number of times the entity word "A" carries the entity tag "payee" is 1, and the number of times it carries the entity tag "payer" is 2; The number of times the entity word "B" carries the entity tag "payee" is 2, and the number of times it carries the entity tag "payer" is 1. According to this statistical result, the entity fusion result can be obtained as "A: payer; B: payee".

[0125] In the above embodiment, statistically analyze the entity words with the same entity tags in the target text content of multiple specified types, and obtain the entity fusion result based on the statistical result. Through the above method, the accuracy of extracting entity information from contract texts can be effectively improved.

[0126] In a possible implementation manner of the embodiment of the present application, step 604 can be specifically implemented as follows: Match the entity fusion result with each entity information; Determine the entity information with a successful match as the corrected entity information, and delete the entity information with a failed match.

[0127] In this embodiment, the entity fusion result of the contract text includes the target entity word and the entity tag corresponding to the target entity word. The target entity word and the entity tag corresponding to the target entity word are obtained by statistically analyzing the entity words with the same entity tags in each specified type of target word. Matching the entity fusion result with each entity information means matching the above target entity word and the entity tag corresponding to the target entity word with the entity word and the corresponding entity tag of each entity information to obtain a matching result. Correspondingly, determine the entity information with a successful match as the corrected entity information, and delete the entity information with a failed match.

[0128] For example, the entity information of each specified type of target text content is specifically as follows: In the entity information of the target text content "A lends 500 yuan to B", the entity words are "A" and "B", where the entity word "A" carries the entity tag "payer"; The entity word "B" carries the entity tag "payee". In the entity information of the target text content "B pays 200 yuan to A", the entity words are "A" and "B", where the entity word "A" carries the entity tag "payee"; The entity word "B" carries the entity tag "payer". In the entity information of the target text content "A donates 500 yuan to B", the entity words are "A" and "B", where the entity word "A" carries the entity tag "payer"; The entity word "B" carries the entity tag "payee".

[0129] The entity words with the same entity label in the above target text content are counted, and based on the statistical results, the entity fusion result "A is the payer, B is the payee" is obtained, that is, in the entity extraction result of the contract text, the target entity words are "A" and "B", among which the entity label corresponding to the target entity word "A" is "payer"; the entity label corresponding to "B" is "payee".

[0130] The target entity words and the entity tags corresponding to the target entity words are matched with the entity words and the entity tags corresponding to the entity words of each entity information, and the matching results are: the target text content "A lends B 500 yuan" and "A donates 500 yuan to B" are matched successfully; the target text content "B pays A 200 yuan" fails to match. Finally, according to the matching results, the corrected entity information is determined as: "A is the payer and B is the payee".

[0131] In the above implementation, the entity fusion result is matched with each entity information, and according to the matching result, the entity information that is successfully matched is determined as the corrected entity information, and the entity information that fails to match is deleted. Through the above method, the entity information that does not match the entity fusion result can be deleted from each entity information, thereby improving the accuracy of the entity recognition model in extracting entity information.

[0132] The contract text recognition method provided by the present application obtains the contract text, extracts the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of the specified type; performs type recognition on the target text content to obtain the text type of the target text content; and extracts the entity information in the target text content when the text type of the target text content is the specified type, and determines the recognition result of the contract text. Through the above method, the target text content that meets the preset conditions is extracted from the contract text and the target text content is type recognized, which can greatly reduce the data processing amount of type recognition and improve the efficiency of type recognition. And when the text type of the target text content is the specified type, the entity information in the target text content is extracted to determine the recognition result of the contract text, and the target text content that meets the preset conditions in the contract text is extracted, combined with type recognition, the type of the contract text is preliminarily recognized, and then the entity information in the target text content of the specified type is extracted, and the recognition result of the contract text is determined in combination with the entity information, thereby improving the accuracy of contract text recognition.

[0133] The following combination Figure 7Taking the contract text recognition method provided in this application as an example of entity extraction in a receivables contract, the purpose of contract text recognition is to identify the roles played by the parties in the payment transaction or the relationship between them from the contract, and to determine which parties are borrowers (payees, debtors) and which parties are lenders (payees, creditors) in the meaning expressed by the entire contract. The contract text recognition method is further explained. Among them, Figure 7 A processing flow chart of a contract text recognition method applied to a receivables type contract provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0134] Step 702: Enter the contract text.

[0135] Input a text description extracted from a contract text. The text description contains a large number of sentences and paragraphs. Some of these sentences are expressions with loan relationships, and some sentences are expressions without loan relationships. For example, a contract contains the sentence "Party A and Party B unanimously agree to lend Party B RMB 500 through bank transfer, and require Party B to repay within 10 working days." In this sentence, "Party A and Party B unanimously agree" is a sentence without a loan relationship, and "require Party B to repay within 10 working days" is a sentence without a loan relationship. "Lend Party B RMB 500 through bank transfer" is a sentence with a loan relationship. Therefore, for the sentence "Party A and Party B unanimously agree to lend Party B RMB 500 through bank transfer, and require Party B to repay within 10 working days", use punctuation ", " as the division method to divide the clauses, and get three clauses: "Party A and Party B unanimously agree", "Lend Party B RMB 500 through bank transfer", and "require Party B to repay within 10 working days".

[0136] Step 704: Filter the payment behavior keyword table.

[0137] The text sentences are filtered through the payment behavior keyword table to reduce the amount of text data to be processed by the model for prediction. The payment behavior keyword table can be obtained through manual annotation, such as payment behavior action words such as "pay" and "lend". In the contract text recognition scenario of the account type, payment behavior is the main behavioral feature of the account type. Therefore, the payment behavior keyword table is used to filter the contract text to filter out the target text content that matches the payment behavior keyword table, where the payment behavior keyword table records the relevant words that characterize the payment behavior, such as "collection", "borrowing", "payment", "lend", etc. For example, based on the above example, "Party A and Party B unanimously agree" and "require Party B to repay within 10 working days" are filtered out, and "lend Party B RMB 500 by bank transfer" is filtered out as the target text content.

[0138] Step 706: Text classification and recognition.

[0139] In this embodiment, a text classification model is used to perform text classification and recognition on target text content. The text classification model can be trained based on sample data using a weakly supervised iterative training method.

[0140] Training a text recognition model to judge in parallel whether the input contract text belongs to the account type is a typical binary classification task. Parallel refers to processing a batch at a time or recognizing multiple text sentences at a time, which can improve the processing and recognition efficiency; parallel refers to the parallel processing of the model, or batch reasoning prediction. After annotating a certain amount of account type text sentences, the training data is trained to train the text classification and recognition model, and then predict the unlabeled sample data and select the sample data with a prediction score higher than a certain threshold to pseudo-label (that is, the label predicted by the model is assigned to the sample data), expand the training data and perform iterative model training (weakly supervised training process, that is, only a small amount of training data needs to be annotated at the beginning, and then the model is used to pseudo-label the unlabeled sample data and iteratively train). Reduce the cost of manual labeling of sample data (the acquisition and training process of entity recognition model training data are basically the same).

[0141] Specifically, each target text content can be input into the text classification model in parallel to determine whether each target text content belongs to the account type. The text classification model is a typical binary classification task. After a certain amount of account type text content is labeled, the training data is trained to train the text classification model, and then the unlabeled sample data is predicted and the sample data with a prediction score higher than a certain threshold is selected and pseudo-labeled (that is, the label predicted by the model is assigned to the sample data), the training data is expanded and the model is iterated. This can reduce the manual labeling cost of the sample data.

[0142] Step 708: Determine whether the contract text contains the target text content of the account type. If it does, execute steps 710 to 714; otherwise, execute step 716.

[0143] For contracts that are identified as having no account type text, the account type and payee and payee extraction results are directly output as empty. This technical solution can help humans determine that there is no loan relationship in the contract.

[0144] Step 710: Obtain target text contents of a preset number of account types.

[0145] Set the preset number to N. The preset number is assumed to be 10. Using the above example, obtain 1 target text content "lend 500 yuan to Party B by bank transfer", which does not exceed the limit of 10. If it exceeds the preset number, only 10 items will be taken and the recognition will be stopped afterwards. Usually, the first page of the contract will first indicate the main meaning of the entire contract, with Party A's contact information, Party B's contact information, and the "Wherein" clause to introduce what the parties are going to agree on in this contract. After that, the payment clause will state the specific amount of consideration paid by one party to the other party. According to this feature of the contract setting, in a specific embodiment, the paragraph after the word "Wherein", and the content in the paragraph after the digital title + "payment" and before the next digital title are calculated through steps 704 to 710 to obtain the first 10 target text contents.

[0146] Step 712: Entity recognition extraction.

[0147] For the identified account type text, after extracting N contract text descriptions (N is a preset value), obtain N contract text descriptions from all account type texts for prediction processing, and send them to the entity recognition model to extract the payee and payee roles. Where N is a preset number of items. In this embodiment, the entity recognition model is used to extract entities from the target text content. The entity recognition model can be trained based on sample data using a weakly supervised iterative training method. The specific training process is similar to the training method of the text classification model. For example, in the above example, from "lend 500 yuan to Party B through bank transfer", since Party B appears after the word "lend", "Party B" is extracted as the payee role, and "Party A" is not extracted from this sentence, nor is the "payee role" extracted.

[0148] Step 714: Voting integration.

[0149] For the extracted multiple entity information, this embodiment adopts the voting fusion method to vote and fuse the extraction results of N contract text descriptions, and output the contract payee and payee identification extraction results, so as to more effectively ensure the accuracy of extraction and identification. For example, from the N text contents, a total of 8 "Party A" is identified as the payee entity, and a total of 3 "Party B" is the payee entity, that is, the vote is selected among which the prediction results are more, and the payee is "Party A". The voting fusion result will improve the overall accuracy. In addition, due to the influence of the text content, especially the negative sample text content, the model prediction may have some influence or wrong results, and the voting fusion effect is better. The data acquisition and model training process also adopts the weak supervision training process. Only two entity information of the payee role and the payee role are extracted here, and there is no other type of entity, such as "Party A pays Party B 500 yuan", Party A is the payer, Party B is the payee, and there is no detailed information or other.

[0150] After obtaining the entity information of the payee and payee through voting fusion, the extracted account type text can be post-processed and filtered in combination with the payment behavior keywords and / or the entity information of the payee and payee to remove text sentences that may contain erroneous information (for example, the entity information of the payee and payee does not conform to the entity information obtained by voting fusion) or are incorrectly identified in step 706 (text sentences that do not contain the entity information of the payee and payee or the payment behavior keywords but are identified as text of the account type). After post-processing and filtering, the erroneous text sentences identified by the text classification recognition are screened out, and then step 718 is executed, thereby improving the accuracy of the type extraction result output.

[0151] Step 716: The result is empty.

[0152] When a contract text without account type text content is identified, the account type and payee and payee extraction results are directly output as empty.

[0153] Step 718: Output type extraction results.

[0154] The final output is the extracted contract account type and payee and payee entity information. For example, in the above example, the output content is: Account type: Yes; Payee - Party B; Payee - Party A.

[0155] For the contract text that is identified as having no account type text content, the output extraction result is: Account type: None; Payee - Empty; Payee - Empty.

[0156] For the identified account type text content, when there are multiple signatories, the output extraction result can be: Account type: Yes; Payee - Party B, Party C; Payee - Party A, Party D.

[0157] As shown in the above steps, if the contract text contains the target text content of the account type, a voting fusion method is used for the extracted multiple entity information, and the output type extraction result is the contract payee and payee identification extraction result; if the contract text does not contain the target text content of the account type, the directly output type extraction result is empty.

[0158] By using the above method, the target text content matching the payment behavior keyword table is extracted from the contract text and the target text content is identified as a type, which can greatly reduce the data processing volume of type identification and improve the efficiency of account type identification. In addition, when it is determined that the contract text contains the target text content of the account type, the entity information in the target text content is extracted, and the account type extraction result is output by voting fusion, which improves the accuracy of contract text identification of the account type.

[0159] Corresponding to the above method embodiment, the present application also provides a contract text recognition device embodiment, Figure 8 FIG. 1 is a schematic diagram showing the structure of a contract text recognition device provided by an embodiment of the present application. Figure 8 As shown, the device comprises:

[0160] The screening module 802 is configured to obtain the contract text and extract the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of a specified type;

[0161] The identification module 804 is configured to perform type identification on the target text content to obtain the text type of the target text content;

[0162] The extraction module 806 is configured to extract entity information from the target text content when the text type of the target text content is a specified type, and determine the recognition result of the contract text.

[0163] Optionally, the screening module 802 is further configured to divide the contract text to obtain various text contents in the contract text; for any text content, the words in the text content are matched with a preset behavior keyword library, and if the matching result meets the preset matching conditions, the text content is determined to be the target text content, wherein the preset behavior keyword library records behavior keywords under the specified type.

[0164] Optionally, the preset matching condition is that the proportion of words in the text content that match the preset behavior keyword library reaches a preset proportion threshold.

[0165] Optionally, there are multiple target text contents of the specified type;

[0166] The extraction module 806 is further configured to perform information fusion processing on entity information in multiple target text contents of specified types to obtain entity fusion results; use the entity fusion results to correct each entity information to obtain corrected entity information; integrate the text type of the target text content and the corrected entity information to obtain the recognition result of the contract text.

[0167] Optionally, the extraction module 806 is further configured to select a preset number of target text contents of a specified type, and extract entity information from the preset number of target text contents of the specified type in sequence; perform information fusion processing on the entity information in the preset number of target text contents of the specified type to obtain an entity fusion result.

[0168] Optionally, the entity information includes entity words in the target text content of a specified type, wherein the entity words in the target text content of the specified type carry corresponding entity tags;

[0169] The extraction module 806 is further configured to count entity words with the same entity tag in multiple target text contents of a specified type; and obtain entity fusion results based on the statistical results.

[0170] Optionally, the extraction module 806 is further configured to match the entity fusion result with each entity information; determine the successfully matched entity information as the corrected entity information, and delete the failed matched entity information.

[0171] Optionally, the recognition module 804 is further configured to input the target text content into a text classification model to obtain the text type of the target text content, wherein the text classification model is pre-trained based on sample texts carrying type labels.

[0172] Optionally, the device further comprises a first training module;

[0173] The first training module is configured to obtain a first training set and a first sample text to be annotated, wherein the first training set includes multiple sample texts carrying type labels; use the first training set to train the text classification model; input the first sample text to be annotated into the trained text classification model to obtain a first prediction probability of whether the first sample text to be annotated is of a specified type; based on the first prediction probability, annotate the first sample text to be annotated to obtain an annotated first sample text; add the annotated first sample text to the first training set to obtain an updated first training set, and continue to train the text classification model using the updated first training set.

[0174] Optionally, the first training module is further configured to annotate the first sample text to be annotated as a first sample text of a specified type when the first prediction probability reaches a first preset threshold; and to annotate the first sample text to be annotated as a first sample text of a non-specified type when the first prediction probability does not reach the first preset threshold.

[0175] Optionally, the extraction module 806 is further configured to input the target text content into an entity recognition model to extract entity information in the target text content, wherein the entity recognition model is pre-trained based on sample texts of a specified type that carry entity label information.

[0176] Optionally, the device further comprises a second training module;

[0177] The second training module is configured to obtain a second training set and a second sample text to be annotated, wherein the second training set includes multiple sample texts that carry entity label information and belong to a specified type; use the second training set to train the entity recognition model; input the second sample text to be annotated into the trained entity recognition model to obtain each entity word in the second sample text to be annotated, and a second predicted probability of the entity label information corresponding to each entity word; based on the second predicted probability, annotate each entity word in the second sample text to be annotated to obtain an annotated second sample text; add the annotated second sample text to the second training set to obtain an updated second training set, and continue to train the entity recognition model using the updated second training set.

[0178] Optionally, the second training module is further configured to determine that the entity label information is the target entity label information when the second prediction probability reaches a second preset threshold, and to label the entity words corresponding to the target entity label information.

[0179] The contract text recognition device provided by the present application obtains the contract text, extracts the target text content in the contract text that meets the preset conditions, wherein the preset conditions are set based on the characteristic information of the specified type; performs type recognition on the target text content to obtain the text type of the target text content; and extracts the entity information in the target text content when the text type of the target text content is the specified type, and determines the recognition result of the contract text. Through the above method, the target text content that meets the preset conditions is extracted from the contract text and the type recognition is performed on the target text content, which can greatly reduce the data processing amount of type recognition and improve the efficiency of type recognition. And when the text type of the target text content is the specified type, the entity information in the target text content is extracted to determine the recognition result of the contract text, and the target text content that meets the preset conditions in the contract text is extracted, combined with the type recognition, the type of the contract text is preliminarily recognized, and then the entity information in the target text content of the specified type is extracted, and the recognition result of the contract text is determined in combination with the entity information, thereby improving the accuracy of contract text recognition.

[0180] The above is a schematic scheme of a contract text recognition device of the present embodiment. It should be noted that the technical scheme of the contract text recognition device and the technical scheme of the above-mentioned contract text recognition method belong to the same concept. For the details not described in detail in the technical scheme of the contract text recognition device, please refer to the description of the technical scheme of the above-mentioned contract text recognition method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.

[0181] Fig. 9 The block diagram of a computing device according to an embodiment of the present application is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and the database 950 is used to store data.

[0182] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection 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, and the like.

[0183] In one embodiment of the present application, the above components of the computing device 900 and Fig. 9Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0184] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 900 may also be a mobile or stationary server.

[0185] Among them, the processor 920 is used to execute the computer executable instructions of the contract text recognition method.

[0186] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned contract text recognition method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned contract text recognition method.

[0187] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions, which are used in a contract text recognition method when executed by a processor.

[0188] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned contract text recognition method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned contract text recognition method.

[0189] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the contract text recognition method when executed by the chip.

[0190] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

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

[0192] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0193] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0194] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically 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 understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A contract text recognition method, It is characterized in that include: Acquire a contract text, and extract target text content in the contract text that meets a preset condition, wherein the preset condition is set based on characteristic information of a specified type; Performing type identification on the target text content to obtain the text type of the target text content; In the case where the text type is the designated type, entity information in the target text content is extracted to determine a recognition result of the contract text.

2. The method according to claim 1, It is characterized in that The step of extracting target text content that meets preset conditions from the contract text includes: Dividing the contract text to obtain the content of each text in the contract text; For any text content, the words in the text content are matched with a preset behavior keyword library. If the matching result meets the preset matching condition, the text content is determined to be the target text content, wherein the preset behavior keyword library records behavior keywords under the specified type.

3. The method according to claim 2, It is characterized in that The preset matching condition is that the proportion of words in the text content that match the preset behavior keyword library reaches a preset proportion threshold.

4. The method according to claim 1, It is characterized in that There are multiple target text contents of the specified type; The determining of the recognition result of the contract text includes: Performing information fusion processing on entity information in multiple pieces of target text content of the specified type to obtain an entity fusion result; Using the entity fusion result, correct each entity information to obtain corrected entity information; The text type and the corrected entity information are integrated to obtain a recognition result of the contract text.

5. The method according to claim 4, It is characterized in that The extracting entity information from the target text content includes: Selecting a preset number of target text contents of the specified type, and sequentially extracting entity information from the preset number of target text contents of the specified type; The performing information fusion processing on the entity information in the plurality of target text contents of the specified type to obtain the entity fusion result includes: Information fusion processing is performed on entity information in a preset number of target text contents of the specified type to obtain an entity fusion result.

6. The method according to claim 4 or 5, It is characterized in that The entity information includes entity words in the target text content of the specified type, wherein the entity words in the target text content of the specified type carry corresponding entity tags; The performing information fusion processing on the entity information in the plurality of target text contents of the specified type to obtain the entity fusion result includes: Counting entity words with the same entity tag in multiple pieces of target text content of the specified type; According to the statistical results, the entity fusion result is obtained.

7. The method according to claim 4 or 5, It is characterized in that The method of correcting each entity information by using the entity fusion result to obtain the corrected entity information includes: Matching the entity fusion result with each entity information; The entity information that has been successfully matched is determined as the corrected entity information, and the entity information that has failed to be matched is deleted.

8. The method according to any one of claims 1 to 5, It is characterized in that The performing type identification on the target text content to obtain the text type of the target text content includes: The target text content is input into a text classification model to obtain a text type of the target text content, wherein the text classification model is pre-trained based on sample texts carrying type labels.

9. The method according to claim 8, It is characterized in that Before inputting the target text content into a text classification model to obtain the text type of the target text content, the method further includes: Obtaining a first training set and a first sample text to be annotated, wherein the first training set includes a plurality of sample texts carrying type labels; Using the first training set, training a text classification model; Inputting the first sample text to be annotated into a trained text classification model to obtain a first prediction probability of whether the first sample text to be annotated is of a specified type; Based on the first prediction probability, annotating the first sample text to be annotated to obtain an annotated first sample text; The annotated first sample text is added to the first training set to obtain an updated first training set, and the text classification model is continuously trained using the updated first training set.

10. The method according to claim 9, It is characterized in that The step of labeling the first sample text to be labeled based on the first prediction probability includes: When the first prediction probability reaches a first preset threshold, marking the first sample text to be marked as a first sample text of a specified type; When the first prediction probability does not reach the first preset threshold, the first sample text to be annotated is annotated as a first sample text of a non-specified type.

11. The method according to any one of claims 1 to 5, It is characterized in that The extracting entity information from the target text content includes: The target text content is input into an entity recognition model to extract entity information in the target text content, wherein the entity recognition model is pre-trained based on sample texts that carry entity label information and belong to the specified type.

12. The method according to claim 11, It is characterized in that Before inputting the target text content into an entity recognition model and extracting entity information from the target text content, the method further includes: Obtaining a second training set and a second sample text to be annotated, wherein the second training set includes a plurality of sample texts that carry entity label information and belong to the specified type; Using the second training set, training an entity recognition model; Inputting the second sample text to be annotated into the trained entity recognition model to obtain each entity word in the second sample text to be annotated and a second predicted probability of entity label information corresponding to each entity word; Based on the second predicted probability, labeling each entity word of the second sample text to be labeled to obtain a labeled second sample text; The annotated second sample text is added to the second training set to obtain an updated second training set, and the entity recognition model is continuously trained using the updated second training set.

13. The method according to claim 12, It is characterized in that The step of labeling the second sample text to be labeled based on the second prediction probability includes: When the second prediction probability reaches a second preset threshold, the entity label information is determined to be the target entity label information, and the entity words corresponding to the target entity label information are marked.

14. A contract text recognition device, It is characterized in that include: A screening module is configured to obtain a contract text and extract target text content in the contract text that meets a preset condition, wherein the preset condition is set based on characteristic information of a specified type; An identification module is configured to perform type identification on the target text content to obtain the text type of the target text content; The extraction module is configured to extract entity information from the target text content and determine the recognition result of the contract text when the text type is the specified type.

15. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the contract text recognition method as described in any one of claims 1 to 13.

16. A computer-readable storage medium storing computer-executable instructions, It is characterized in that When the computer executable instructions are executed by a processor, the contract text recognition method as described in any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Contract content extraction method and device, computer device and storage medium

    CN110442842A

  • Prompting method, device and equipment for risk information in contract text

    CN112632989A

  • Text recognition method and device, equipment and storage medium

    CN114281934A