A contract text intelligent analysis method based on deep data mining
Through in-depth data mining technology, combined with multi-feature word weight formulas and language models, the problems of keyword extraction, similar contract matching and content correction in contract text analysis are solved, significantly improving the analysis efficiency and accuracy.
Patent Information
- Application Number
- CN202111485260.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-12-07
AI Technical Summary
It is difficult for the prior art to accurately extract keywords of contract text, match similar contracts, and correct content, resulting in inefficient analysis of contract texts.
Using an intelligent analysis method based on deep data mining, keywords are extracted through multi-feature word weight formulas, similar historical contract texts are retrieved, and content error correction is performed using language models and N-Gram language models.
It improves the accuracy and efficiency of contract text analysis, realizes the accuracy of keyword extraction, the improvement of retrieval efficiency and the automation of content error correction.
Smart Images

Figure CN114328822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to a contract text intelligent analysis method based on deep data mining. Background Art
[0002] In recent years, with the development of Internet technology, corporate legal personnel are faced with the need to quickly analyze, manage and compile a large number of contracts in the form of electronic documents in a short period of time. How to quickly and accurately obtain summary information from various contracts and manage and edit contracts is the main problem that needs to be solved. Compared with other documents, contract texts have the following characteristics:
[0003] 1. Clear subject categories: Contract texts are usually edited and managed by department, organization and business situation. Each document is basically classified by department or business category.
[0004] 2. Specialized use of terms: The terms used in the contract text are generally based on the department and subject, using some special terms in the corresponding scope, rather than using various daily and Internet terms like novels, forums, Weibo and other documents.
[0005] 3. Content standardization: The content of a contract text is generally a declarative sentence, without too much modification and descriptive content. Therefore, when writing a contract text, errors are mostly word errors and special word errors, and rarely involve grammatical and semantic errors.
[0006] 4. The contract text generally does not have a summary, and sometimes uses the name of a meeting or report as the document title, which fails to provide sufficient document summary information.
[0007] Based on the above characteristics of the contract text, there is no corresponding method in the prior art that can accurately extract keywords, match similar contracts, and correct content errors in the contract text, which makes the analysis of the contract text not only prone to errors but also inefficient. Therefore, how to provide a contract text intelligent analysis method based on deep data mining to improve the quality and efficiency of contract text analysis has become a technical problem that needs to be solved urgently. Summary of the invention
[0008] The technical problem to be solved by the present invention is to provide a contract text intelligent analysis method based on deep data mining, so as to improve the quality and efficiency of contract text analysis.
[0009] The present invention is implemented as follows: a contract text intelligent analysis method based on deep data mining, comprising the following steps:
[0010] Step S10: Acquire the contract text to be analyzed and a large number of historical contract texts to form a contract text set;
[0011] Step S20, preprocessing the contract text set;
[0012] Step S30: Based on the multi-feature word weight formula, keyword extraction is performed on the pre-processed contract text to be analyzed and the historical contract text to obtain a plurality of first keywords and second keywords;
[0013] Step S40: searching similar historical contract texts based on the first keyword and the second keyword;
[0014] Step S50, searching for confusing words in the contract text to be analyzed based on the language model perplexity and the N-Gram language model, and matching the correct words corresponding to the confusing words;
[0015] Step S60: display the first keyword of the contract text to be analyzed, similar historical contract texts, confusing words, and correct words to complete the intelligent analysis of the contract text to be analyzed.
[0016] Furthermore, in step S10, the step of obtaining a large amount of historical contract texts is specifically as follows:
[0017] A time span is set, and a large number of historical contract texts of different departments in different regions are obtained based on the time span.
[0018] Furthermore, the step S20 specifically includes:
[0019] Step S21: Check the duplicates of each contract text in the contract text set based on the contract title, and merge the duplicate contract texts;
[0020] Step S22, removing noise data of each contract text in the contract text set;
[0021] Step S23: Create a sensitive word library, and filter the sensitive words in each contract text in the contract text set based on the sensitive word library.
[0022] Furthermore, in step S22, the noise data at least includes URL addresses, special symbols, emoticons, pictures and zero-width characters.
[0023] Furthermore, in step S30, the multi-feature word weight formula is specifically:
[0024] W NEW-TF-IDF =W TF-IDF ×W word ;
[0025] W TF-IDF =TF(i)×IDF(i);
[0026]
[0027]
[0028] W word =αW l +βW c +γW len ;
[0029]
[0030] Among them, W NEW-TF-IDF Represents the weight of multi-feature words; W TF-IDF represents the weighted feature weight; W word represents the word weight including position weight, part-of-speech weight and word length weight; TF(i) represents the word frequency of the i-th word; IDF(i) represents the inverse document frequency of the i-th word, that is, the fewer the number of contract texts containing the i-th word, the larger the value; n i represents the number of times the i-th word appears; n represents the total number of all keywords; N represents the total number of contract texts; df(i) represents the number of documents in which the i-th word appears; α, β and γ all represent weight coefficients; W l represents the position weight; W c represents the part-of-speech weight; W len Indicates word length weight; i len represents the word length of the i-th word; avg(len) represents the average word length.
[0031] Furthermore, the step S40 specifically includes:
[0032] Step S41: concatenate each of the first keywords and the corresponding contract title to obtain first key information, and concatenate each of the second keywords and the corresponding contract title to obtain second key information;
[0033] Step S42: input the first key information and the second key information into the BERT model and the average pooling layer in sequence for feature extraction to obtain a first feature sentence vector and a second feature sentence vector;
[0034] Step S43: Calculate the cosine similarity between the first feature sentence vector and each second feature sentence vector in turn, and match similar historical contract texts based on the cosine similarity.
[0035] Furthermore, in step S43, the calculation formula of the cosine similarity is:
[0036]
[0037] Among them, sim represents cosine similarity; x i Represents the first feature sentence vector; yi represents the second feature sentence vector; m represents the total number of feature sentence vectors.
[0038] Furthermore, the step S50 specifically includes:
[0039] Step S51, setting a likelihood threshold and creating a confusion word set; the confusion word set includes a one-to-one correspondence between a number of confusion words and correct words;
[0040] Step S52: Calculate the likelihood estimation value of each sentence in the contract text to be analyzed in turn based on the language model perplexity, and determine whether the likelihood estimation value is lower than the likelihood threshold. If so, it indicates that there are suspected confusing words, and proceed to step S53; if not, it indicates that there are no suspected confusing words, and the process ends;
[0041] Step S53: sorting the sentences containing suspected confusing words by using the N-Gram language model, and selecting the word with the highest score as the confusing word based on the sorting result;
[0042] Step S54: using the confused word set to match the correct word corresponding to the confused word.
[0043] The advantages of the present invention are:
[0044] By combining the position weight, part of speech weight and word length weight of the word on the basis of the traditional weighted feature weight, multi-feature word weight is constructed, and then keyword extraction is performed based on the multi-feature word weight, which fully considers the characteristics of the word position, part of speech and word length, thereby greatly improving the accuracy of keyword extraction; similar historical contract texts are retrieved through keyword matching, which greatly improves the retrieval efficiency compared to full-text retrieval; confused words are found through the language model perplexity and the N-Gram language model, and the correct words corresponding to the confused words are matched based on the created confused word set, so as to realize content correction of the contract text to be analyzed, which greatly improves the quality and efficiency of contract text analysis compared to traditional manual analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0046] Figure 1 It is a flow chart of a contract text intelligent analysis method based on deep data mining of the present invention. DETAILED DESCRIPTION
[0047] The technical solution in the embodiments of the present application has the following overall idea: combining the position weight, part-of-speech weight and word length weight of words to construct a multi-feature word weight for keyword extraction to improve the accuracy of keyword extraction; retrieving similar historical contract texts through keyword matching to improve retrieval efficiency; searching for confused words through language model perplexity and N-Gram language model, and matching the correct words corresponding to the confused words based on the created confused word set to achieve content correction, so as to improve the quality and efficiency of contract text analysis.
[0048] Please refer to Figure 1 As shown, a preferred embodiment of the contract text intelligent analysis method based on deep data mining of the present invention includes the following steps:
[0049] Step S10: Acquire the contract text to be analyzed and a large number of historical contract texts to form a contract text set;
[0050] Step S20, pre-processing the contract text set, that is, removing some invalid data to improve text processing efficiency;
[0051] Step S30: Based on the multi-feature word weight formula, the pre-processed contract text to be analyzed and the historical contract text are respectively subjected to keyword extraction to obtain a plurality of first keywords and second keywords; since the contract text is often long, it will take a long time to browse the entire text, and by extracting keywords, it is convenient for the staff to quickly obtain important information of the contract text;
[0052] Step S40: searching similar historical contract texts based on the first keyword and the second keyword, so as to obtain some reference information from the similar historical contract texts;
[0053] Step S50, based on the language model perplexity (PPL) and the N-Gram language model, searching for the confusing words in the contract text to be analyzed, and matching the correct words corresponding to the confusing words; the content error correction of the present invention does not require data annotation work, has low computational complexity, high extraction efficiency, and can meet high real-time requirements;
[0054] Step S60: display the first keyword of the contract text to be analyzed, similar historical contract texts, confused words and correct words, complete the intelligent analysis of the contract text to be analyzed, and automatically replace the corresponding confused words with the correct words.
[0055] In step S10, the step of obtaining a large amount of historical contract texts is specifically as follows:
[0056] A time span is set, and a large number of historical contract texts from different regions and departments are obtained based on the time span to improve the richness of the sample.
[0057] The step S20 specifically includes:
[0058] Step S21: Check the duplicates of each contract text in the contract text set based on the contract title, and merge the duplicate contract texts;
[0059] Step S22, removing noise data of each contract text in the contract text set;
[0060] Step S23: Create a sensitive word library, and filter the sensitive words in each contract text in the contract text set based on the sensitive word library.
[0061] In step S22, the noise data at least includes URL addresses, special symbols, emoticons, pictures and zero-width characters.
[0062] In step S30, the multi-feature word weight formula is specifically:
[0063] W NEW-TF-IDF =W TF-IDF ×W word ;
[0064] W TF-IDF =TF(i)×IDF(i);
[0065]
[0066]
[0067] W word =αW l +βW c +γW len ;
[0068]
[0069] Among them, W NEW-TF-IDF Represents the weight of multi-feature words; W TF-IDF represents the weighted feature weight; W word represents the word weight including position weight, part of speech weight and word length weight; TF(i) represents the word frequency of the i-th word; IDF(i) represents the inverse document frequency of the i-th word, that is, the smaller the number of contract texts containing the i-th word, the larger the value, indicating that the i-th word has a good type distinction function; n i represents the number of times the i-th word appears; n represents the total number of all keywords; N represents the total number of contract texts; df(i) represents the number of documents in which the i-th word appears; α, β and γ all represent weight coefficients, and their values are preferably 0.6, 0.3 and 0.1 respectively; W l represents the position weight; W c represents the part-of-speech weight; W lenIndicates word length weight; i len represents the word length of the i-th word; avg(len) represents the average word length.
[0070] The TF-IDF algorithm shows that a feature word that appears frequently enough in a text and has a low enough frequency in other texts in the entire text collection is the keyword of the text. However, the structure of the TF-IDF algorithm is too simple to effectively reflect the importance of words and the position distribution of feature words, and it is impossible to effectively adjust the weight of words. Therefore, the accuracy of the TF-IDF algorithm is not high, and the TF-IDF algorithm does not reflect the importance of the position, part of speech, and word length of words. For contracts, the information reflected in contents of different structures is different, and the focus of the contract title and the text is different, that is, the weight should also be allocated according to different structural features. Therefore, the present invention improves the traditional TF-IDF algorithm in combination with the characteristics of sample data, assigns different coefficients to feature words of different positions, parts of speech, and word lengths in the contract, and multiplies them by the TF-IDF value of the feature words to enhance the effect of text expression.
[0071] Since the title of a contract text can generally summarize the main contents of the contract, the words appearing in the title are more likely to become keywords; the words appearing at the beginning or end may reflect the hidden keywords or related keywords of the contract and should also be given due attention. Therefore, the position weight of the contract title is adjusted to the highest, the position weight of the beginning or end is second, and the position weight of other positions is the smallest.
[0072] Parts of speech in Chinese are divided into two categories: content words and function words; content words include: nouns, verbs, adjectives, pronouns, numerals, quantifiers, etc.; function words include: prepositions, conjunctions, interjections, auxiliary words, etc.; the part of speech of keywords is usually dominated by nouns or noun phrases, followed by verbs, adverbs and other modifiers.
[0073] If a keyword is too short, it cannot reflect the information it contains. If a keyword is too long, the more information it contains, the more likely it is that the keyword can be segmented again. After counting the word length of the contract text after segmentation, it is found that the word length of the keyword is generally between [2, 7]. Words that are too long or too short need to be filtered.
[0074] The step S40 specifically includes:
[0075] Step S41: splicing each of the first keywords and the corresponding contract titles to obtain first key information, and splicing each of the second keywords and the corresponding contract titles to obtain second key information; since both the keywords and the contract titles can represent important information of the contract, they are aligned and spliced;
[0076] Step S42: input the first key information and the second key information into the BERT model and the average pooling layer in sequence for feature extraction to obtain a first feature sentence vector and a second feature sentence vector;
[0077] Step S43: Calculate the cosine similarity between the first feature sentence vector and each second feature sentence vector in turn, and match similar historical contract texts based on the cosine similarity.
[0078] In step S43, the calculation formula of the cosine similarity is:
[0079]
[0080] Among them, sim represents cosine similarity; x i Represents the first feature sentence vector; y i represents the second feature sentence vector; m represents the total number of feature sentence vectors; the larger the value of sim is, the smaller the angle between the two feature sentence vectors is, the higher the similarity is, and finally the historical contract text with the highest similarity is returned.
[0081] Similar contract text retrieval can match similar historical contract texts for the contract text currently being written or managed, and provide relevant references and lessons for relevant personnel; semantic retrieval of similar contract texts is actually to judge the semantic similarity between the original text and the target text. Traditional semantic matching tends to be lexical semantics, form matching and syntactic similarity. It is necessary to extract pre-defined text features and write a similarity detection algorithm to obtain the similarity between texts; while the neural network-based method should consider how to distinguish the semantic differences between the two texts and how to build the correlation between the two texts when building the model. Due to the long length of the contract text, if the feature vector comparison is based on the full text, the extracted feature vector cannot well represent the key information of the contract, and the final retrieved similarity result is quite different from the actual one. Therefore, the present invention uses keywords to compare semantic similarity, improves the traditional full-text retrieval method, and speeds up matching efficiency.
[0082] The step S50 specifically includes:
[0083] Step S51, setting a likelihood threshold and creating a confusion word set; the confusion word set contains a one-to-one correspondence between a number of confusion words and correct words; the confusion word set can be updated as needed and has strong scalability;
[0084] Step S52, based on the language model perplexity (PPL), sequentially calculate the likelihood estimation value of each sentence in the contract text to be analyzed, and determine whether the likelihood estimation value is lower than the likelihood threshold. If so, it indicates that there are suspected confusing words, and enter step S53; if not, it indicates that there are no suspected confusing words, and the process ends;
[0085] The language model perplexity is the multiplicative inverse of the language model assignment probability, and the formula is:
[0086]
[0087] Where S represents the input text; N represents the sentence length; P(W i ) represents the probability of the i-th word;
[0088] Step S53: sorting the sentences containing suspected confusing words by using the N-Gram language model, and selecting the word with the highest score as the confusing word based on the sorting result;
[0089] The N-Gram language model based on statistics and probability judges the correctness by predicting the score of the text. When applied, it requires a sequence of N words. If the existence of a word depends only on the word before it, it is a bigram model Bi-Gram (N-2); if the existence of a word depends on the two words before it, it is a trigram model Tri-Gram (N-3), and so on. Assume that a sentence s in the contract text is composed of a series of specific sequences of words q1, q2, ..., q n According to the chain rule, the probability of sentence s appearing is:
[0090]
[0091] The N-Gram language model assumes that the probability of any word appearing is related to the n-1 words before it, that is:
[0092]
[0093] When the ternary model is used for modeling, it means that the i-th word is related to the first two words, that is:
[0094]
[0095] Step S54: using the confused word set to match the correct word corresponding to the confused word.
[0096] In summary, the advantages of the present invention are:
[0097] By combining the position weight, part of speech weight and word length weight of the word on the basis of the traditional weighted feature weight, multi-feature word weight is constructed, and then keyword extraction is performed based on the multi-feature word weight, which fully considers the characteristics of the word position, part of speech and word length, thereby greatly improving the accuracy of keyword extraction; similar historical contract texts are retrieved through keyword matching, which greatly improves the retrieval efficiency compared to full-text retrieval; confused words are found through the language model perplexity and the N-Gram language model, and the correct words corresponding to the confused words are matched based on the created confused word set, so as to realize content correction of the contract text to be analyzed, which greatly improves the quality and efficiency of contract text analysis compared to traditional manual analysis.
[0098] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A contract text intelligent analysis method based on deep data mining, characterized by: The steps include: Step S10: Acquire the contract text to be analyzed and a large number of historical contract texts to form a contract text set; Step S20, preprocessing the contract text set; Step S30: Based on the multi-feature word weight formula, keyword extraction is performed on the pre-processed contract text to be analyzed and the historical contract text to obtain a plurality of first keywords and second keywords; Step S40: searching similar historical contract texts based on the first keyword and the second keyword; Step S50, searching for confusing words in the contract text to be analyzed based on the language model perplexity and the N-Gram language model, and matching the correct words corresponding to the confusing words; Step S60: display the first keyword of the contract text to be analyzed, similar historical contract texts, confusing words, and correct words to complete the intelligent analysis of the contract text to be analyzed.
2. The method for intelligent analysis of contract text based on deep data mining according to claim 1, characterized in that: In step S10, the step of obtaining a large amount of historical contract texts is specifically as follows: A time span is set, and a large number of historical contract texts of different departments in different regions are obtained based on the time span.
3. The method for intelligent analysis of contract text based on deep data mining according to claim 1, characterized in that: The step S20 specifically includes: Step S21: Checking for duplicates in each contract text set based on the contract title, and merging duplicate contract texts; Step S22, removing noise data of each contract text in the contract text set; Step S23: Create a sensitive word library, and filter the sensitive words in each contract text in the contract text set based on the sensitive word library.
4. The method for intelligent analysis of contract text based on deep data mining according to claim 3, characterized in that: In step S22, the noise data at least includes URL addresses, special symbols, emoticons, pictures and zero-width characters.
5. The method for intelligent analysis of contract text based on deep data mining according to claim 1, characterized in that: In step S30, the multi-feature word weight formula is specifically: IN NEW-TF-IDF =In TF-IDF ×W word ; W TF-IDF =TF(i)×IDF(i); W word =αW l +βW c +γW len ; Among them, W NEW-TF-IDF Represents the weight of multi-feature words; W TF-IDF represents the weighted feature weight; W word represents the word weight including position weight, part-of-speech weight and word length weight; TF(i) represents the word frequency of the i-th word; IDF(i) represents the inverse document frequency of the i-th word, that is, the fewer the number of contract texts containing the i-th word, the larger the value; n i represents the number of times the i-th word appears; n represents the total number of all keywords; N represents the total number of contract texts; df(i) represents the number of documents in which the i-th word appears; α, β and γ all represent weight coefficients; W l represents the position weight; W c represents the part-of-speech weight; W len Indicates word length weight; i len represents the word length of the i-th word; avg(len) represents the average word length.
6. The method for intelligent analysis of contract text based on deep data mining according to claim 1, characterized in that: The step S40 specifically includes: Step S41: concatenate each of the first keywords and the corresponding contract title to obtain first key information, and concatenate each of the second keywords and the corresponding contract title to obtain second key information; Step S42: input the first key information and the second key information into the BERT model and the average pooling layer in sequence for feature extraction to obtain a first feature sentence vector and a second feature sentence vector; Step S43: Calculate the cosine similarity between the first feature sentence vector and each second feature sentence vector in turn, and match similar historical contract texts based on the cosine similarity.
7. The method for intelligent analysis of contract text based on deep data mining according to claim 6, characterized in that: In step S43, the calculation formula of the cosine similarity is: Among them, sim represents cosine similarity; x i Represents the first feature sentence vector; y i represents the second feature sentence vector; m represents the total number of feature sentence vectors.
8. The method for intelligent analysis of contract text based on deep data mining according to claim 1, characterized in that: The step S50 specifically includes: Step S51, setting a likelihood threshold and creating a confusion word set; the confusion word set includes a one-to-one correspondence between a number of confusion words and correct words; Step S52: Calculate the likelihood estimation value of each sentence in the contract text to be analyzed in turn based on the language model perplexity, and determine whether the likelihood estimation value is lower than the likelihood threshold. If so, it indicates that there are suspected confusing words, and proceed to step S53; if not, it indicates that there are no suspected confusing words, and the process ends; Step S53: sorting the sentences containing suspected confusing words by using the N-Gram language model, and selecting the word with the highest score as the confusing word based on the sorting result; Step S54: using the confused word set to match the correct word corresponding to the confused word.
Citation Information
Patent Citations
Error text rejection method and device and storage medium
CN110134952A
Contract key term extraction method and device based on artificial intelligence and storage medium
CN110765765A