Contract text key payment index extraction method based on natural language processing
By structuring the contract text and logical relationship analysis, the chapter-level tree and part-of-speech relationship map are constructed, and the problems of semantic ambiguity and omissions in the existing technology are solved, and more efficient and accurate withdrawal of payment indicators is achieved.
Patent Information
- Application Number
- CN202511038981.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-07-28
AI Technical Summary
When identifying payment indicators in contract texts, prior art is prone to semantic ambiguity and omissions, resulting in identification errors and missed detections, reducing the efficiency and accuracy of contract text processing.
Through a natural language processing method, the contract text is structured, the chapter hierarchy tree is constructed, the logical relationship tree and part-of-speech relationship map of the action entity are extracted, and the preset association rules and semantic expansion matrix is used to identify and correct the semantic matrix in the part-of-speech relationship map, and key payment indicators are output.
It improves the traceability and recognizability of payment indicators in the contract text, enhances the logical expression method, avoids the ignorance of semantic similar content, and improves the accuracy and coverage of payment indicator extraction.
Smart Images

Figure CN120523929A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method for extracting key payment indicators from a contract text based on natural language processing. Background Art
[0002] With the development of artificial intelligence technology, the application of artificial intelligence technology to automatically review contracts has become increasingly widespread. However, in its implementation, there are prone to problems such as serious manual dependence, omission of implicit clauses, and semantic ambiguity, which result in the inability to accurately identify the corresponding indicators in the identified contract text, resulting in recognition errors and missed problems in the text in scenarios such as checking payment indicators.
[0003] For example, Chinese patent publication number CN116976683A discloses a method, system, storage medium and device for automatic review of contract terms, which relates to the field of data processing technology. The method includes: obtaining a contract text to be reviewed, splitting the contract text to obtain multiple contract sub-texts of the contract text; identifying the paragraphs in the contract sub-texts that involve contract terms, and determining the contract terms existing in the contract sub-texts as terms to be reviewed; performing semantic analysis on the terms to be reviewed, determining the term identifier of the terms to be reviewed, and determining the type label to which the terms to be reviewed belong based on the term identifier; based on the type label, searching for multiple associated contracts that record associated terms corresponding to the type label; based on preset contract review rules and associated contracts, automatically reviewing the terms to be reviewed, outputting the risk level of the terms to be reviewed, and obtaining the review result of the contract text.
[0004] For example, Chinese patent publication number CN118520863A discloses a method and system for generating change contracts for clinical trial projects. The method includes: obtaining clinical trial project change data and preprocessing it to obtain structured change data; performing multi-dimensional decomposition to obtain a set of change elements and performing change impact analysis to obtain a change association network; performing path analysis and weight calculation to obtain key change paths and semantically encode them to obtain a semantic vector of the change content; performing clause matching to obtain a candidate set of clauses and perform similarity calculation to obtain a candidate contract template; performing semantic reorganization and context adaptation on the candidate set of clauses to obtain initial contract terms and perform consistency checking and conflict resolution to obtain optimized contract terms; and formatting and versioning the candidate contract templates and optimized contract terms to generate the target change contract document.
[0005] The existing technology completes the contract review by viewing the related clauses through type tags, and handles the redundant parts in the contract by changing the path; however, when the existing technology tends to view based on templates, the obtained contract text tends to identify the clauses related to the current review based on the clause structure combination, while ignoring the conditional terms described under each clause and the semantic content during implementation, resulting in semantic ambiguity in the identified clauses and the loss of some conditional dependencies, resulting in the lack of content such as payment indicators finally obtained, which reduces the efficiency and accuracy of contract text processing. Summary of the Invention
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for extracting key payment indicators from contract texts based on natural language processing, including: S1, dividing the contract text into structured chapters, constructing a chapter hierarchy tree, and setting candidate paths containing payment information based on the matching relationship between the multi-level path nodes of the chapter hierarchy tree and the chapter title keywords.
[0007] S2, extract the action entities of each contract text in the candidate path, set the logical relationship tree of the action entity based on the conditional clauses and condition types of the action entity, use the tree structure corresponding to the logical relationship tree to perform logical association analysis on the action entity, and extract the correlation indicators corresponding to the action entity.
[0008] S3, extracts adjacent words based on the relevance index of the action entity, and constructs a part-of-speech relationship graph reflecting the part-of-speech association pattern of the action entity by analyzing the part-of-speech features of the adjacent words and the current action entity.
[0009] S4, iterate the part-of-speech relationship graph with preset association rules, identify the semantic extension matrix of each node in the part-of-speech relationship graph, and modify each node in the part-of-speech relationship graph with the semantic extension matrix.
[0010] S5, perform vector mapping on the part-of-speech relationship graphs before and after the correction, and output the key payment indicators corresponding to the contract text based on the associated differences during mapping.
[0011] The beneficial effects of the present invention are: 1. After identifying the chapter boundaries related to the chapter titles through sequence labeling and boundary delineation, the present invention uses the chapter titles as nodes to construct a multi-level path, and then screens out candidate paths based on the number of associations in the multi-level path. At this time, by dividing the text structure into chapters, sections, articles, clauses, etc., the path nodes at the corresponding positions of each chapter title are obtained to complete the preliminary mapping and positioning of the current contract text, which is convenient for subsequent viewing of the statements and description content under the corresponding clauses, and improves the traceability of indicator extraction.
[0012] 2. The present invention extracts multiple action entities from the path nodes in the candidate path based on the conditional clauses and other contents corresponding to the candidate entities, and constructs a logical relationship tree using the logical relationships between the action entities. It can describe the number of associations that satisfy each candidate node and the vocabulary composition of the relative subject, object, and preposition of the action entity to describe multiple groups of condition types and conditional clauses that satisfy the chapter title keywords. Then, the implicit associations of the various action entities in the current contract text are displayed in the order of conditional triggering to improve the logical expression between the various action entities, and use correlation indicators to illustrate the relative importance of each action entity in the entire contract text, to assist in judging the logical association structure of multiple words in the current contract text, and to improve the decomposability and identifiability of the current contract text.
[0013] 3. The present invention uses a part-of-speech relationship graph to represent the relative relationship between each action entity between adjacent words, and constructs a part-of-speech relationship graph with adjacent words to further describe the structural relationship of each action entity in the current contract text, thereby avoiding the invalid collocation of some conditional terms in the contract text; then, the action entities and adjacent words in the part-of-speech relationship graph are comprehensively expressed in the form of semantic expansion with semantic association to adjust the attention between each word, from the structural aspect to the semantic similarity aspect, and after correcting the weight with semantically similar content, some nodes with obvious weight changes are used as payment indicators for subsequent output to comprehensively output the content after semantic correction and logical combination, thereby solving the problem of ignoring semantic similarity under normal combination structure, improving the scene content covered by the obtained payment indicator for the text, and ultimately improving the accuracy of payment indicator extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The present invention will be further described below with reference to the accompanying drawings and examples.
[0015] Figure 1 This is a flowchart of a method for extracting key payment indicators from contract text based on natural language processing.
[0016] Figure 2 2 is a flow chart of step S1 of the method for extracting key payment indicators from contract text based on natural language processing.
[0017] Figure 3 2 is a flow chart of step S2 of the method for extracting key payment indicators from contract text based on natural language processing.
[0018] Figure 4 This is a flow chart of step S3 of the method for extracting key payment indicators from contract text based on natural language processing.
[0019] Figure 5This is a flow chart of step S4 of the method for extracting key payment indicators from contract text based on natural language processing.
[0020] Figure 6 This is a flow chart of step S5 of the method for extracting key payment indicators from contract text based on natural language processing. DETAILED DESCRIPTION
[0021] The following embodiments of the present invention are described in detail. The embodiments described below are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention. Where specific techniques or conditions are not specified in the embodiments, the techniques or conditions described in the literature in the art or in the product specifications shall be followed.
[0022] See Figure 1 ,The method for extracting key payment indicators from contract text based on natural language processing ,includes: S1, dividing the contract text into structured chapters, ,constructing a chapter hierarchy tree, and setting candidate paths containing payment information based on the ,matching relationship between the multi-level path nodes of the chapter hierarchy tree and the ,keywords of the chapter title.
[0023] S2, extract the action entities of each contract text in the candidate path, set the logical relationship tree of the action entity based on the conditional clauses and condition types of the action entity, use the tree structure corresponding to the logical relationship tree to perform logical association analysis on the action entity, and extract the correlation indicators corresponding to the action entity.
[0024] S3, extracts adjacent words based on the relevance index of the action entity, and constructs a part-of-speech relationship graph reflecting the part-of-speech association pattern of the action entity by analyzing the part-of-speech features of the adjacent words and the current action entity.
[0025] S4, iterate the part-of-speech relationship graph with preset association rules, identify the semantic extension matrix of each node in the part-of-speech relationship graph, and modify each node in the part-of-speech relationship graph with the semantic extension matrix.
[0026] S5, perform vector mapping on the part-of-speech relationship graphs before and after the correction, and output the key payment indicators corresponding to the contract text based on the associated differences during mapping.
[0027] Based on the content of the chapter titles, the data contained within each chapter is organized hierarchically, for example, into multiple groups, each representing a level. Group 1 uses the dedicated contract terms as the starting point of its tree structure, with terms such as contract price, measurement, payment, progress payment, and payment cycle as nodes within the tree. These chapter title keywords are combined to form a chapter hierarchy tree. After calculating matching relationships between these keywords, the corresponding indicators for the payment information to be extracted are generated. Regular expressions are also used to clean special characters to remove irrelevant text in the contract text.
[0028] like Figure 2 As shown, the implementation method of step S1 includes: S11, demarcating the chapter boundaries of each chapter title according to the sequence marking mode corresponding to the chapter title of the contract text.
[0029] S12, identifying the path nodes under the boundaries of each chapter, and forming a chapter hierarchy tree with the tree structure of the path nodes.
[0030] The above sequence annotation mode uses regular expressions to extract vocabulary related to chapter titles in the contract text, and then extracts relevant content from the contract text according to the content corresponding to the chapter, section, article, and clause. The content corresponding to the chapter, section, article, and clause in the chapter title is used as the chapter boundary. The chapter title keywords at the chapter boundary are used to divide the corresponding path nodes. Then, according to the order in which the multiple keywords representing the chapter, section, article, and clause appear in the normal contract sequence under the chapter boundary, these path nodes are connected to form a chapter hierarchy tree.
[0031] Then, a bidirectional mapping relationship is established between each path node in the divided chapter hierarchy tree and the chapter title keyword to describe the relative situation of the corresponding vocabulary in the current chapter.
[0032] For example, when forming a chapter hierarchy tree, special contract terms-contract price-project progress payment-payment cycle represents a path, where the node corresponding to each keyword is a path node. There may also be two nodes, measurement and payment, on the path node corresponding to the contract price. At the same time, the hierarchical structure corresponding to this path also has connection relationships such as special contract terms-project progress payment to describe the different data appearing in multiple positions under its chapter hierarchy.
[0033] The extracted path nodes at this time are divided into multiple path nodes after being classified by the multiple types of keywords contained in the sequence annotation pattern. Each path node corresponds to at least one chapter title keyword; the content corresponding to the chapter title keyword can be expressed as shown below.
[0034] For example, payment stage keywords are used as a type of path node, and the texts that correspond to these keywords are logically or textually associated as multiple groups of path nodes corresponding to this path node hierarchy. Payment stage keywords can include text content corresponding to words such as commencement, node, stage, acceptance, completion, completion, and progress; payment cycle keywords, payment base keywords, payment ratio keywords, and payment action keywords are all used as data included in the corresponding path nodes in the chapter hierarchy tree. These data are then organized into a tree structure containing a hierarchical structure to reflect current decisions such as contract text review and indicator extraction. Payment cycle keywords can include words such as monthly, quarterly, cycle, monthly, payment cycle, and payment frequency; payment base keywords can include words such as total contract price, completed output value, cumulative project volume, cumulative payment, and settlement amount; payment ratio keywords can include words such as percentage, ratio, and %; and payment action keywords can include words such as payment, disbursement, prepayment, settlement, deduction, and payment conditions.
[0035] That is, the implementation method of identifying the path nodes under each chapter boundary in step S12 also includes: performing vocabulary matching on the chapter title keywords in the chapter boundary in turn, and pointing to each chapter title keyword and the path node under vocabulary matching, and adding the corresponding chapter title keyword to the path node.
[0036] Determine the node type of each path node, which includes payment stage keywords, payment cycle keywords, payment base keywords, payment ratio keywords, and payment action keywords. Associate the chapter title keywords with the node type of the path node. The node type represented here represents how the chapter title keywords can be divided into multiple keywords.
[0037] Preferably, the path pointing is obtained by comparing the semantics of the chapter title keywords, and placing them in the corresponding path nodes in scenarios with similar and identical semantics, otherwise not placing them; at this time, each word in the chapter title keywords is regarded as a path node according to its corresponding position in the chapter, section, article, and clause, and then the words in the path nodes are merged to obtain the path node currently required.
[0038] That is, the implementation method of step S1 also includes: S13, checking the hierarchical structure of each path node in the chapter hierarchy tree, judging whether the number of chapter title keywords associated with each path node reaches the matching threshold, and extracting candidate paths according to the matching threshold corresponding to the path node.
[0039] The implementation method for determining whether the number of chapter title keywords associated with each path node reaches the matching threshold includes: if the matching threshold is not reached, the current path node is used as the auxiliary node of the corresponding parent node, and the auxiliary node is used to represent that when the corresponding path node is reached, its child nodes have additional node items that can be selected.
[0040] If the matching threshold is reached, the parent node of the current path node is used as the starting point to extract candidate paths that match multi-level path nodes with chapter title keywords.
[0041] The matching threshold is determined based on the number of keywords used for each contract type. The specific threshold is determined by the average number of terms associated with each path node within the contract type. This threshold represents the number of keywords associated with the payment information being viewed within the path node. The auxiliary nodes are used to expand the path representation, improving the scalability of data identified at a specific node and preventing overlooked and unassociated information from being included in the contract.
[0042] At this time, when extracting chapter title keywords related to path nodes, the TF-IDF or TextRank algorithm is used to extract chapter keywords, and the corresponding keywords are marked at the corresponding path nodes based on the semantics related to each word. For example, the payment cycle can be associated with installment payments, one-time payments, etc. After these associated words are extracted from the currently provided contract text, they are associated with the corresponding path nodes; at the same time, the paragraphs and sentences where the corresponding words are located need to be marked to facilitate the later verification of the contextual semantics corresponding to each keyword, as well as the conditional clauses and condition types that each keyword may correspond to; for example, the conditional clause is that if Party B fails to pay on time, it must pay liquidated damages, and the marked condition types are various descriptions such as time conditions and behavioral conditions.
[0043] Preferably, when step S13 determines the number of chapter title keywords associated with each path node, its implementation method also includes: performing context analysis on each chapter title keyword according to the associated content of each path node, obtaining the conditional clauses and conditional types corresponding to each chapter title keyword, and mapping the conditional clauses and conditional types corresponding to the chapter title keywords with the path nodes on the candidate path.
[0044] In one embodiment of the present invention, when extracting the action entities of the candidate paths in step S2, they are mainly annotated according to the condition type and the content corresponding to the conditional clause to illustrate the relevant content corresponding to the chapter title keywords under the current contract text.
[0045] like Figure 3As shown, the implementation method of step S2 includes: S21, according to the node type of each path node in the candidate path, extracting the conditional clauses and conditional types under multiple node types, performing keyword extraction on the conditional clauses, obtaining conditional keywords, and using the conditional keywords as the action entities of each contract text.
[0046] S22, using the condition type corresponding to each action entity, checking the logical relationship of each action entity, forming a logical relationship tree of each action entity; checking the number of associations of the action entity under the logical relationship tree, and extracting each action entity based on the number of associations, and extracting the correlation index corresponding to the action entity.
[0047] As shown in Table 1, the condition types described are shown in the following table.
[0048] Table 1. Condition type diagram
[0049]
[0050] Table 1 illustrates how to set the condition type and the formats that can be represented by multiple condition types. According to the corresponding format, the condition keywords under the corresponding condition type can be found. Then, according to the position and context corresponding to each condition keyword under the condition type, the logical relationship between these condition keywords in the condition clauses can be found, and the associations between these condition clauses are marked to indicate whether there is an association between the currently identified action entities, and different association situations are marked separately to illustrate the importance of the extracted text indicators in the contract text. Table 1 shows that the feature values are only for display. When actually extracting the action entity, other methods and other types of content will be selected to represent the obtained action entity.
[0051] Preferably, the above-mentioned conditional clause represents the sentence where the chapter title keyword on the path node is located, which is used to describe whether the corresponding condition exists for the corresponding keyword; then the conditional keyword is extracted according to the characteristic value corresponding to the condition type, and after obtaining the conditional keyword, it is checked whether there is a logical association between these words to identify the logical units and the number of associations, and finally complete the text indicators that need to be obtained at present.
[0052] At this time, conditional keyword extraction is performed by combining dynamic generation with syntactic verification using regular expressions. First, dynamic generation using regular expressions extracts the subject, object, and preposition present in the corresponding scenario by predefined common expression patterns to modify the keywords under each conditional clause and the corresponding conditional type annotation. For example, (pay to)([^of]+ of)?(\d{1,3}%|百分之\d{1,3}), which can match sentences of the type "pay to Y% of X". Then, syntactic verification uses different subjects, objects, and prepositions to obtain the conditional keywords that can be associated with the keywords of the current chapter title used, representing the status description of relevant indicators such as payment in the contract. After that, it is used as the main recognized action entity to represent various associated situations regarding the payment status in the current contract text under the implementation of payment-related actions, and the content involving abstract descriptions such as status, relationship, right attribution, and liability assumption method forms a relational network of its corresponding structure.
[0053] The implementation method for keyword extraction of conditional clauses in step S21 also includes: S211, performing semantic role annotation on the conditional clauses under each conditional type to obtain the core subject corresponding to the subject, the core object corresponding to the object, and the prepositional phrase components; the core subject and core object include the components of their subjects and objects, such as the core subject Party A and the core object liability for breach of contract in the form of description. Then, identify the content represented by the prepositional phrase in the conditional clause and extract relevant content, such as descriptions in the form of "to...", "based on...", "according to...", etc.
[0054] S212, extract the corresponding prepositional headword in the prepositional phrase component, and after establishing a dependency association between the prepositional headword, the core subject, and the core object, form a subject-object-preposition triple as the output conditional keyword.
[0055] When establishing a dependency association, identify the conditional clause from which the extracted prepositional headword, core subject, and core object are derived, and check whether there are additional nested conditions and additional descriptive information in the corresponding conditional clause. After supplementing the descriptive information to the corresponding words of the prepositional headword, core subject, and core object, use them as the output conditional keywords.
[0056] Preferably, the prepositional headword represents a word directly related to the current core subject and core object.
[0057] As for its logical relationship tree, it uses its logical change mechanism to illustrate the logical associations existing between current action entities to achieve differential storage.
[0058] Specifically, the implementation method for forming the logical relationship tree for each action entity in step S22 includes: S221, performing a logical relationship analysis on each action entity to identify the triggering sequence and connectives for each action entity. For example, the temporal content represented by the requirement to pay within 30 days after the contract takes effect can represent the corresponding triggering sequence of multiple action entities. The connectives indicate how the extracted prepositional core word and its related words are associated with the current multiple action entities.
[0059] S222, according to the conditional triggering sequence and connectives of each action entity, respectively identify the main obligation node, condition constraint node and exception clause node corresponding to each action entity; take the first triggered action entity as the root node, and take the main obligation node, condition constraint node and exception clause node in the action entity as the child nodes of the root node to form a logical relationship tree corresponding to the action entity.
[0060] S223, respectively counting the number of parent and child nodes corresponding to the action entity in the logical relationship tree as the association number of the action entity.
[0061] The above-mentioned main obligation nodes represent content such as payment / delivery / acceptance, the condition constraint nodes represent words such as time / quality / breach of contract, and the exception clause nodes represent content such as force majeure / dispute resolution. After dividing the condition keywords according to their semantics and other different forms, we can identify the data that the action entity can associate with in the logical relationship tree.
[0062] S224: Set a correlation index corresponding to the action entity based on the number of nodes associated with the action entity and the importance of the nodes.
[0063] At this time, the main obligation nodes, conditional constraint nodes, and exception clause nodes associated with the action entity are marked with the number of nodes associated with the current action entity. Then, a weight value is set for each of the three nodes. The weight value is regarded as the importance of the node. For example, the ratio of the number of main obligation nodes associated with the current action entity to the number of all main obligation nodes in the logical relationship tree is used as the weight value of the main obligation node. Then, the weights of the conditional constraint nodes and exception clause nodes are set in the same way as the main obligation nodes. Then, their number is multiplied by the weight, and the sum of the weights of these three nodes is used as the relevance index of its action entity.
[0064] In one embodiment of the present invention, Figure 4As shown, the implementation method of step S3 includes: S31, using the correlation index to query the adjacent window of each action entity to divide the adjacent words, the adjacent window represents how many words are extracted before and after the current action entity, at this time, according to the number of associations corresponding to the correlation index and the value of the correlation index, the database is queried to determine how many words should be extracted before and after the current action entity as the adjacent words at this time, and at the same time, the adjacent words of the current action entity are set according to the context order of the current action entity.
[0065] S32, extract the adjacent words under the adjacent window, and divide them into direct adjacent words directly related to the current action entity and indirect adjacent words indirectly related to the current action entity according to the part of speech of the adjacent words. At this time, by identifying the part of speech of the adjacent words, the content directly related to the current action entity and the content indirectly related to the current action entity are found. If the adjacent words are not related to the current action entity, the corresponding vocabulary is filtered. Here, regular expressions or semantic annotation of the adjacent words can be used to find out whether the corresponding adjacent words are associated with the current action entity.
[0066] S33, counts the collocation frequencies of indirect adjacent words and direct adjacent words with action entities, and sets semantic vectors according to the relative positions of all indirect adjacent words and direct adjacent words, and constructs a part-of-speech relationship graph with the semantic vectors of indirect adjacent words, direct adjacent words and action entities.
[0067] Each node in the part-of-speech relationship graph represents at least a semantic vector of any one of the indirect adjacent words, direct adjacent words and action entities. The basic weight is set according to the collocation frequency of the indirect adjacent words and direct adjacent words with the action entity. The distance value between the indirect adjacent words and direct adjacent words and the action entity calculated through the semantic vector is used as its distance weight. It is judged whether the indirect adjacent words and direct adjacent words are located in the logical relationship tree. If they exist, the logical weight is given, otherwise not. The comprehensive value of the basic weight, distance weight and logical weight is used as the weight of the corresponding edge in its part-of-speech relationship graph.
[0068] The basic weight described above is set according to the ratio of its collocation frequency to historical data. The distance weight is obtained by calculating the distance using a vector. The logical weight is set according to the number of associations corresponding to the adjacent word in the logical relationship tree, such as multiplying the number of associations by 0.2. If the adjacent word is not in the logical relationship tree, no setting is required. The basic weight, distance weight, and logical weight are then normalized and added together to obtain the weight corresponding to each node in the part-of-speech relationship graph. This weight represents the connection between the action entity and the adjacent word. As for the connection between adjacent words, the weight is set by directly identifying their collocation frequency. For example, the point mutual information method is used to calculate the probability of two adjacent words appearing simultaneously in a contract text divided by the probability of the two words appearing alone in the contract text. The corresponding logarithmic function value is taken as the weight between the adjacent words, or the collocation frequency combined with the inverse document frequency is used as the weight between the adjacent words. In this case, the maximum of these two values is selected as the weight set between the adjacent words to complete the construction of the part-of-speech relationship graph. The weights between adjacent words are also normalized to prevent values that are too small or too large.
[0069] At the same time, if the same action entity appears in multiple paragraphs of the contract text, the node corresponding to the action entity will be connected to all its related adjacent words to illustrate the corresponding relationship between the meanings of various words in the current contract text.
[0070] The weights set at this time tend to describe the overall relative logical relationship, the form of adjacent combinations between texts, and describe the existence of adjacent words, action entities, and whether they can be associated with corresponding action entities in the logical relationship tree, to display the logic and structure content in the current contract text, so as to facilitate subsequent verification of whether the current contract text conforms to the normal logical form and whether there are any contract-related text problems. At the same time, the weight of the comprehensive form set will be set to the range of 0 to 1 after setting, so as to facilitate comparison of the changes in the weights of each node in the part-of-speech relationship graph after combining semantics.
[0071] In one embodiment of the present invention, Figure 5 As shown, the implementation of step S4 includes: S41, performing a text query on any node in the part-of-speech relationship graph using a preset association rule to obtain at least one text aggregation result, which represents the adjacent words and action entities associated with the current word when searching through the words contained in the part-of-speech relationship graph. When performing a text query on multiple nodes in the part-of-speech relationship graph, the text aggregation structure starts from any node, obtains the shortest path between the words most relevant to the current preset association rule search, and combines these words into a text aggregation result.
[0072] That is, based on preset association rules, a graph traversal algorithm retrieves the most relevant words for the current node and extracts the shortest paths between these words. These words are then combined in semantic order to create a text-aggregated paragraph. This approach, after obtaining relevant action entities from the logical relationship tree, extracts text content that is strongly associated with multiple words in a logical combination and order of association from the relationship graph of adjacent word parts, facilitating subsequent verification of issues and related logical statement combinations within the contract text. The preset association rules are used to describe the sentence format of the corresponding word combinations in the contract text. The corresponding sections are pre-set in the database to verify content such as payment indicators.
[0073] S42, for the nodes in the text aggregation result, generate a multidimensional semantic representation for each node to form a semantic extension matrix; use the semantic extension matrix to perform multidimensional similarity fusion processing on each node in the text aggregation result in turn, and use the processed similarity as the weight between each node in the text aggregation result.
[0074] S43, mapping the weight of each node in the text aggregation result to the part-of-speech relationship graph, and adjusting the weight of each node in the part-of-speech relationship graph.
[0075] At this time, the nodes in the text aggregation results will be semantically expanded to obtain multiple semantics in the context of payment, etc. If the corresponding semantics of two words are unique, the corresponding weights will not be aligned and modified; at the same time, each node in the text aggregation results will have a corresponding relationship with the node of the part-of-speech relationship graph to correct the weights between multiple groups of nodes.
[0076] As for the multi-dimensional similarity fusion processing, the similarity between the extended multi-dimensional semantics and the multi-dimensional semantics of the corresponding nodes is calculated, and then the semantics that meet the context corresponding to the payment indicators of the contract text are selected, and the average similarity is taken as the weight between the text aggregation results at this time. The similarity will be calculated in the form of cosine similarity to complete the setting of its weight; according to these modified weights, they are synchronized to the weights between the corresponding nodes in the part-of-speech relationship graph.
[0077] The weights modified at this time are intended to emphasize the association between semantics and the credibility of each semantic combination in the contract text. The weights initially set in the part-of-speech relationship map tend to emphasize high-frequency and co-occurring related words, reflecting the specific content of statistical and structural associations in the contract text; after adjusting the semantic constraints and similarity of the shortest path for text aggregation of these words, the semantic connections of the connected multiple words can be made smoother, reflecting the semantic chain of the contract text that tends to be true description; then, these two methods of processing semantic and structural combinations can identify invalid aggregation content and semantic deviation content in the current contract text, facilitate subsequent review of the corresponding contract text, and find relatively effective payment indicators.
[0078] In one embodiment of the present invention, Figure 6 As shown, the implementation method of step S5 includes: S51, identifying semantic offset points based on the weights of each node in the part-of-speech relationship graph before and after correction, and constructing a difference subgraph based on the edges associated with the semantic offset points in the part-of-speech relationship graph; the semantic offset point indicates that the weights of each node in the part-of-speech relationship graph before and after correction are significantly different, for example, the points where the weight value drops and rises by more than a threshold are used as the semantic offset points, and the threshold can be set according to the average value of the corresponding processing in the historical data, or the part where the current weight change value exceeds 50% of the original weight is selected as the semantic offset point that appears at this time. The difference subgraph then extracts the connection of some nodes connected to the semantic offset point.
[0079] S52: Define a payment indicator pattern using a regular expression. The payment indicator pattern uses a regular expression to match key information such as amount, time, and conditions. The payment indicator pattern is combined with the node positions of the difference subgraph to extract matching indicators from the contract text. The matching indicators are output as key payment indicators. The output key payment indicators are output in a structured format. The position of the text associated with the semantic offset point in the original contract text is combined with the payment indicator to extract multiple groups of text words necessary to express the payment model of the current contract text.
[0080] The associated differences described above represent the difference subgraphs corresponding to the semantic offset points in the current solution. These parts represent the parts that have differences after correction. This part can reflect the semantic changes in the current payment indicator-related content and assist in subsequent legal decision-making.
[0081] Finally, the extraction of relevant content of the contract text regarding payment indicators, such as payment amount, payment time, payment terms, invoice terms and other relevant terms, is completed, and displayed in the form of identified paths. These formed paths are output to the database to facilitate quick targeted queries on certain parts of the contract. At the same time, the semantics of the contract text contained in the path, the related content of similar texts and the data table mapping relationship are used to analyze and process the originally stored data to timely generate a rule database related to payment and the data entities corresponding to the corresponding knowledge graph; ultimately, not only can the verification and processing of the contract books be realized, but it will also facilitate the subsequent generation of corresponding decision-making information for the content of the contract requirements, and facilitate subsequent staff to review the relevant content, thereby improving the accuracy and efficiency of contract review.
[0082] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention, which are still covered by the scope of protection of the present invention.
Claims
1. A method for extracting key payment indicators from contract texts based on natural language processing, characterized in that: include: S1, divide the contract text into structured chapters, build a chapter hierarchy tree, and set candidate paths containing payment information based on the matching relationship between the multi-level path nodes of the chapter hierarchy tree and the chapter title keywords; S2: Extract the action entities of each contract text in the candidate path, set the logical relationship tree of the action entity based on the conditional clauses and condition types of the action entity, and use the tree structure corresponding to the logical relationship tree to perform logical association analysis on the action entity and extract the correlation index corresponding to the action entity; S3, extracts adjacent words based on the relevance index of the action entity, and constructs a part-of-speech relationship graph reflecting the part-of-speech association pattern of the action entity by analyzing the part-of-speech features of the adjacent words and the current action entity; S4, iterating the part-of-speech relationship graph using a preset association rule, identifying a semantic extension matrix for each node in the part-of-speech relationship graph, and modifying each node in the part-of-speech relationship graph using the semantic extension matrix; S5, perform vector mapping on the part-of-speech relationship graphs before and after the correction, and output the key payment indicators corresponding to the contract text based on the associated differences during mapping.
2. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1 is characterized in that: The implementation of step S1 includes: S11, demarcating the chapter boundaries of each chapter title according to the sequence marking pattern corresponding to the chapter title of the contract text; S12, identifying the path nodes under the boundaries of each chapter, and forming a chapter hierarchy tree with the tree structure of the path nodes; S13, checking the hierarchical structure of each path node in the chapter hierarchy tree, determining whether the number of chapter title keywords associated with each path node reaches a matching threshold, and extracting candidate paths according to the matching threshold corresponding to the path node.
3. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 2 is characterized in that: The implementation of step S12 further includes: Perform vocabulary matching on the chapter title keywords in the chapter boundaries in sequence, and add the corresponding chapter title keywords to the path nodes based on the vocabulary matching. Determine the node type of each path node, where the node type includes payment stage keywords, payment cycle keywords, payment base keywords, payment ratio keywords, and payment action keywords, and associate the chapter title keywords with the node type of the path node.
4. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1 is characterized in that: The implementation of step S13 further includes: According to the associated content of each path node, context analysis is performed on each chapter title keyword to obtain the conditional clauses and condition types corresponding to each chapter title keyword, and the conditional clauses and condition types corresponding to the chapter title keywords are mapped to the path nodes on the candidate path.
5. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1 is characterized in that: The implementation of step S2 includes: S21, based on the node type of each path node in the candidate path, extracting conditional clauses and condition types under multiple node types, performing keyword extraction on the conditional clauses to obtain conditional keywords, and using the conditional keywords as action entities in each contract text; S22, using the condition type corresponding to each action entity, checking the logical relationship of each action entity, forming a logical relationship tree of each action entity; checking the number of associations of the action entity under the logical relationship tree, and extracting each action entity based on the number of associations, and extracting the correlation index corresponding to the action entity.
6. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 5 is characterized in that: The implementation of step S21 further includes: S211, performing semantic role labeling on the conditional clauses under each conditional type to obtain the core subject corresponding to the subject, the core object corresponding to the object, and the prepositional phrase components; S212, extracting the corresponding prepositional core word from the prepositional phrase component, and after dependency association between the prepositional core word and the core subject and the core object, forming a subject-object-preposition triple as the output conditional keyword.
7. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 5 is characterized in that: The implementation of step S22 includes: S221, performing a logical relationship analysis on each action entity to identify the conditional triggering sequence and connectives of each action entity; S222: Based on the conditional triggering sequence and connectives of each action entity, the main obligation node, conditional constraint node, and exception clause node corresponding to each action entity are identified. The first triggered action entity is used as the root node, and the main obligation node, conditional constraint node, and exception clause node in the action entity are used as child nodes of the root node to form a logical relationship tree corresponding to the action entity. S223, respectively counting the number of parent and child nodes corresponding to the action entity in the logical relationship tree as the association number of the action entity; S224: Setting a correlation index corresponding to the action entity based on the number of nodes associated with the action entity and the importance of the nodes.
8. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1 is characterized in that: The implementation of step S3 includes: S31, querying the adjacent window of each action entity to divide the adjacent words using the relevance index; S32, extracting adjacent words under the adjacent window, and classifying the adjacent words into direct adjacent words directly related to the current action entity and indirect adjacent words indirectly related to the current action entity according to their parts of speech; S33, counts the collocation frequencies of indirect adjacent words and direct adjacent words with action entities, and sets semantic vectors according to the relative positions of all indirect adjacent words and direct adjacent words, and constructs a part-of-speech relationship graph with the semantic vectors of indirect adjacent words, direct adjacent words and action entities.
9. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1 is characterized in that: The implementation of step S4 includes: S41, performing a text query on any node in the part-of-speech relationship graph using a preset association rule to obtain at least one text aggregation result; S42, for each node in the text aggregation result, generating a multidimensional semantic representation for each node to form a semantic extension matrix; using the semantic extension matrix to sequentially perform multidimensional similarity fusion processing on each node in the text aggregation result, and using the processed similarity as the weight between each node in the text aggregation result; S43, mapping the weight of each node in the text aggregation result to the part-of-speech relationship graph, and adjusting the weight of each node in the part-of-speech relationship graph.
10. The method for extracting key payment indicators from contract texts based on natural language processing according to claim 1, characterized in that: The implementation of step S5 includes: S51, identifying semantic offset points using the weights of each node in the part-of-speech relationship graph before and after correction, and constructing a difference subgraph using the edges associated with the semantic offset points in the part-of-speech relationship graph; S52, using a regular expression to define a payment indicator pattern, combining the payment indicator pattern with the node position of the difference subgraph, extracting matching indicators from the contract text, and outputting the matching indicators as key payment indicators.
Citation Information
Patent Citations
Knowledge graph construction method and device, equipment and medium
CN110543574A
Webpage content security processing method based on knowledge graph
CN119670070A
Contract relation graph construction method and electronic equipment
CN120067292A
File digital storage management method
CN120124594A
Enterprise global data analysis method based on knowledge graph and large language model
CN120218256A
Cited By
Intelligent positioning method and positioning equipment for contract key fields
CN121365090A
Intelligent positioning method and positioning device for contract key fields
CN121365090B
Data processing method and product
CN121636719A