Deep learning-based contract classification method, system, and related devices

By employing a dual-model approach based on deep learning, the contract title category is first determined, and then a content classification model is selected for contract content classification. This solves the problems of low accuracy and efficiency in existing contract classification technologies, achieving higher accuracy and efficiency in contract classification.

CN115905535BActive Publication Date: 2026-05-12SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI
Filing Date
2022-11-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

When using a text classification model to classify the entire contract content in existing technologies, the different impacts of various parts of the contract on the classification are not considered, resulting in low classification accuracy and efficiency.

Method used

A deep learning-based dual-model approach is adopted. First, the contract title category is determined by the title classification model, and then the corresponding content classification model is selected for further contract content classification. The title classification model and the content classification model are trained separately to improve the accuracy of identifying different parts of the contract.

Benefits of technology

This improved the accuracy and efficiency of contract classification, particularly by rationally dividing contract content and using a guideline based on contract titles to select the best content classification model, thereby reducing data interference and enhancing the accuracy of contract classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905535B_ABST
    Figure CN115905535B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on deep learning contract classification method, system and related equipment, method includes: obtaining the contract title of contract to be classified, according to the contract title, obtain title category by the title classification model that has been trained, wherein the title category is any one in multiple preset categories;According to the title category, select and obtain a target content classification model from multiple preset trained content classification models, wherein one of the trained content classification model corresponds to one of the preset categories;The contract content of the contract to be classified is obtained, and the contract category corresponding to the contract to be classified is obtained according to the contract content by the target content classification model;Wherein the title classification model and the content classification model are neural network models based on deep learning.Compared with prior art, the application scheme is conducive to improving the accuracy of contract classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of text classification technology, and in particular to a contract classification method, system and related equipment based on deep learning. Background Technology

[0002] With the development of society and the economy, people's demand for contracts is increasing, and the proper management of contracts is receiving more and more attention. Contract management requires contract classification.

[0003] In existing technologies, a text classification model is typically used for contract classification. Specifically, all content of the contract is input into a text classification model for classification. The problem with this approach is that using a single text classification model to classify the entire contract requires applying the same processing to all content, failing to consider the different impacts of various parts of the contract on classification, thus hindering the improvement of classification accuracy.

[0004] Therefore, existing technologies still need improvement and development. Summary of the Invention

[0005] The main objective of this invention is to provide a contract classification method, system, and related equipment based on deep learning, aiming to solve the problem that existing technologies using a single text classification model to classify the entire contract content do not consider the different impacts of various parts of the contract on the contract classification, which is not conducive to improving the accuracy of contract classification.

[0006] To achieve the above objectives, a first aspect of the present invention provides a contract classification method based on deep learning, wherein the deep learning-based contract classification method includes:

[0007] Obtain the contract title of the contract to be classified, and obtain the title category based on the contract title using the trained title classification model. The title category can be any one of a variety of preset categories.

[0008] Based on the above title category, a target content classification model is selected from a plurality of pre-set trained content classification models, wherein one of the above-mentioned trained content classification models corresponds to one of the above-mentioned pre-set categories;

[0009] Obtain the contract content of the above-mentioned contracts to be classified, and based on the above-mentioned contract content, obtain the contract category corresponding to the above-mentioned contracts to be classified through the above-mentioned target content classification model;

[0010] The title classification model and the content classification model mentioned above are based on deep learning neural network models.

[0011] Optionally, the above-mentioned method of obtaining the contract title of the contract to be classified, and obtaining the title category based on the contract title using a trained title classification model, includes:

[0012] Obtain the contract titles of the aforementioned contracts to be classified;

[0013] The above contract title is feature extracted using a preset feature extractor to obtain the title feature vector corresponding to the above contract title.

[0014] Input the above title feature vector into the above trained title classification model and obtain the title category output by the above title classification model.

[0015] Optionally, the above-mentioned acquisition of the contract content of the contract to be classified, and the acquisition of the contract category corresponding to the contract to be classified through the target content classification model based on the contract content, include:

[0016] Obtain the contract contents of the aforementioned contracts to be classified;

[0017] Based on the above contract content, the content feature vector corresponding to the above contract content is obtained by the above-preset feature extractor.

[0018] Input the above content feature vector into the above target content classification model and obtain the contract category corresponding to the above contract to be classified as output by the above target content classification model.

[0019] Optionally, the aforementioned content feature vector is constructed by concatenating a first content feature sub-vector and a second content feature sub-vector. The extraction of the content feature vector corresponding to the contract content using the aforementioned preset feature extractor, based on the contract content, includes:

[0020] The contract content is processed according to the preset preprocessing operations to obtain the preprocessed content, wherein the preprocessing operations include deleting stop words;

[0021] The preprocessed content is divided into a first part and a second part according to a preset contract word count threshold. When the total number of words in the preprocessed content does not exceed the contract word count threshold, the first part includes all the preprocessed content and the second part is empty. When the total number of words in the preprocessed content exceeds the contract word count threshold, the first part includes the first contract word count threshold of the preprocessed content and the second part includes all the preprocessed content except for the first part.

[0022] The first part of the content is extracted using the preset feature extractor to obtain the feature sub-vector of the first part of the content.

[0023] The second part of the content is extracted using the preset feature extractor to obtain the feature sub-vector of the second content. When the second part of the content is empty, the feature sub-vector of the second content is an empty vector.

[0024] The content feature vector is obtained by concatenating the first content feature vector and the second content feature vector.

[0025] Optionally, when the second part of the content is not empty, the above-mentioned feature extraction of the second part of the content using the preset feature extractor and obtaining the feature sub-vector of the second content includes:

[0026] The second part of the above content is divided into multiple statements to be processed.

[0027] Calculate the term frequency-inverse document frequency for each of the above-mentioned statements to be processed;

[0028] Obtain the number of target sentences, select the number of target sentences with the highest term frequency-inverse document frequency from the above multiple unprocessed sentences, and form them into a target paragraph;

[0029] The target paragraph is input into the preset feature extractor, and the preset feature extractor extracts features from the target paragraph to obtain the second content feature vector.

[0030] Optionally, the above title classification model is trained according to the following steps:

[0031] The training contract title feature vector in the title training data is input into the title classification model mentioned above. The training title category corresponding to the training contract title feature vector is obtained through the title classification model. The title training data includes multiple contract title data groups. Each contract title data group includes the training contract title feature vector and the labeled title category corresponding to the training contract title feature vector.

[0032] The model parameters of the title classification model are adjusted according to the above-mentioned training title categories and the above-mentioned labeled title categories, and the above-mentioned steps of inputting the training contract title feature vectors in the title training data into the title classification model are continued until the first preset training condition is met, so as to obtain the trained title classification model.

[0033] Optionally, each of the above content classification models can be trained using different content training data. One of the above content classification models is trained according to the following steps:

[0034] Obtain the preset category corresponding to the above content classification model, and select a set of content training data from multiple preset sets of content training data according to the preset category as the target content training data corresponding to the above content classification model. The target content training data includes multiple target contract content data sets. Each target contract content data set includes a training contract content feature vector and a labeled contract category corresponding to the training contract content feature vector. The title category of the contract corresponding to the training contract content feature vector is the same as the preset category corresponding to the above content classification model.

[0035] Input the training contract content feature vector from the above target content training data into the above content classification model, and obtain the training contract category corresponding to the above target content training data through the above content classification model.

[0036] The model parameters of the content classification model are adjusted according to the above training contract categories and the above labeled contract categories. The step of inputting the training contract content feature vectors in the above target content training data into the above content classification model is continued until the second preset training condition is met, so as to obtain the trained content classification model.

[0037] A second aspect of the present invention provides a contract classification system based on deep learning, wherein the deep learning-based contract classification system comprises:

[0038] The title classification module is used to obtain the contract title of the contract to be classified. Based on the contract title, the title category is obtained through a trained title classification model. The title category can be any one of a variety of preset categories.

[0039] The content classification model selection module is used to select a target content classification model from a plurality of pre-set trained content classification models based on the above title category, wherein one of the above-mentioned trained content classification models corresponds to one of the above-mentioned pre-set categories;

[0040] The contract classification module is used to obtain the contract content of the above-mentioned contracts to be classified, and to obtain the contract category corresponding to the above-mentioned contracts to be classified through the above-mentioned target content classification model based on the above-mentioned contract content.

[0041] The title classification model and the content classification model mentioned above are based on deep learning neural network models.

[0042] A third aspect of the present invention provides a smart terminal, the smart terminal including a memory, a processor, and a deep learning-based contract classification program stored in the memory and executable on the processor, wherein the deep learning-based contract classification program, when executed by the processor, implements the steps of any of the deep learning-based contract classification methods.

[0043] A fourth aspect of the present invention provides a computer-readable storage medium storing a deep learning-based contract classification program, wherein the deep learning-based contract classification program, when executed by a processor, implements the steps of any of the deep learning-based contract classification methods described above.

[0044] As can be seen from the above, in the present invention, the contract title of the contract to be classified is obtained; based on the contract title, the title category is obtained through a trained title classification model, wherein the title category is any one of a plurality of preset categories; based on the title category, a target content classification model is selected from a plurality of preset trained content classification models, wherein one of the aforementioned trained content classification models corresponds to one of the aforementioned preset categories; the contract content of the contract to be classified is obtained; based on the contract content, the contract category corresponding to the contract to be classified is obtained through the aforementioned target content classification model; wherein the title classification model and the content classification model are based on deep learning neural network models.

[0045] Compared to existing technologies, the present invention, for contracts to be classified, first classifies the contract title to determine its category, and then selects a target content classification model for further classification based on the determined contract title, thereby determining the contract category based on the contract content. Thus, one model is used for title classification, and after determining the title category, another model (i.e., the optimal content classification model) is selected for content classification. The two models can be trained separately, improving the accuracy of identifying different parts of the contract. Specifically, the title classification model only needs to be trained on the contract title without considering the influence of the contract content, which improves the classification accuracy of the title classification model; while the content classification model does not require title data input during training, is not affected by title data, and a content classification model is trained based on data under its corresponding title category, thus improving the accuracy of contract classification under that title category. Therefore, the present invention considers the different influences of various parts of the contract on contract classification, uses two models for title and content classification respectively, and selects the optimal content classification model based on the guidance of the contract title category, which is beneficial to improving the accuracy of contract classification. Attached Figure Description

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

[0047] Figure 1 This is a schematic diagram of a contract classification process provided by an embodiment of the present invention;

[0048] Figure 2 This is a flowchart illustrating a contract classification method based on deep learning provided in an embodiment of the present invention;

[0049] Figure 3 This is a schematic diagram of a model training process provided in an embodiment of the present invention;

[0050] Figure 4 This is a schematic diagram of the structure of a contract classification system based on deep learning provided in an embodiment of the present invention;

[0051] Figure 5 This is a block diagram illustrating the internal structure of a smart terminal provided in an embodiment of the present invention. Detailed Implementation

[0052] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0053] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0054] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0055] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0056] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to classification." Similarly, the phrases "if determined" or "if classified to [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once classified to [the described condition or event]," or "in response to classification to [the described condition or event]."

[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0058] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0059] With the development of society and the economy, people's demand for contract signing is increasing, and the need for signing and reviewing various types of contracts is growing daily. The proper management of contracts is receiving increasing attention, and how to efficiently manage contract risks in daily operations is particularly important. Contract risks include both management risks and legal risks. Management risks stem from the contract management functions, while legal risks focus on the completeness and validity of the contract text, delving into the design techniques of various clauses. Contract management requires contract categorization. For example, in a law firm, each lawyer specializes in handling different types of contracts; therefore, contracts need to be categorized and reviewed by different lawyers.

[0060] In existing technologies, a text classification model is typically used for contract classification. Specifically, all content of the contract is input into a text classification model for classification. The problem with this approach is that classifying the entire contract using a single model requires treating all content identically, failing to consider the varying impacts of different parts of the contract on classification, thus hindering accuracy. Furthermore, contract data is sparse and dispersed, making direct classification using a single text model inefficient and inaccurate.

[0061] Contract classification is a text classification technique for contracts, involving the automatic identification of contract categories using artificial intelligence (AI) technology based on work needs. With the development of modern network technology, contract classification has evolved from manual selection to computer-based completion. Due to the wide variety of contracts and the different legal risks associated with each type, high-accuracy automatic contract classification technology has become a key challenge in achieving automatic legal risk alerts using AI. Most existing research is based on machine learning.

[0062] For example, Naive Bayes-based contract text classification has the main advantages of fast execution speed, simple algorithm, and high classification accuracy. However, due to the assumption of independence between feature terms, the classification effect may be poor. Nearest neighbor-based contract text classification has the main advantages of algorithm stability and high classification accuracy, and is suitable for text sets with significant overlap or intersection of class domains. However, when the samples are imbalanced, with a large number of samples in the majority, it may lead to classification errors. Support Vector Machine-based contract text classification has the main advantages of fewer parameters and fast speed. It has a significant classification effect on linearly separable data, can reduce the difficulty of solving high-dimensional space problems, and has good generalization ability. However, this method requires a large amount of storage space, and the training time will be relatively long if the data volume is large. Machine learning-based contract text classification methods ignore the relationships between words and sentences, and have poor processing and generalization ability for high-dimensional data.

[0063] Figure 1 This is a schematic diagram of a contract classification process provided by an embodiment of the present invention, such as... Figure 1 As shown, contract classification can be performed using a deep learning model in one application scenario. However, general deep learning-based text classification methods first require obtaining text representations. Traditional text representation methods have many drawbacks. For example, the bag-of-words model ignores the position and order of words and cannot represent semantic relationships between words, while also failing to represent polysemy. Furthermore, existing word vector representation models generally lack large-scale unsupervised data and can only use domain-specific data for training, which will result in a lack of generalization ability for contract classification.

[0064] In this embodiment, the feature vectors corresponding to words and sentences are used as the representation of words and sentences. The feature vectors of words and sentences contain generalized knowledge, which is not only for a certain task. They can capture the language characteristics and common sense hidden in the text, the literal meaning of the text, the parsing information of sentence structure, semantic relevance, pragmatics and other related information.

[0065] Meanwhile, existing methods all use a single model for contract classification, requiring all contract content to be input into the same model. This results in a large data volume, which is detrimental to improving contract classification efficiency. Furthermore, as the input length increases, the bias of the input data increases significantly, negatively impacting predictive performance during contract classification. For text classification models with input length limitations, existing techniques, when directly inputting the entire contract content, will simply truncate the first part of the contract and discard the latter, failing to adequately consider the importance of different parts of the contract and thus hindering accuracy in contract classification. To address at least one of the aforementioned problems, the present invention involves: obtaining the contract title of the contract to be classified; obtaining a title category based on the contract title using a trained title classification model, wherein the title category is any one of several preset categories; selecting a target content classification model from several preset trained content classification models based on the title category, wherein one of the trained content classification models corresponds to one of the preset categories; obtaining the contract content of the contract to be classified; obtaining the contract category corresponding to the contract to be classified using the target content classification model; wherein the title classification model and the content classification model are based on deep learning neural network models.

[0066] Compared to existing technologies, the present invention, for contracts to be classified, first classifies the contract title to determine its category, and then selects a target content classification model for further classification based on the determined contract title, thereby determining the contract category based on the contract content. Thus, one model is used for title classification, and after determining the title category, another model (i.e., the optimal content classification model) is selected for content classification. The two models can be trained separately, improving the accuracy of identifying different parts of the contract. Specifically, the title classification model only needs to be trained on the contract title without considering the influence of the contract content, which improves the classification accuracy of the title classification model; while the content classification model does not require title data input during training, is not affected by title data, and a content classification model is trained based on data under its corresponding title category, thus improving the accuracy of contract classification under that title category. Therefore, the present invention considers the different influences of various parts of the contract on contract classification, uses two models for title and content classification respectively, and selects the optimal content classification model based on the guidance of the contract title category, which is beneficial to improving the accuracy of contract classification.

[0067] In this embodiment, contract classification is based on a dual-model approach, dividing the contracts to be classified into two parts: the contract title and the contract content. Furthermore, for the contract content, when the text is too long, it can be reasonably divided into a first part and a second part. Valuable classification data (such as content with higher term frequency-inverse document frequency) can also be extracted, which helps improve the contract classification results. Further, preprocessing operations such as stop word removal, splitting, and weight fusion can be performed on the contract text sequence to further improve the accuracy of classification.

[0068] Exemplary methods

[0069] like Figure 2 As shown, this embodiment of the invention provides a contract classification method based on deep learning. Specifically, the method includes the following steps:

[0070] Step S100: Obtain the contract title of the contract to be classified. Based on the contract title, obtain the title category through the trained title classification model. The title category is any one of a variety of preset categories.

[0071] The contracts to be classified mentioned above are those that require classification. The pre-trained title classification model is a neural network model pre-trained for classifying contract titles. It should be noted that this embodiment has multiple preset categories, which can be set and adjusted according to user needs. For example, they may include loan contracts, financial lease contracts, lease contracts, sales contracts, contracting contracts, construction contracts, technology contracts, safekeeping contracts, warehousing contracts, property insurance contracts, etc., and may also include other categories, which are not specifically limited here.

[0072] Specifically, the above-mentioned acquisition of the contract title of the contract to be classified, and the acquisition of the title category based on the contract title through a trained title classification model, includes: acquiring the contract title of the contract to be classified; extracting features from the contract title through a preset feature extractor and obtaining the title feature vector corresponding to the contract title; inputting the title feature vector into the trained title classification model and obtaining the title category output by the title classification model.

[0073] The aforementioned preset feature extractor is an attention-based bidirectional encoder (BERT). In this embodiment, BERT is used as the basic feature extractor to extract title feature vectors from the contract title. These feature vectors are then input into a pre-trained fully connected neural network model (i.e., a trained title classification model) to obtain the title classification result, i.e., the title category, output by the model. In this embodiment, the labeled categories used during the pre-training process of the title classification model are the aforementioned preset categories. Therefore, the output title category is also one of these preset categories. This process determines which category the current contract to be processed is closest to, thereby selecting the optimal content classification model and improving the accuracy of contract classification.

[0074] Step S200: Select a target content classification model from a plurality of pre-set trained content classification models according to the title category mentioned above, wherein one of the pre-set trained content classification models corresponds to one of the pre-set categories mentioned above.

[0075] Specifically, in this embodiment, a corresponding content classification model is pre-trained for each preset category. Each content classification model is a targeted model trained based on training data within its corresponding preset category, thus improving the accuracy of contract recognition. The aforementioned target content classification model can serve as a classifier in the contract classification process.

[0076] Step S300: Obtain the contract content of the contract to be classified, and obtain the contract category corresponding to the contract to be classified through the target content classification model based on the contract content.

[0077] In this embodiment, both the title classification model and the content classification model are based on deep learning neural network models, but their training data differs. It should be noted that when the title classification model and the content classification model perform the classification task, the final output category is one of several pre-defined categories. For example, the title category output by the title classification model is any one of several pre-defined categories, and the title output by the content classification model is also one of several pre-defined content categories. These pre-defined categories and pre-defined content categories can be the same or different. When they are the same, it means that the title classification model first determines a general category, and then the content classification model further determines whether the contract to be classified actually belongs to that category.

[0078] In this embodiment, we will take the example of two different categories to illustrate the concept. When the two categories are different, a preset category corresponds to a set of preset content categories. This set of preset content categories represents the specific contract categories under the preset category. This means that the title classification model first determines a general category, and then the content classification model further determines which specific contract category under that general category the contract to be classified belongs to. For example, when the preset category is an economic contract, the corresponding set of preset content categories represents the specific contract categories under the economic category. Similarly, when the preset category is a property insurance contract, the corresponding set of preset content categories could specifically include property, liability, guarantee, and credit insurance contracts.

[0079] Specifically, the above-mentioned acquisition of the contract content of the contract to be classified, and the acquisition of the contract category corresponding to the contract to be classified through the target content classification model based on the contract content, includes: acquiring the contract content of the contract to be classified; extracting the content feature vector corresponding to the contract content through the preset feature extractor based on the contract content; inputting the content feature vector into the target content classification model and obtaining the contract category corresponding to the contract to be classified output by the target content classification model.

[0080] In one application scenario, the contract title is first fed into a title classification model to select a target content classification model. Then, the contract content is fed into the selected target content classification model to obtain a set of predicted values. The category corresponding to the highest predicted value is taken as the classification result. It should be noted that the aforementioned target content classification model is simply the selected content classification model.

[0081] The contract categories mentioned above refer to the specific results of classifying the contracts to be classified. It should be noted that the same feature extractor or different feature extractors can be used when extracting features from the contract content and title; no specific limitation is made here. In one application scenario, features can be extracted from the entire contract content. In this embodiment, to reduce the amount of data processing, and considering that the word count of each contract can vary by nearly 10,000 words, more effective features are extracted from the contract content based on a segmented approach to improve the accuracy and efficiency of contract classification.

[0082] In this embodiment, the content feature vector is formed by concatenating a first content feature sub-vector and a second content feature sub-vector. The step of extracting the content feature vector corresponding to the contract content using the preset feature extractor, based on the contract content, includes: processing the contract content according to preset preprocessing operations to obtain preprocessed content, wherein the preprocessing operations include deleting stop words; dividing the preprocessed content into a first part and a second part according to a preset contract character count threshold, wherein when the total number of characters in the preprocessed content does not exceed the contract character count threshold, the first part includes all the preprocessed content, and the second part is empty; when the total number of characters in the preprocessed content does not exceed the contract character count threshold, the first part includes all the preprocessed content, and the second part is empty. When the total number of characters in the content exceeds the aforementioned contract segmentation character threshold, the first part of the content includes the first contract segmentation character threshold of the preprocessed content, and the second part of the content includes all content in the preprocessed content except for the first part of the content; the first part of the content is feature-extracted using the aforementioned preset feature extractor to obtain the first content feature vector; the second part of the content is feature-extracted using the aforementioned preset feature extractor to obtain the second content feature vector, wherein when the second part of the content is empty, the second content feature vector is an empty vector; the first content feature vector and the second content feature vector are concatenated to obtain the content feature vector.

[0083] The preprocessing operations mentioned above are pre-set operations performed on the text, which may include removing stop words, cleaning, sentence splitting, etc., without specific limitations here.

[0084] Specifically, in one application scenario, the contract content is used as the original dataset. Sentences are split, and stop words are removed. The first 2000 characters (the threshold for contract segmentation) are divided into four segments (to improve feature extraction efficiency and effectiveness). Each segment uses an attention-based bidirectional encoder as the basic feature vector to extract features, and these vectors are concatenated to obtain the first content feature sub-vector. If the contract content (after preprocessing) does not exceed 2000 characters, meaning the second part is empty, the feature vector corresponding to the second part (i.e., the second content feature sub-vector) is filled with blanks. The blank vector and the first content feature sub-vector are then concatenated to obtain the final content feature vector.

[0085] Furthermore, when the second part of the content is not empty, the above-mentioned feature extraction of the second part of the content by the preset feature extractor to obtain the second content feature sub-vector includes: dividing the second part of the content into sentences to obtain multiple sentences to be processed; calculating the term frequency-inverse document frequency corresponding to each of the sentences to be processed; obtaining the number of target sentences, selecting the number of target sentences with the highest term frequency-inverse document frequency from the multiple sentences to be processed and forming a target paragraph; inputting the target paragraph into the preset feature extractor, and performing feature extraction on the target paragraph by the preset feature extractor to obtain the second content feature sub-vector.

[0086] The number of target statements mentioned above refers to the number of statements to be extracted from the second part. It can be determined based on the length of the second content feature sub-vector as specified in advance, or it can be set and adjusted according to actual needs. No specific limitation is made here.

[0087] Specifically, in this embodiment, the term frequency-inverse document rate feature is used to filter out corresponding sentences (or paragraphs), which can identify more important sentences (or paragraphs) in the second part of the content, thereby improving the accuracy of contract classification. The extracted sentences (or paragraphs) are then processed using an attention-based bidirectional encoder (BERT) as the basic feature extractor to obtain feature vectors. These feature vectors are then concatenated and merged to obtain the second content feature sub-vector. Simultaneously, the obtained second content feature sub-vector is concatenated with the first content feature sub-vector of the first two thousand characters to obtain the final content feature vector.

[0088] The above content feature vectors are input into the selected target content classification model. The probability of each category is obtained through a normalized exponential function, and the highest probability is taken as the predicted contract category.

[0089] In this embodiment, the title classification model is trained according to the following steps: the training contract title feature vector from the title training data is input into the title classification model, and the training title category corresponding to the training contract title feature vector is obtained through the title classification model. The title training data includes multiple contract title data groups, and each contract title data group includes a training contract title feature vector and a labeled title category corresponding to the training contract title feature vector. The model parameters of the title classification model are adjusted according to the training title category and the labeled title category, and the step of inputting the training contract title feature vector from the title training data into the title classification model is continued until the first preset training condition is met, so as to obtain the trained title classification model.

[0090] The first preset training conditions mentioned above include the number of training iterations of the title classification model reaching a first preset threshold, or the loss between the trained title category and the labeled title category being less than a preset first loss threshold. Other conditions for the completion of model training may also be included, which are not specifically limited here.

[0091] In this embodiment, each of the above-mentioned content classification models is trained using different content training data. One of the above-mentioned content classification models is trained according to the following steps: A preset category corresponding to the above-mentioned content classification model is obtained; based on the preset category, a set of content training data is selected from multiple preset sets of content training data as the target content training data corresponding to the above-mentioned content classification model. The target content training data includes multiple target contract content data sets, each target contract content data set including a training contract content feature vector and a labeled contract category corresponding to the training contract content feature vector. The title category of the contract corresponding to the training contract content feature vector is the same as the preset category corresponding to the above-mentioned content classification model. The training contract content feature vector from the target content training data is input into the above-mentioned content classification model, and the training contract category corresponding to the target content training data is obtained through the above-mentioned content classification model. The model parameters of the above-mentioned content classification model are adjusted according to the training contract category and the labeled contract category, and the step of inputting the training contract content feature vector from the target content training data into the above-mentioned content classification model continues until the second preset training condition is met, thereby obtaining the trained content classification model.

[0092] The training contract content feature vectors are derived from the contracts used as training data. The title category of the contract corresponding to the training contract content feature vector is the category corresponding to the title of the training contract to which the training contract content feature vector belongs. This category can be determined by inputting the contract titles of the training contracts into the trained title classification model. It should be noted that the title classification model and the content classification model can use the same batch of training data.

[0093] It should be noted that in this embodiment, the input during model usage is the feature vector corresponding to the contract title and contract content. Therefore, the input during model training is also the feature vector used for training. In one application scenario, the input data during model usage can be directly the contract title and contract content (without needing to extract the corresponding feature vectors). In this case, the input data during model training is also directly the contract title and contract content used for training. The specific training process is similar to the above training process and will not be repeated here.

[0094] Furthermore, this embodiment provides a detailed explanation of the training process for the title classification model and the content classification model in conjunction with a specific application scenario. Specifically, in this embodiment, the title classification model and the content classification model are used to automatically identify the contract category based on the contract title and contract content. During the training phase, the title classification model and the content classification model learn the features of the contract title and contract content, respectively. The trained title classification model and content classification model encourage minimizing the sparsity of the input data while ensuring the integrity of the original data.

[0095] Training content classification models requires dataset splitting. This embodiment uses training two content classification models as an example, splitting the original training dataset into two sets of training data (i.e., two datasets). These two sets of training data are for training content classification models targeting different categories of contract titles. Specifically, when splitting the two sets of training data, the goal is to maximize the data differences within the same set and minimize the data differences between the two sets, thereby improving model training performance. A title classification model is trained based on all titles in the original training dataset, resulting in a binary title classification model. Two separate content classification models are then trained based on the two sets of training data. During use, the corresponding content classification model can be selected as the target content classification model based on the results of the binary title classification model, and the result of the target content classification model is used as the final contract classification result.

[0096] Figure 3 This is a schematic diagram of a model training process provided in an embodiment of the present invention, such as... Figure 3 As shown, in this embodiment, the contract titles in the original training dataset are first used to train the title classification model. Specifically, the title feature vectors used for training are first extracted from the contract titles using an attention-based bidirectional encoder (i.e., the training title feature vectors). Then, the training title feature vectors are input into the title classification model to obtain the output results. Based on the output results and the corresponding annotation results (i.e., the labeled title categories), the model parameters of the title classification model are adjusted to train the model.

[0097] Then, the contract content in the original training dataset is split into two datasets, and two corresponding content classification models are trained using these two datasets respectively.

[0098] Specifically, before model training, the data in the original training dataset is preprocessed to improve training effectiveness and achieve better classification results. Specifically, the number of contracts in each category in the original training dataset is first counted. If the number of contracts is less than a preset standard value, simple data augmentation techniques are used to augment that category of contracts. Data augmentation methods can include adding noise and back-translation, both of which are supervised methods. Adding noise involves creating new data similar to the original data by replacing or deleting words. Back-translation involves translating the original data into another language and then back into the original language. Due to differences in language logic and order, back-translation often yields new data that differs significantly from the original data. Noise addition can employ one or more of the following operations: synonym replacement, random insertion, random swapping, and random deletion.

[0099] Specifically, synonym replacement involves randomly selecting several words from the sentence, ignoring stop words, and then randomly selecting synonyms from a thesaurus and replacing them. Random insertion involves randomly selecting a word, ignoring stop words, and then randomly choosing a synonym from the set of synonyms for that word, inserting it into a random position in the original sentence; this process can be repeated. Random swapping involves randomly selecting two words from the sentence and swapping their positions; this process can be repeated. Random deletion involves randomly deleting each word in the sentence with probability p.

[0100] Furthermore, for the content data, before independent training, stop words are removed from each piece of content data, a dictionary of all contract texts is constructed, and the term frequency-inverse document rate (TFR) of all words is calculated. The TFR of the first 5,000 words of each contract is summed, and the sums are sorted to identify the corresponding contracts and added to the database. The first and a middle contract are selected from the database one by one as data for the two models, until there is no data left in the database or only one data entry remains.

[0101] During the model training phase, the preprocessed content training data is divided into two sub-training sets. Different sub-training sets are used to train two content classification models. Specifically, during training, the input data of the content classification model is the feature vector obtained by using BERT to extract features from the contract content (i.e., the encoding result obtained by encoding the contract content).

[0102] It should be noted that the above training process uses the title classification model for binary classification. The specific example is that two content classification models need to be trained. When more content classification models need to be trained, the contract content in the original training dataset is divided to obtain more datasets. The specific training process is described in detail above and will not be repeated here.

[0103] Thus, in this embodiment, by using a structure that first segments and then aggregates using a special method, and by incorporating text features based on a pre-trained model, the classification performance of the deep model in both short and long text domains is improved. The dual-model classification method can also assist in improving classification tasks using datasets with relatively small contract contents. By splitting the dataset and fusing weights, the classification accuracy is improved. Furthermore, the deep learning-based text classification method in this embodiment effectively utilizes the dataset and improves prediction accuracy.

[0104] Meanwhile, for contract text classification, the traditional method of obtaining text representations from training datasets is replaced by using a large-scale pre-trained model to extract feature vectors. This transformation enables the model to have good generalization ability. Addressing the issue of variable sentence lengths in contract texts and the potential for word count differences of up to 10,000 words per contract, a segmentation-based approach is proposed. Fixed features are extracted from each contract for training, effectively utilizing the textual information of each contract.

[0105] Furthermore, in the process of automatically identifying contract categories, a term frequency-inverse document rate (IFR)-based method was used to partition the dataset, ensuring both inter-dataset similarity and intra-dataset differences. This method effectively addresses the problem of traditional single-dataset training not yielding good results, significantly improving performance in predicting contract categories. Simultaneously, to address the issue of varying input data lengths, a fixed feature extraction method was employed, effectively utilizing the textual information of each contract to achieve good generalization of the classification model.

[0106] In this embodiment, two models are used to analyze different parts of the contract. Since a single model analyzes all the contents of the contract and is based on a deep neural network, it is beneficial to improve the classification effect.

[0107] Specifically, to verify the contract classification method proposed in this embodiment, experiments were conducted on a pre-defined contract dataset to evaluate its performance. The model's effectiveness was evaluated using three metrics: accuracy, recall, and F1 score. Comparisons were made with classic CNN models, SVM models, and linear regression models. Experimental results show that the contract classification method provided in this embodiment has better classification performance and can effectively utilize contract text data, making it widely applicable to contract category prediction.

[0108] As can be seen from the above, in this invention, for contracts to be classified, the contract title is first classified to determine the title category. Then, based on the determined contract title, a target content classification model is selected for further classification, thereby determining the contract category based on the contract content. Thus, one model is used for title classification, and after determining the title category, another model (i.e., the optimal content classification model) is selected for content classification. The two models can be trained separately, improving the accuracy of identifying different parts of the contract. Specifically, the title classification model only needs to be trained on the contract title without considering the influence of the contract content, which improves the classification accuracy of the title classification model. Similarly, the content classification model does not require title data input during training, is not affected by title data, and is trained based on data under its corresponding title category, thus improving the accuracy of contract classification under that title category. Therefore, this invention considers the different influences of various parts of the contract on contract classification, uses two models for title and content classification respectively, and selects the optimal content classification model based on the guidance of the contract title category, which helps improve the accuracy of contract classification.

[0109] Exemplary device

[0110] like Figure 4 As shown in the figure, corresponding to the above-mentioned deep learning-based contract classification method, this embodiment of the invention also provides a deep learning-based contract classification system, which includes:

[0111] The title classification module 410 is used to obtain the contract title of the contract to be classified, and to obtain the title category based on the contract title through a trained title classification model. The title category is any one of a variety of preset categories.

[0112] The content classification model selection module 420 is used to select a target content classification model from a plurality of pre-set trained content classification models according to the above title category, wherein one of the above-mentioned trained content classification models corresponds to one of the above-mentioned pre-set categories;

[0113] The contract classification module 430 is used to obtain the contract content of the contract to be classified and, based on the contract content, obtain the contract category corresponding to the contract to be classified through the target content classification model.

[0114] The title classification model and the content classification model mentioned above are based on deep learning neural network models.

[0115] Specifically, in this embodiment, the specific functions of the deep learning-based contract classification system and its modules can be referred to the corresponding descriptions in the deep learning-based contract classification method, and will not be repeated here.

[0116] It should be noted that the division of the modules in the above deep learning-based contract classification system is not unique and is not intended as a specific limitation.

[0117] Based on the above embodiments, the present invention also provides a smart terminal, the principle block diagram of which can be as follows: Figure 5 As shown. The aforementioned smart terminal includes a processor and a memory. The memory of the smart terminal includes a deep learning-based contract classification program, and the memory provides an environment for the operation of the deep learning-based contract classification program. When the deep learning-based contract classification program is executed by the processor, it implements the steps of any of the aforementioned deep learning-based contract classification methods. It should be noted that the aforementioned smart terminal may also include other functional modules or units, which are not specifically limited here.

[0118] Those skilled in the art will understand that Figure 5 The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the smart terminal to which the present invention is applied. Specifically, the smart terminal may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0119] This invention also provides a computer-readable storage medium storing a deep learning-based contract classification program. When executed by a processor, the deep learning-based contract classification program implements the steps of any deep learning-based contract classification method provided in this invention.

[0120] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0122] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0123] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0124] In the embodiments provided by this invention, it should be understood that the disclosed systems / smart terminals and methods can be implemented in other ways. For example, the system / smart terminal embodiments described above are merely illustrative. For instance, the division of modules or units described above is merely a logical functional division, and in actual implementation, it can be divided in other ways. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0125] If the integrated modules / units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.

[0126] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not mean that the essence of the corresponding technical solutions deviates from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A contract classification method based on deep learning, characterized in that, The method includes: Obtain the contract title of the contract to be classified, and obtain the title category based on the contract title using a trained title classification model, wherein the title category is any one of a variety of preset categories; Based on the title category, a target content classification model is selected from a plurality of pre-set trained content classification models, wherein one of the trained content classification models corresponds to one of the pre-set categories; Obtain the contract content of the contract to be classified, and based on the contract content, obtain the contract category corresponding to the contract to be classified through the target content classification model; The title classification model and the content classification model are based on deep learning neural network models. The step of obtaining the contract title of the contract to be classified and obtaining the title category based on the contract title using a trained title classification model includes: obtaining the contract title of the contract to be classified; extracting features from the contract title using a preset feature extractor and obtaining the title feature vector corresponding to the contract title; inputting the title feature vector into the trained title classification model and obtaining the title category output by the title classification model. The step of obtaining the contract content of the contract to be classified and obtaining the contract category corresponding to the contract to be classified through the target content classification model based on the contract content includes: obtaining the contract content of the contract to be classified; extracting the content feature vector corresponding to the contract content through the preset feature extractor based on the contract content; inputting the content feature vector into the target content classification model, obtaining the probability of each category through a normalized exponential function, and obtaining the contract category with the highest probability prediction output by the target content classification model as the contract category corresponding to the contract to be classified. The content feature vector is formed by concatenating a first content feature sub-vector and a second content feature sub-vector. The step of extracting the content feature vector corresponding to the contract content using the preset feature extractor, based on the contract content, includes: processing the contract content according to a preset preprocessing operation to obtain preprocessed content, wherein the preprocessing operation includes deleting stop words; dividing the preprocessed content into a first part and a second part according to a preset contract character count threshold, wherein when the total number of characters in the preprocessed content does not exceed the contract character count threshold, the first part includes all the preprocessed content, and the second part is empty; when the total number of characters in the preprocessed content does not exceed the contract character count threshold, the first part includes all the preprocessed content, and the second part is empty. When the total number of characters exceeds the contract segmentation character count threshold, the first part of the content includes the first contract segmentation character count threshold of the preprocessed content, and the second part of the content includes all content in the preprocessed content except for the first part of the content; the first part of the content is feature-extracted using the preset feature extractor to obtain the first content feature sub-vector; the second part of the content is feature-extracted using the preset feature extractor to obtain the second content feature sub-vector, wherein when the second part of the content is empty, the second content feature sub-vector is an empty vector; the first content feature sub-vector and the second content feature sub-vector are concatenated to obtain the content feature vector.

2. The contract classification method based on deep learning according to claim 1, characterized in that, When the second part of the content is not empty, the step of extracting features from the second part of the content using the preset feature extractor and obtaining the feature sub-vector of the second content includes: The second part of the content is divided into multiple statements to be processed. Calculate the term frequency-inverse document frequency for each of the statements to be processed; Obtain the number of target sentences, select the number of target sentences with the highest term frequency-inverse document frequency from the multiple sentences to be processed, and form a target paragraph; The target paragraph is input into the preset feature extractor, and the preset feature extractor extracts features from the target paragraph to obtain the second content feature sub-vector.

3. The contract classification method based on deep learning according to claim 1 or 2, characterized in that, The title classification model is trained according to the following steps: The training contract title feature vector in the title training data is input into the title classification model, and the training title category corresponding to the training contract title feature vector is obtained through the title classification model. The title training data includes multiple contract title data groups, and each contract title data group includes a training contract title feature vector and a labeled title category corresponding to the training contract title feature vector. The model parameters of the title classification model are adjusted according to the training title category and the labeled title category, and the step of inputting the training contract title feature vector in the title training data into the title classification model is continued until the first preset training condition is met to obtain the trained title classification model.

4. The contract classification method based on deep learning according to claim 3, characterized in that, Each of the content classification models is trained using different content training data. One of the content classification models is trained according to the following steps: Obtain the preset category corresponding to the content classification model, and select a set of content training data from multiple preset sets of content training data according to the preset category as the target content training data corresponding to the content classification model. The target content training data includes multiple target contract content data sets. Each target contract content data set includes a training contract content feature vector and a labeled contract category corresponding to the training contract content feature vector. The title category of the contract corresponding to the training contract content feature vector is the same as the preset category corresponding to the content classification model. Input the training contract content feature vector from the target content training data into the content classification model, and obtain the training contract category corresponding to the target content training data through the content classification model; The model parameters of the content classification model are adjusted according to the training contract category and the labeled contract category, and the step of inputting the training contract content feature vector in the target content training data into the content classification model is continued until the second preset training condition is met to obtain the trained content classification model.

5. A contract classification system based on deep learning, characterized in that, The system includes: The title classification module is used to obtain the contract title of the contract to be classified, and to obtain the title category based on the contract title through a trained title classification model, wherein the title category is any one of a variety of preset categories; The content classification model selection module is used to select a target content classification model from a plurality of pre-set trained content classification models according to the title category, wherein one of the trained content classification models corresponds to one of the pre-set categories; The contract classification module is used to obtain the contract content of the contract to be classified, and obtain the contract category corresponding to the contract to be classified through the target content classification model based on the contract content. The title classification model and the content classification model are based on deep learning neural network models. The title classification module is specifically used for: obtaining the contract title of the contract to be classified; extracting features from the contract title using a preset feature extractor and obtaining the title feature vector corresponding to the contract title; inputting the title feature vector into the trained title classification model and obtaining the title category output by the title classification model; The contract classification module is specifically used for: obtaining the contract content of the contract to be classified; extracting the content feature vector corresponding to the contract content through the preset feature extractor based on the contract content; inputting the content feature vector into the target content classification model, obtaining the probability of each category through a normalized exponential function, and obtaining the contract category with the highest probability prediction output by the target content classification model as the contract category corresponding to the contract to be classified. The content feature vector is formed by concatenating a first content feature sub-vector and a second content feature sub-vector. The contract classification module is further specifically used for: processing the contract content according to a preset preprocessing operation to obtain preprocessed content, wherein the preprocessing operation includes deleting stop words; dividing the preprocessed content into a first part and a second part according to a preset contract character count threshold, wherein when the total number of characters in the preprocessed content does not exceed the contract character count threshold, the first part includes all the preprocessed content, and the second part is empty; when the total number of characters in the preprocessed content exceeds the contract character count threshold, the first part includes the first contract character count threshold characters of the preprocessed content, and the second part includes all content in the preprocessed content except for the first part; extracting features from the first part using a preset feature extractor to obtain the first content feature sub-vector; extracting features from the second part using the preset feature extractor to obtain the second content feature sub-vector, wherein when the second part is empty, the second content feature sub-vector is an empty vector; and concatenating the first content feature sub-vector and the second content feature sub-vector to obtain the content feature vector.

6. A smart terminal, characterized in that, The smart terminal includes a memory, a processor, and a deep learning-based contract classification program stored in the memory and executable on the processor. When executed by the processor, the deep learning-based contract classification program implements the steps of the deep learning-based contract classification method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a deep learning-based contract classification program, which, when executed by a processor, implements the steps of the deep learning-based contract classification method as described in any one of claims 1-4.