A method for automatically generating standard clauses based on knowledge graphs and rule-based reasoning
By constructing a standard knowledge graph and combining it with business scenario attributes, standard clauses are automatically parsed and generated, solving the problems of low efficiency and insufficient accuracy in existing technologies, and achieving efficient and accurate standard clause generation.
Patent Information
- Application Number
- CN202611249554.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies rely on manual matching of literal meanings to parse standard clauses, failing to fully utilize clause structure and semantic relationships. This results in low efficiency and insufficient accuracy, making it difficult to identify implicit relationships across clauses and generate a set of standard clauses that match the target business scenario.
Based on knowledge graphs and rule-based reasoning, a standard knowledge graph is generated by constructing the structural hierarchy and semantic association of clause nodes and elements. Then, it is activated and pruned in combination with business scenario attributes to automatically parse and generate a set of target standard clauses.
It improves the accuracy and efficiency of standard clause generation, reduces the workload of manual breakdown and screening, and can identify clauses that have structural dependencies or semantic connections with scenario conditions but do not directly contain scenario keywords, thus improving recall completeness and screening accuracy.
Smart Images

Figure CN123115378A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent processing technology for standard clauses, specifically a method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning. Background Technology
[0002] In engineering implementation and business compliance, the applicable content of clauses in standard documents needs to be selected based on specific business scenarios. Currently, the automated parsing and screening of standard clauses mainly adopts a combination of keyword matching, rule templates, and manual reading. The manual reading method is inefficient when processing a large number of standard documents, and the parsing results rely on human experience and are difficult to reuse; the keyword matching method uses literal text overlap as the basis for judgment, which makes it difficult to identify the conditions, restrictions, and execution actions expressed through complex syntax in standard clauses, and cannot form structured clause elements; the rule template method requires writing and maintaining a large number of extraction rules for different standards, with limited coverage and weak adaptability to differences in clause expression and semantic relationships across clauses.
[0003] In the process of generating clauses for target business scenarios, existing methods typically directly match scenario attributes with clause text or keywords, failing to utilize the hierarchical relationships between clause nodes and the semantic similarity between clause elements. This makes it difficult to identify clauses that are indirectly related to the current scenario and require reasoning along hierarchical or semantic paths. Furthermore, simple literal overlap introduces many irrelevant clauses, resulting in redundant filtering results. Therefore, it is necessary to automatically parse the conditional and action elements within the clauses of standard documents, and based on the structural hierarchical relationships and semantic connections of elements in the standard clauses, perform association expansion and pruning according to scenario attributes to obtain a set of standard clauses that match the target business scenario. Summary of the Invention
[0004] To address the shortcomings of existing technologies where standard clause parsing relies on manual and literal matching, and scenario clause selection fails to fully utilize clause structure and semantic relationships, the present invention aims to provide an automated standard clause parsing and generation method based on knowledge graphs and rule-based reasoning. This method automatically identifies internal conditional and action elements of clauses and constructs a standard knowledge graph containing structural subordination relationships and semantic relationships between elements. Based on scenario attributes, the method performs activation, association expansion, and comprehensive activation degree pruning in the standard knowledge graph to generate a set of standard clauses adapted to the target business scenario.
[0005] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides an automated parsing and generation method for standard clauses based on knowledge graphs and rule-based reasoning, comprising: acquiring a target standard document to be parsed; extracting the hierarchical numbers and clause texts from the target standard document; constructing clause nodes and establishing structural subordinate relationships between clauses based on the hierarchical numbers; identifying condition element objects and action element objects in the clause nodes based on the dependency syntax paths in the clause texts, and generating element sets for each clause node; constructing a standard knowledge graph based on the element sets and the structural subordinate relationships, wherein the standard knowledge graph uses clause nodes as entities and structural subordinate relationships and element semantic associations as edges; acquiring scene attribute values of a target business scenario, and matching the scene attribute values with clause nodes in the standard knowledge graph, and designating successfully matched clause nodes as active nodes; forming a candidate subgraph by combining the active nodes and their associated nodes within a predetermined number of hops in the standard knowledge graph, and calculating the comprehensive activation degree of each clause node in the candidate subgraph; and pruning the candidate subgraph based on the comprehensive activation degree to generate a target standard clause set. This method automatically parses the hierarchical structure and semantic elements of standard documents, and activates and prunes them in the knowledge graph in conjunction with business scenarios. This can effectively reduce the workload of manual decomposition and clause screening, and improve the accuracy of standard clause generation.
[0006] Preferably, when constructing the structural hierarchy, the text stream of the target standard document is segmented using chapter title identifiers and line breaks as boundaries to obtain several initial paragraphs, and the number string at the beginning of each initial paragraph is identified; based on the delimiter type and numeric level depth in the number string, the number string is parsed into a level path array, and the level path array is used as the level identifier of the corresponding initial paragraph; the initial paragraph carrying the level identifier is determined as a clause node, and the level identifier is used as the node depth value of that clause node; all clause nodes are traversed, and clause nodes whose node depth value is 1 less than the node depth value of the current clause node and whose number prefix matches the prefix of the level path array of the current clause node are determined as the parent node of the current clause node, thus establishing the structural hierarchy. This allows for a relatively complete recovery of the hierarchical relationship between standard clauses without relying on additional annotation information, providing a structural foundation for subsequent associative reasoning.
[0007] Preferably, when generating the element set for each clause node, the clause text of the clause node is segmented and tagged with parts of speech to obtain a part-of-speech tagging sequence. The predicate headword in the clause text is located based on the verb part-of-speech tags in the tagging sequence. Starting from the predicate headword, the dependency syntax tree of the clause text is traversed along dependency relation edges to obtain the subject conjunction and object conjunction of the predicate headword, and these are used as action element objects. Conditional adverbial modification nodes that modify the predicate headword are identified in the dependency syntax tree, and the phrase text covered by these nodes is obtained as condition element objects. The action element objects and condition element objects are combined into a key-value pair structure, and this key-value pair structure is stored as the element set of the clause node. Element extraction through dependency syntax paths allows for the extraction of relatively consistent action and condition objects from standard clauses with different expressions, improving the consistency of subsequent matching.
[0008] Furthermore, when constructing the standard knowledge graph, each clause node is treated as an entity, and the hierarchical identifier and element set of the clause node are used as the attribute values of the entity. The structural subordination relationship is used as a first type of edge, and the direction of the first type of edge is set from the parent node to the child node. The action element objects in the element sets of each entity are mapped to standard action categories in a preset action category library, and the condition element objects in the element sets of each entity are mapped to standard condition categories in a preset condition category library. As an optional mapping method, the cosine similarity between the word vector of the action element object and the word vector of each standard action category label in the preset action category library is calculated, and the standard action category with the largest cosine similarity is used as the mapping result of the action element object. The action semantic similarity between the standard action categories of any two entities and the condition semantic similarity between the standard condition categories of the two entities are calculated. When the action semantic similarity is greater than a first threshold and the condition semantic similarity is greater than a second threshold, a second type of edge is established between the two entities. The entity relationship network containing the first type of edge and the second type of edge is used as the standard knowledge graph. This knowledge graph simultaneously expresses the hierarchical structure and semantic relationships of clauses, enabling cross-clause condition and action relationship reasoning and improving the ability to discover implicitly related clauses during clause generation.
[0009] Preferably, when obtaining the scenario attribute values of the target business scenario, the scenario attribute values include scenario action tags and scenario condition tags. The scenario action tags are matched with the standard action categories of each entity in the standard knowledge graph, and the entities that successfully match the scenario action tags are selected as a candidate entity set. In the candidate entity set, the scenario condition tags are matched with the standard condition categories of the entity. When a match is successful, the entity is marked as an active node, and the matching condition category of the active node is recorded. By matching the action tags and condition tags sequentially, the candidate range can be narrowed and the clause nodes directly related to the business scenario can be accurately located. When the scenario condition tag is a range-type condition, it is determined whether the standard condition category of the entity falls within the numerical range indicated by the scenario condition tag. If so, the match is successful, thereby improving the matching reliability of range-type scenario conditions.
[0010] Preferably, when calculating the overall activation degree, starting from the activated node, a bidirectional traversal is performed along the first type of edge and the second type of edge in the standard knowledge graph to obtain all associated nodes whose path length to the activated node is less than or equal to a predetermined hop count threshold; the activated node, all associated nodes, and the edges between the activated node and all associated nodes are used to form a candidate subgraph; the node depth value of each clause node in the candidate subgraph, as well as the out-degree and in-degree values of each clause node in the candidate subgraph, are obtained; the structural importance coefficient of the clause node is calculated based on the node depth value, the out-degree value, and the in-degree value, wherein the structural importance coefficient can be determined by the quotient of the sum of the out-degree value and the in-degree value plus one of the node depth value; the number of elements in the element set of each clause node that match the scene attribute value is obtained; the element matching coefficient of the clause node is calculated based on the ratio of the number of elements to the total number of elements in the element set; the product of the structural importance coefficient and the element matching coefficient is used as the overall activation degree of the clause node. By combining the structural importance coefficient and the element matching coefficient, it is possible to highlight the clause content that directly matches the scene conditions while preserving the influence of the map context.
[0011] Furthermore, when pruning the candidate subgraph, the overall activation degree of the active nodes in the candidate subgraph is used as the baseline activation degree. The overall activation degree of other nodes in the candidate subgraph, excluding the active nodes, is compared with the baseline activation degree. If the overall activation degree of other nodes is less than the product of the baseline activation degree and a preset proportional coefficient, then the other node is marked as a node to be pruned. All nodes to be pruned and all edges connected to the nodes to be pruned in the candidate subgraph are removed to obtain the pruned subgraph. All clause nodes in the pruned subgraph are sorted from largest to smallest according to their node depth value, and the top K clause nodes are selected as target standard clause nodes. A target standard clause set is generated based on the target standard clause nodes. Through the above pruning and sorting operations, nodes in the graph that are weakly related to the target scenario can be suppressed, and a set of standard clauses that matches the business scenario and is at an appropriate level can be output, improving the efficiency and accuracy of automated parsing and generation of standard clauses.
[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: In the clause element parsing and knowledge graph construction based on dependency syntax paths, starting from the predicate head in the clause text, the system traverses the subject conjunction, object conjunction, and conditional adverbial modification nodes along the dependency syntax tree. Action element objects and condition element objects are stored in the clause nodes as key-value pairs, and mapped to standard action categories and standard condition categories, respectively. Between clause nodes, in addition to establishing structural subordinate edges from parent nodes to child nodes based on hierarchical numbers, the similarity of standard action categories and standard condition categories between any two entities is calculated. Semantic association edges are established for entities that meet threshold conditions. This approach makes the implicit conditional constraints and execution actions in the clause text explicit and structured, avoiding element truncation and semantic confusion caused by unclear syntactic positions during keyword extraction. Simultaneously, the standard knowledge graph not only preserves the hierarchical relationships between clauses but also supplements semantic associations across chapters and clauses, enabling subsequent scene matching to expand using non-explicit semantic connections between clauses and reducing information omissions caused by relying solely on hierarchical structures or literal matching.
[0013] In clause generation based on scene attribute matching and comprehensive activation pruning, scene action tags and scene condition tags are obtained. First, they are matched with the entity's standard action category and standard condition category to obtain activated nodes. Then, starting from the activated nodes, a bidirectional traversal is performed along the first and second type of edges, forming a candidate subgraph within a predetermined number of hops. For each clause node in the candidate subgraph, a structural importance coefficient is calculated based on the node depth, out-degree, and in-degree values. An element matching coefficient is calculated based on the ratio of the number of elements matching the scene attributes to the total number of elements in the element set. The product of these two coefficients is the comprehensive activation. Pruning is performed based on the comprehensive activation, and target clauses are selected from largest to smallest node depth. This method extends scene adaptation from single-node literal matching to multi-hop association reasoning in a knowledge graph. It can identify clauses that have structural dependencies or semantic connections with scene conditions but do not directly contain scene keywords, improving recall completeness. The comprehensive activation considers both the graph structural importance of nodes and the element matching degree, pruning the candidate subgraph to reduce scene-irrelevant nodes and redundant clauses entering the final set, improving screening accuracy. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0015] Figure 1 This is a flowchart of a standard clause automated parsing and generation method based on knowledge graphs and rule-based reasoning; Figure 2 This is a flowchart of the standard clause element extraction process; Figure 3 It is a standard clause matching flowchart based on knowledge graphs; Figure 4 This is a diagram showing the distribution of clause node depth, action element objects, and condition element objects in terms of quantity. Figure 5 This is a comparison chart of the degree values of entity nodes in a standard knowledge graph with the first type of edge degree values; Figure 6 This is a condition type distribution diagram showing the number of candidate entities and the number of activated nodes; Figure 7 It is a distribution diagram of the structural importance coefficients and feature matching coefficients of activated nodes and associated nodes; Figure 8 This is a schematic diagram of the overall activation ranking and pruning of clause nodes in the candidate subgraph. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 some embodiments of the present invention, not all 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.
[0017] See Figure 1 This invention provides an automated method for parsing and generating standard clauses based on knowledge graphs and rule-based reasoning. The method involves: acquiring the target standard document to be parsed; extracting the hierarchical numbers and clause text from the target standard document; constructing clause nodes and establishing structural hierarchical relationships between clauses based on the hierarchical numbers; identifying condition element objects and action element objects in the clause nodes based on the dependency syntax paths in the clause text; generating element sets for each clause node based on the element sets and structural hierarchical relationships; constructing a standard knowledge graph based on the element sets and structural hierarchical relationships, with clause nodes as entities and structural hierarchical relationships and semantic associations of elements as edges; acquiring the scenario attribute values of the target business scenario and matching them with clause nodes in the standard knowledge graph, designating successfully matched clause nodes as active nodes; forming candidate subgraphs by combining active nodes and their associated nodes within a predetermined number of hops in the standard knowledge graph, and calculating the comprehensive activation degree of each clause node in the candidate subgraphs; and pruning the candidate subgraphs based on the comprehensive activation degree to generate a set of target standard clauses.
[0018] In specific implementation, please refer to Figure 2 The process involves obtaining the target standard document to be parsed, which is an electronic text containing standard clauses. The text stream of the target standard document is segmented using chapter headings and line breaks as boundaries, resulting in several initial paragraphs. The starting position of each initial paragraph is then identified using a numbered string. Chapter headings include identifiers used to indicate the start of a chapter in the standard document, and line breaks include carriage returns and newlines. When segmenting the text stream, the text is divided at the locations of chapter headings and line breaks, ensuring that each initial paragraph contains complete clause candidate text. When identifying the numbered strings, consecutive numeric characters and delimiters are read from the beginning of each initial paragraph until a non-numeric character and a non-delimiter character are encountered. This consecutive character sequence is used as the numbered string. Delimiters include periods, hyphens, forward slashes, and spaces.
[0019] Based on the delimiter type and numeric level depth in the numbered string, the numbered string is parsed into a hierarchical path array, which is then used as the level identifier for the corresponding initial paragraph. During parsing, delimiter characters in the numbered string are uniformly identified as hierarchical delimiters. The numbered string is divided into multiple numeric segments according to the hierarchical delimiters, each segment is converted into an integer, and these integers are stored sequentially in the hierarchical path array. The length of the hierarchical path array serves as the node depth value for the clause node. The initial paragraph carrying the hierarchical identifier is then identified as the clause node.
[0020] Iterate through all clause nodes. Clause nodes whose depth value is one less than the current clause node's depth value and whose prefix matches the prefix of the current clause node's hierarchical path array are identified as the parent nodes of the current clause node, thus establishing a structural dependency relationship. Prefix matching means that the hierarchical path array of the candidate parent node is exactly the same as the hierarchical path array of the current clause node after removing the last level number. While iterating through all clause nodes, for each clause node, search for a set of candidate parent nodes whose depth value is equal to the current clause node's depth value minus one. Then, search for clause nodes whose hierarchical path array matches the prefix of the current clause node's hierarchical path array. These found clause nodes are designated as the parent nodes of the current clause node, establishing a structural dependency relationship between the parent and the current clause node.
[0021] In practice, the clause text of the clause nodes is segmented and tagged with parts of speech to obtain a part-of-speech tagging sequence. The segmentation and tagging employ a conditional random field (CRF)-based sequence labeling model. The CRF sequence labeling model consists of a feature function module, a state transition matrix module, and a Viterbi decoding module. The input to the CRF sequence labeling model is the character sequence of the clause text, and the output is the part-of-speech tag corresponding to each character. The feature function module extracts character unary grammar features, character bigary grammar features, character type features, and dictionary matching features. The state transition matrix module stores the transition scores between adjacent part-of-speech tags. The Viterbi decoding module calculates the optimal part-of-speech tagging sequence based on the outputs of the feature function module and the state transition matrix module. During training, the CRF sequence labeling model uses the clause text and part-of-speech tagging sequence from the labeled corpus. Maximum likelihood estimation is used to estimate the feature function weights and state transition matrix parameters. The training iterations are set to 100, and the learning rate is set to 0.01. The training iterations were set to 100 because the part-of-speech tagging accuracy on the validation set stopped improving after the 100th iteration. The learning rate was set to 0.01 because a grid search was used to select the value that maximized the log-likelihood of the validation set from 0.1, 0.01, and 0.001.
[0022] After obtaining the part-of-speech tagging sequence, the predicate headword in the clause text is located based on the verb part-of-speech tags in the tagging sequence. To locate the predicate headword, the word corresponding to the first verb part-of-speech tag in the tagging sequence is searched, and this word is taken as the predicate headword. Verb part-of-speech tags include the symbols “VV”, “VE”, and “VC” representing verbs.
[0023] Starting with the predicate headword, the dependency parsing algorithm traverses the dependency relation edges in the clause text's dependency parsing tree to obtain the subject and object conjunctions of the predicate headword, and treats these conjunctions as action element objects. The dependency parsing employs a transition-based model, which consists of a feature extraction module, a transition action prediction module, and a state stack module. The input to the dependency parsing model is a sequence of words and parts-of-speech tags after word segmentation and part-of-speech tagging; the output is a set of dependency relation edges. The feature extraction module extracts the part-of-speech tags and dependency relation features of the top element of the stack, the first element of the buffer, and both the top element of the stack and the first element of the buffer. The transition action prediction module is a multilayer perceptron (MLP). The input to the MLP is the feature vector output by the feature extraction module, and the output is the probability distribution of transition actions. The state stack module maintains the current dependency parsing state, which includes the stack, buffer, and generated dependency relation edges. During the training of the dependency parsing model, standard dependency parsing trees from the dependency tree library were used as supervision signals. A negative log-likelihood loss function was employed, and the multilayer perceptron parameters were optimized. The number of training iterations was set to 200, and the learning rate was set to 0.001. The reason for setting the number of training iterations to 200 is that the dependency accuracy on the validation set no longer improves from the 200th iteration onwards. The reason for setting the learning rate to 0.001 is that a grid search was used to select the value that minimizes the negative log-likelihood on the validation set from 0.01, 0.001, and 0.0001.
[0024] In the dependency syntax tree of the clause text, starting from the predicate head node, find edges with a subject-predicate dependency relationship and use the words pointed to by these edges as subject conjunctions; find edges with a verb-object dependency relationship and use the words pointed to by these edges as object conjunctions. Treat the subject conjunctions and object conjunctions as action element objects.
[0025] In the dependency syntax tree, conditional adverbial modification nodes that modify the predicate headword are identified, and the phrase text covered by these nodes is obtained as conditional element objects. When identifying conditional adverbial modification nodes, starting from the predicate headword node, edges with an adverbial-head relation type are searched, and the nodes pointed to by these edges are judged for their conditional semantic roles. Conditional semantic role judgment is achieved by matching conditional semantic markers, which include "if," "when," "under certain circumstances," and "when...". If a node contains a conditional semantic marker, it is considered a conditional adverbial modification node. When obtaining the phrase text covered by the conditional adverbial modification node, a depth-first traversal is performed along the dependency relation edges, starting from the conditional adverbial modification node, collecting the words corresponding to the conditional adverbial modification node and all its child nodes, and concatenating them in their original word order to obtain the phrase text as the conditional element object.
[0026] Action element objects and condition element objects are combined into key-value pair structures, and these key-value pair structures are stored as the element collection of the clause node. The keys in the key-value pair structure are the category identifiers of the action element object and the condition element object, and the values are the specific text of the action element object and the specific text of the condition element object. Multiple key-value pair structures are combined to form the element collection of the clause node, and the element collection is stored in the data structure corresponding to the clause node.
[0027] See Figure 4 The graph uses node depth as the x-axis and the number of action element objects and condition element objects as the y-axis, with blue dots and orange squares representing the distribution of these quantities, respectively. The node depth value on the x-axis ranges from 1 to 5, and the number of element objects on the y-axis ranges from 0 to 6. The legend clearly indicates the corresponding symbols for the number of action element objects and the number of condition element objects.
[0028] As shown in the figure, with the increase of node depth, the number of action element objects is mostly concentrated between 1 and 3. Within this range, the number of action element objects is relatively dispersed, with multiple discrete points having 1 to 3 action element objects, indicating some variation in the number of action element objects across different levels of clause nodes. When the node depth reaches 4 or higher, the number of action element objects tends to concentrate, with most nodes having 1 to 2 action element objects, showing that the number of action element objects in deeper-level clause nodes tends to stabilize.
[0029] The number of condition element objects is mainly distributed between 0 and 2. Most node depths correspond to 0 or 1 condition element objects, while a few nodes have 2. These are distributed across all node depth ranges. Overall, the number of condition element objects is significantly lower than the number of action element objects, indicating that there are relatively few condition element objects in the clause text. Furthermore, the number of condition element objects remains relatively stable with increasing node depth, showing no significant increase or decrease.
[0030] In practical implementation, when constructing the standard knowledge graph, each clause node is treated as an entity. Clause nodes originate from the hierarchical structure obtained by parsing the target standard document, with each clause node corresponding to an entity. The hierarchical identifier and element set of the clause node are used as the entity's attribute values. The hierarchical identifier is an array of hierarchical paths obtained by parsing the hierarchical numbers, and the element set is a key-value pair structure formed by combining action element objects and condition element objects obtained through dependency parsing. Structural subordination relationships are treated as first-type edges, with the direction of first-type edges set from the parent node to the child node. The parent node is the entity corresponding to the clause node at the higher level in the structural subordination relationship, and the child node is the entity corresponding to the clause node at the lower level. In the entity relationship network, each first-type edge connects a parent node entity and a child node entity, with the direction of the first-type edge pointing from the parent node entity to the child node entity.
[0031] The system maps action element objects in the element sets of each entity to standard action categories in a pre-defined action category library, and condition element objects in the element sets of each entity to standard condition categories in a pre-defined condition category library. When mapping action element objects, a word vector model is used to obtain word vectors for the action element objects and word vectors for each standard action category label in the pre-defined action category library. The word vector model adopts the Skip-gram architecture of Word2Vec, consisting of an input layer, a projection layer, and an output layer. The input layer receives the center word, which is a word from the training corpus, and converts the center word into a one-hot encoded representation. The projection layer is a linear transformation layer that maps the one-hot encoded representation of the center word into a low-dimensional dense vector with a dimension of 128. The output layer is a softmax classification layer that receives the low-dimensional dense vector output by the projection layer and outputs the probability distribution of the context words. During word vector model training, the training corpus is a set of standard document texts. The standard document texts are segmented to obtain word sequences. A sliding window is used to generate training sample pairs, with a window radius of 2. This window radius is chosen from among window radii 1, 2, and 3 via grid search to minimize the validation set loss. The word vector dimension is set to 128, chosen from among word vector dimensions 64, 128, and 256 to achieve the highest accuracy in the word analogy validation task. The number of training iterations is set to 15, chosen because the validation set loss no longer decreases after the 15th iteration. The initial learning rate is set to 0.025, chosen from among initial learning rates 0.01, 0.025, and 0.05 via grid search to minimize the validation set loss. After the word vector model training is complete, each row of the weight matrix in the projection layer corresponds to a word vector.
[0032] When mapping action element objects, the cosine similarity between the word vector of the action element object and the word vectors of each standard action category label in the preset action category library is calculated. Action element objects are subject-related and object-related words identified from the clause text, and each action element object corresponds to one or more words. When an action element object contains multiple words, the word vectors of multiple words in the action element object are added together by dimension and then averaged to obtain the action element object vector. The action element object vector and the word vector of a standard action category label in the preset action category library are substituted into the cosine similarity calculation formula to calculate the cosine similarity value. The cosine similarity value is calculated for all standard action category labels in the preset action category library, and the standard action category with the highest cosine similarity value is selected as the mapping result of the action element object. The cosine similarity calculation formula is: ; Where cos(a,b) represents the cosine similarity, where 'a' represents the first vector involved in the cosine similarity calculation, and vector 'a' is either the action element object vector or the standard action category label word vector of the first entity; 'b' represents the second vector involved in the cosine similarity calculation, and vector 'b' is either the word vector of the standard action category label in the preset action category library or the word vector of the standard action category label of the second entity; 'a·b' represents the dot product of vectors 'a' and 'b'; '||a||' represents the Euclidean norm of vector 'a', calculated as the positive square root of the sum of the squares of all dimensions of vector 'a'; '||b||' represents the Euclidean norm of vector 'b', calculated as the positive square root of the sum of the squares of all dimensions of vector 'b'. During the action element object mapping process, the action element object vector is used as vector 'a', and the word vector of a standard action category label from the preset action category library is used as vector 'b'. The cosine similarity value between the action element object vector and the standard action category label word vector is calculated using the cosine similarity calculation formula.
[0033] When mapping conditional element objects, a word vector model is used to obtain the word vectors of the conditional element objects and the word vectors of each standard conditional category label in the preset conditional category library. A conditional element object is a phrase text covered by conditional adverbial modifier nodes identified from the clause text, and it contains multiple words. The word vectors of all words in the conditional element object are summed along their dimensions and then averaged to obtain the conditional element object vector. The conditional element object vector and the word vector of a standard conditional category label in the preset conditional category library are substituted into the cosine similarity calculation formula to calculate the cosine similarity value. The cosine similarity value is calculated for all standard conditional category labels in the preset conditional category library, and the standard conditional category with the highest cosine similarity value is selected as the mapping result of the conditional element object. In the conditional element object mapping process, the conditional element object vector is used as vector a, and the word vector of a standard conditional category label in the preset conditional category library is used as vector b. The cosine similarity value between the conditional element object vector and the standard conditional category label word vector is calculated using the cosine similarity calculation formula.
[0034] Calculate the action semantic similarity between the standard action categories of any two entities, and the conditional semantic similarity between the standard condition categories of the two entities. The two entities are denoted as Entity 1 and Entity 2, respectively, and both Entity 1 and Entity 2 are entities corresponding to clause nodes in the standard knowledge graph. Obtain the standard action category label word vectors for Entity 1 and Entity 2. Using the standard action category label word vectors of Entity 1 as vector 'a' and Entity 2 as vector 'b', substitute them into the cosine similarity calculation formula to obtain the action semantic similarity. The action semantic similarity value ranges from -1 to 1; a higher action semantic similarity value indicates that the standard action categories of Entity 1 and Entity 2 are semantically closer. Obtain the standard condition category label word vectors for Entity 1 and Entity 2. Using the standard condition category label word vectors of Entity 1 as vector 'a' and Entity 2 as vector 'b', substitute them into the cosine similarity calculation formula to obtain the conditional semantic similarity. The conditional semantic similarity value ranges from -1 to 1. The larger the conditional semantic similarity value, the closer the standard conditional category of the first entity is to the standard conditional category of the second entity in terms of semantics.
[0035] When the action semantic similarity is greater than a first threshold and the conditional semantic similarity is greater than a second threshold, a second type of edge is established between the first entity and the second entity. The first threshold is set to 0.8. This first threshold is determined by adjusting the first threshold from 0.5 to 0.9 in increments of 0.05 on a standard knowledge graph construction validation set, selecting the threshold that maximizes the F1 score of the second type of edge establishment. The second threshold is set to 0.75. This second threshold is also determined by adjusting the second threshold from 0.5 to 0.9 in increments of 0.05 on a standard knowledge graph construction validation set, selecting the second threshold that maximizes the F1 score of the second type of edge establishment, obtaining the second threshold of 0.75. The second type of edge is an undirected edge that connects two entities whose action semantic similarity is greater than the first threshold and whose conditional semantic similarity is greater than the second threshold.
[0036] The entity relationship network, including both Type I and Type II edges, is used as the standard knowledge graph. Entities in the entity relationship network are those corresponding to the clause nodes. Edges in the network include both Type I and Type II edges. Type I edges represent structural subordination relationships, while Type II edges represent semantic associations between elements. The standard knowledge graph stores entity attribute values, the set of Type I edges, and the set of Type II edges.
[0037] See Figure 5In the graph, the horizontal axis represents the ranking of entities (i.e., clause nodes) from largest to smallest degree value, and the vertical axis represents the degree value of the corresponding entity. The graph contains two types of degree curves: "total edge degree" and "first-class edge degree," which correspond to the number of connected edges of entity nodes in a standard knowledge graph. "Total edge degree" includes the number of connections between first-class and second-class edges, while "first-class edge degree" only includes the number of connections between first-class edges representing structural subordination relationships.
[0038] As shown in the figure, within the top 10 intervals of entity ranking, the degree value of the "total edge degree" curve is relatively large, with the highest value exceeding 110. This indicates that some clause nodes have many connections through both structural subordination and semantic association edges, demonstrating the high relevance and importance of these nodes in the standard knowledge graph. Meanwhile, within the same interval, the degree value of the "first type edge degree" is significantly lower than that of the "total edge degree," reaching a maximum of approximately 80. This indicates that the number of first-type structural subordination edges constitutes the majority of all edges, but the second type of semantic association edges also significantly contributes to the overall relevance.
[0039] As entity rankings gradually decrease, degree values exhibit a rapid decline. Within the ranking range of approximately 100 to 200, both "total edge degree" and "first-type edge degree" drop below 10, and their curves gradually converge, indicating that in the later ranking stages, the number of semantically related edges decreases, and connections are primarily composed of structural subordination edges. Further down the spectrum, entities ranked above 500 exhibit degree values stabilizing between 1 and 2, suggesting that these clause nodes have relatively sparse connections and weak relationships within the standard knowledge graph.
[0040] In specific implementation, please refer to Figure 3 This process retrieves the scenario attribute values of the target business scenario. These values include scenario action tags and scenario condition tags. The target business scenario is a description of the business activity that requires standard clause matching. Scenario action tags represent the types of business actions within the target business scenario, while scenario condition tags represent the business condition constraints within the target business scenario. Scenario attribute values can be provided by the business system in structured data format, with scenario action tags and scenario condition tags located in the action and condition fields of the scenario attribute values, respectively.
[0041] The process involves matching scene action tags with the standard action categories of each entity in the standard knowledge graph. Each entity in the standard knowledge graph corresponds to a clause node, and each entity has a standard action category attribute. When matching scene action tags with standard action categories, the scene action tag text is compared with the standard action category tag text of each entity in the standard knowledge graph. A successful match is determined when the scene action tag text and the standard action category tag text are completely identical. Entities that successfully match the scene action tag are then selected as a candidate entity set. The candidate entity set consists of all entities whose standard action category tag text is completely identical to the scene action tag text.
[0042] Within the candidate entity set, scene condition tags are matched against the standard condition categories for each entity. When matching scene condition tags against standard condition categories, the matching method is determined based on the type of the scene condition tag. Scene condition tags can be categorized into discrete conditions and range conditions. Discrete conditions assign discrete text values to scene condition tags, while range conditions assign values within a numerical range.
[0043] When the scene condition label is a discrete condition, the scene condition label text is compared with the standard condition category label text of the entity in the candidate entity set. When the scene condition label text is completely consistent with the standard condition category label text, it is determined that the scene condition label and the standard condition category are successfully matched.
[0044] When the scene condition label is a range-type condition, it is determined whether the standard condition category of the entity in the candidate entity set falls within the numerical range indicated by the scene condition label. If so, the match is successful. When determining whether the standard condition category of an entity falls within the numerical range indicated by the scene condition label, the entity's standard condition category label is parsed into a condition value, and the numerical range indicated by the scene condition label is parsed into a lower bound and an upper bound. The numerical range consists of a lower bound and an upper bound; the lower bound is the minimum allowed value in the numerical range, and the upper bound is the maximum allowed value. The condition value is the numerical information extracted from the standard condition category label. When the condition value is greater than or equal to the lower bound and less than or equal to the upper bound, the entity's standard condition category is determined to fall within the numerical range indicated by the scene condition label, and the scene condition label matches the standard condition category successfully. When the condition value is less than the lower bound or greater than the upper bound, the entity's standard condition category does not fall within the numerical range indicated by the scene condition label, and the scene condition label does not match the standard condition category successfully.
[0045] When a scene condition label successfully matches a standard condition category of an entity in the candidate entity set, the entity is marked as an active node, and the matching condition category of the active node is recorded. The matching condition category is the standard condition category label that successfully matches the scene condition label. In the candidate entity set, the standard condition category of each entity is matched against the scene condition label. Entities that successfully match are marked as active nodes, while entities that do not match are not marked as active nodes.
[0046] See Figure 6 In the graph, the horizontal axis represents the number of candidate entities, ranging from 0 to 50, and the vertical axis represents the number of activated nodes, also ranging from 0 to 50. Blue dots represent data points corresponding to discrete conditions, and orange triangles represent data points corresponding to range conditions. Overall, the number of activated nodes for discrete conditions is generally higher than that for range conditions. When the number of candidate entities is low (approximately 10 to 30), the number of activated nodes for discrete conditions shows a significant upward trend, reaching a peak of approximately 20 to 30 activated nodes. Conversely, the number of activated nodes for range conditions is relatively low within the same range of candidate entity numbers, rarely exceeding 20 activated nodes. As the number of candidate entities increases, the number of activated nodes for discrete conditions exhibits a certain degree of discrete distribution, with some data points reaching approximately 30 activated nodes. In contrast, the number of activated nodes for range conditions tends to stabilize or slightly decrease, with most concentrated below 10. The data distribution in the figure reflects the differences in matching standard condition categories when different types of scene condition labels (discrete and range) are used. After matching discrete conditions, more nodes are activated, and the number of nodes showing successful matching is larger. In contrast, the number of nodes activated is relatively smaller when matching range conditions, reflecting that the matching results are more stringent due to the numerical range restrictions of range conditions.
[0047] In implementation, starting from the activated node, a bidirectional traversal is performed along the first and second types of edges in the standard knowledge graph to obtain all associated nodes whose path length to the activated node is less than or equal to a predetermined hop count threshold. The activated node is a clause node marked after its scene attribute value successfully matches an entity in the standard knowledge graph. First-type edges represent structural hierarchical relationships, with their direction pointing from the parent node to the child node. Second-type edges represent semantic associations of elements; these are undirected edges. During bidirectional traversal, a traversal queue is maintained, containing the current traversed node and the number of edges traversed from the current traversed node to the activated node. The activated node is added to the traversal queue, and the number of edges traversed from the activated node to the activated node is recorded as 0. The activated node is marked as a visited node. When the traversal queue is not empty, an element is taken from the head of the queue, and the number of edges traversed from the current traversed node to the activated node corresponding to that element is recorded as the current path length. If the current path length is less than the predetermined hop count threshold, then all nodes adjacent to the currently traversed node are found, and the number of edges traversed from the adjacent nodes to the active node is calculated as the current path length plus 1. For each found adjacent node, if the adjacent node is not marked as a visited node, it is added to the traversal queue and marked as a visited node. If the adjacent node has already been marked as a visited node, it is not added to the traversal queue again. When the traversal queue is empty, all visited nodes are treated as an associated node set. The predetermined hop count threshold is a pre-set positive integer used to limit the upper limit of the path length, which is the minimum number of edges traversed from the active node to the target node.
[0048] During bidirectional traversal, when traversing along edges of type I, the traversal proceeds in the direction of the edge. When traversing along edges of type II, since these edges are undirected, traversal can be performed from either endpoint to the other. For edges of type I, if the currently traversed node is the parent node of the edge, traversal can proceed from the parent node to the child node; if the currently traversed node is a child node of the edge, traversal cannot proceed from the child node to the parent node. For edges of type II, if the currently traversed node is an endpoint of the edge, traversal can proceed from that endpoint to the other endpoint of the edge.
[0049] The active node, all associated nodes, and the edges between the active node and all associated nodes form a candidate subgraph. The candidate subgraph consists of a set of candidate subgraph nodes and a set of candidate subgraph edges. The candidate subgraph node set contains the active node and all associated nodes. The candidate subgraph edge set contains all Type I and Type II edges in a standard knowledge graph where both endpoints are located within the candidate subgraph node set.
[0050] Obtain the node depth value of each clause node in the candidate subgraph, as well as the out-degree and in-degree values of each clause node in the candidate subgraph. Calculate the structural importance coefficient of the clause node based on the node depth, out-degree, and in-degree values. The node depth value of a clause node is the length of the hierarchical identifier array of the clause node. The node depth value is already stored as the attribute value of the entity corresponding to the clause node when constructing the standard knowledge graph and is directly read from the standard knowledge graph. The out-degree value of a clause node in the candidate subgraph is calculated by counting the number of edges in the edge set of the candidate subgraph that start from the clause node. Specifically, for the first type of edge, when the clause node is the parent node of the first type of edge, the first type of edge belongs to the edge that starts from the clause node; when the clause node is a child node of the first type of edge, the first type of edge does not belong to the edge that starts from the clause node. For the second type of edge, since the second type of edge is an undirected edge, when the clause node is an endpoint of the second type of edge, the second type of edge is counted as one out-degree value. The in-degree value of a clause node in the candidate subgraph is calculated as follows: The number of edges in the candidate subgraph edge set that terminate at the clause node is counted. Specifically, for the first type of edge, if the clause node is a child node of an edge of type I, that edge is considered an edge terminating at the clause node; if the clause node is the parent node of an edge of type I, that edge is not considered an edge terminating at the clause node. For the second type of edge, since these are undirected edges, if the clause node is an endpoint of an edge of type II, that edge is counted as an in-degree. Both out-degree and in-degree values are non-negative integers. The node depth value is a positive integer.
[0051] The formula for calculating the structural importance coefficient is: ; Where SI represents the structural importance coefficient, which is a real number greater than 0; OD represents the out-degree value of the clause node in the candidate subgraph, which is a non-negative integer, obtained by counting the number of edges in the candidate subgraph edge set that start with the clause node; ID represents the in-degree value of the clause node in the candidate subgraph, which is a non-negative integer, obtained by counting the number of edges in the candidate subgraph edge set that terminate with the clause node; ND represents the node depth value of the clause node, which is a positive integer, obtained by reading the length of the hierarchy identifier array of the entity corresponding to the clause node; ND+1 represents the node depth value plus 1, used to avoid the denominator being zero, and at the same time to give clause nodes with smaller node depth values a relatively higher structural importance coefficient.
[0052] The algorithm retrieves the number of elements in the element set of each clause node that match the scene attribute value. Based on the ratio of this number to the total number of elements in the element set, it calculates the element matching coefficient for the clause node. The element set of a clause node is a set of key-value pairs in the attribute values of the entity corresponding to the clause node. Each key-value pair contains an action element object and a condition element object. The scene attribute value contains a scene action label and a scene condition label. The algorithm compares the text of the action element object of each key-value pair with the text of the scene action label, and the text of the condition element object of each key-value pair with the text of the scene condition label. When the text of the action element object of a key-value pair is completely identical to the text of the scene action label, and the text of the condition element object of the key-value pair is completely identical to the text of the scene condition label, the key-value pair is considered to match the scene attribute value, and this key-value pair is counted in the number of elements matching the scene attribute value. This matching process is repeated for all key-value pairs, and the number of elements matching the scene attribute value is counted. The total number of elements in the element set is the total number of key-value pairs in the element set. The feature matching coefficient is the ratio of the number of features that match the scene attribute value to the total number of features in the feature set. The feature matching coefficient ranges from 0 to 1. When the total number of features in the feature set is 0, the feature matching coefficient is 0.
[0053] The product of the structural importance coefficient and the feature matching coefficient is used as the overall activation degree of the clause node. The overall activation degree is a positive real number or 0. The structural importance coefficient, feature matching coefficient, and overall activation degree are calculated for each clause node in the candidate subgraph.
[0054] See Figure 7In the graph, the horizontal axis represents the structural importance coefficient of the clause node, ranging from 0 to 10, and the vertical axis represents the element matching coefficient of the clause node, ranging from 0 to 1. In the legend, red solid circles represent active nodes, and blue small circles represent associated nodes. The structural importance coefficient of active nodes is concentrated in the lower range of 1 to 3, and the corresponding element matching coefficient is relatively high, all exceeding 0.8, with the maximum approaching 1. This indicates that the active node matches the scenario attribute value of the target business scenario quite accurately, and the structural importance coefficient is at a low to medium level, consistent with the setting of using the active node as the starting point to expand surrounding nodes. The structural importance coefficient of associated nodes is more widely distributed, mainly concentrated in the range of 0 to 6, with the highest density in the range of 1 to 3, showing the diversity of node structural importance coefficients in standard knowledge graphs. The element matching coefficient of associated nodes is mostly concentrated between 0 and 0.6, with an overall lower level than that of active nodes, reflecting a relatively weaker match between associated nodes and scenario attribute values. However, because they have a structural subordinate relationship or element semantic association with the active node, they are still included in the candidate subgraph. The absence of active nodes in the graph indicates that the selection of active nodes is strictly dependent on scene attribute elements with high matching degree.
[0055] In practice, the overall activation degree of the active nodes in the candidate subgraph is used as the baseline activation degree. An active node is a clause node marked after a successful match between its scene attribute value and an entity in the standard knowledge graph. The overall activation degree of the active node is calculated by multiplying the structural importance coefficient and the feature matching coefficient. The overall activation degree of all nodes in the candidate subgraph except the active nodes is compared with the baseline activation degree. For each node in the candidate subgraph except the active node, the overall activation degree of the other node is compared with the product of the baseline activation degree and a preset proportional coefficient. When the overall activation degree of the other node is less than the product of the baseline activation degree and the preset proportional coefficient, the other node is marked as a node to be pruned. The pruning judgment condition uses the following formula: OA < BA × PR; In this context, OA represents the overall activation degree of a node other than the active node in the candidate subgraph. OA is a real number greater than or equal to 0 and is calculated by multiplying the structural importance coefficient of the active node by the feature matching coefficient of the active node. BA represents the overall activation degree of the active node in the candidate subgraph. BA is a real number greater than or equal to 0 and is calculated by multiplying the structural importance coefficient of the active node by the feature matching coefficient of the active node. PR represents the preset proportional coefficient. PR is a real number between 0 and 1, and the preset proportional coefficient is set to 0.5. The basis for setting the preset proportional coefficient to 0.5 is that in the candidate subgraph pruning validation set, the preset proportional coefficient is adjusted in increments of 0.1 within the range of 0.1 to 1.0, and the preset proportional coefficient that maximizes the ratio of the number of relevant clause nodes retained in the pruned subgraph to the total number of relevant clause nodes is selected, resulting in a preset proportional coefficient of 0.5. When the overall activation of other nodes satisfies the above formula, the other node is marked as a node to be pruned; when the overall activation of other nodes does not satisfy the above formula, the other node is not marked as a node to be pruned.
[0056] In practice, all nodes to be pruned and all edges connected to them in the candidate subgraph are removed to obtain the pruned subgraph. When constructing the node set of the pruned subgraph, the remaining nodes after removing all nodes to be pruned from the candidate subgraph node set are used as the pruned subgraph node set. When constructing the edge set of the pruned subgraph, each edge in the candidate subgraph edge set is traversed, and it is checked whether at least one of its two endpoints belongs to the node set to be pruned. If at least one endpoint of the edge belongs to the node set to be pruned, the edge is removed from the candidate subgraph edge set. The edges that were not removed from the candidate subgraph edge set are retained to form the pruned subgraph edge set. The pruned subgraph consists of the pruned subgraph node set and the pruned subgraph edge set.
[0057] In the specific implementation, all clause nodes in the pruned subgraph are sorted in descending order of their node depth values. The node depth value is the length of the hierarchical identifier array of the entity corresponding to the clause node, and the node depth value is read from the standard knowledge graph. A stable descending sorting method is used during sorting. When multiple clause nodes have the same node depth value, the original order of these clause nodes in the pruned subgraph remains unchanged. The first K clause nodes are selected as target standard clause nodes, where K is a preset positive integer. K is obtained as a parameter passed in by the business system during the call. The business system sets K according to the output upper limit requirement of the target standard clauses. When the output upper limit requirement is 5, K is 5. The first K clause nodes are taken from the sorted clause node sequence and used as target standard clause nodes.
[0058] A target standard clause set is generated based on the target standard clause nodes. The target standard clause set consists of the clause text and hierarchical identifier corresponding to the target standard clause nodes. The hierarchical identifier and clause text are extracted from the entity attribute values corresponding to the target standard clause nodes. Each target standard clause node is output as a standard clause record, and all standard clause records are aggregated into the target standard clause set.
[0059] See Figure 8 In the graph, the horizontal axis represents the node ranking, sorted from highest to lowest overall activation level, while the vertical axis represents the overall activation level value of the node. The overall activation level is calculated as the product of the structural importance coefficient and the element matching coefficient. Green bars represent nodes to be retained, red bars represent nodes to be pruned, and the black dashed line is the pruning threshold line, corresponding to the product of the baseline activation level and the preset proportional coefficient in the formula.
[0060] The overall activation curve shows a decreasing trend. The top 330 nodes have an overall activation level above the pruning threshold and are marked as retained nodes. Subsequent nodes have an overall activation level below the pruning threshold and are marked as nodes to be pruned. The threshold is set at approximately 0.5, corresponding to the product of a preset proportional coefficient of 0.5 and the overall activation level of the activated nodes. The nodes with significantly higher overall activation levels indicate that these nodes have strong structural importance and feature matching in the candidate subgraph and possess high activation value. The nodes with lower overall activation levels show a slow decreasing trend and are all below the pruning threshold, indicating that these nodes contribute less to the generation of the target standard clauses and meet the criteria for pruning.
[0061] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning, characterized in that: include: Obtain the target standard document to be parsed, extract the hierarchical number and clause text from the target standard document, construct clause nodes, and establish the structural hierarchy relationship between clauses based on the hierarchical number; Based on the dependency syntax path in the clause text, identify the condition element objects and action element objects in the clause nodes, and generate the element set of each clause node; Based on the set of elements and the structural subordination relationship, a standard knowledge graph is constructed, wherein the standard knowledge graph uses clause nodes as entities and structural subordination relationship and element semantic association as edges; Obtain the scenario attribute value of the target business scenario, and match the scenario attribute value with the clause nodes in the standard knowledge graph, and take the successfully matched clause nodes as activation nodes; The activated node and its associated nodes within a predetermined number of hops in the standard knowledge graph are combined to form a candidate subgraph, and the overall activation degree of each clause node in the candidate subgraph is calculated. Based on the overall activation degree, the candidate subgraph is pruned to generate a set of target standard terms.
2. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 1, characterized in that, The process of extracting the hierarchical numbers and clause text from the target standard document, constructing clause nodes, and establishing structural hierarchical relationships between clauses based on the hierarchical numbers specifically includes: Using the chapter title identifiers and line breaks in the target standard document as boundaries, the text stream of the target standard document is segmented to obtain several initial paragraphs, and the number string at the beginning position of each initial paragraph is identified; Based on the separator type and numeric level depth in the number string, the number string is parsed into a level path array, and the level path array is used as the level identifier of the corresponding initial paragraph; The initial paragraph carrying the level identifier is identified as a clause node, and the level identifier of the clause node is used as the node depth value of the clause node. Traverse all clause nodes, and determine the clause node whose node depth value is 1 less than the node depth value of the current clause node and whose number prefix matches the prefix of the hierarchical path array of the current clause node as the parent node of the current clause node, so as to establish the hierarchical relationship of the structure.
3. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 2, characterized in that, The set of elements used to generate each clause node specifically includes: The clause text of the clause node is segmented and tagged with parts of speech to obtain a part-of-speech tag sequence. Based on the part-of-speech tags of verbs in the part-of-speech tag sequence, the predicate headword in the clause text is located. Starting from the predicate headword, traverse along the dependency relation edges in the dependency syntax tree of the clause text to obtain the subject conjunction and object conjunction of the predicate headword, and use the subject conjunction and object conjunction as action element objects; In the dependency syntax tree, identify the conditional adverbial modification node that modifies the predicate head word, and obtain the phrase text covered by the conditional adverbial modification node as a conditional element object; The action element object and the condition element object are combined into a key-value pair structure, and the key-value pair structure is stored as the element set of the clause node.
4. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 3, characterized in that, The step of constructing a standard knowledge graph based on the set of elements and the structural subordination relationships, wherein the standard knowledge graph uses clause nodes as entities and structural subordination relationships and semantic associations of elements as edges, specifically includes: Treat each clause node as an entity, and use the hierarchical identifier and element set of the clause node as the attribute value of the entity. Treat the structural subordination relationship as a first type of edge, and set the direction of the first type of edge to point from the parent node to the child node. Map the action element objects in the element set of each entity to the standard action categories in the preset action category library, and map the condition element objects in the element set of each entity to the standard condition categories in the preset condition category library. Calculate the action semantic similarity between the standard action categories of any two entities, and the conditional semantic similarity between the standard condition categories of the two entities. When the action semantic similarity is greater than a first threshold and the conditional semantic similarity is greater than a second threshold, establish a second type of edge between the two entities. The entity relationship network containing the first type of edge and the second type of edge is used as the standard knowledge graph.
5. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 4, characterized in that, The process of obtaining the scenario attribute values of the target business scenario and matching them with the clause nodes in the standard knowledge graph, and then using the successfully matched clause nodes as activation nodes, specifically includes: Obtain the scene attribute values of the target business scenario, wherein the scene attribute values include scene action tags and scene condition tags; The scene action tags are matched with the standard action categories of each entity in the standard knowledge graph, and the entities that successfully match the scene action tags are taken as a candidate entity set. In the candidate entity set, the scene condition label is matched with the standard condition category of the entity. When a match is successful, the entity is marked as an active node, and the matching condition category of the active node is recorded.
6. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 5, characterized in that, The step of forming a candidate subgraph by combining the activated node and its associated nodes within a predetermined hop count range in the standard knowledge graph, and calculating the comprehensive activation degree of each clause node in the candidate subgraph, specifically includes: Starting from the activated node, a bidirectional traversal is performed along the first type of edge and the second type of edge in the standard knowledge graph to obtain all associated nodes whose path length to the activated node is less than or equal to a predetermined hop count threshold. The active node, all associated nodes, and the edges between the active node and all associated nodes are used to form a candidate subgraph; Obtain the node depth value of each clause node in the candidate subgraph, as well as the out-degree and in-degree values of each clause node in the candidate subgraph, and calculate the structural importance coefficient of the clause node based on the node depth value, the out-degree value, and the in-degree value; Obtain the number of elements in the element set of each clause node that match the scene attribute value, and calculate the element matching coefficient of the clause node based on the ratio of the number of elements to the total number of elements in the element set. The product of the structural importance coefficient and the element matching coefficient is taken as the overall activation degree of the clause node.
7. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 6, characterized in that, The step of pruning the candidate subgraph based on the comprehensive activation degree to generate a target standard clause set specifically includes: The overall activation degree of the active node in the candidate subgraph is used as the baseline activation degree. The overall activation degree of other nodes in the candidate subgraph, excluding the active node, is compared with the baseline activation degree. If the overall activation degree of other nodes is less than the product of the baseline activation degree and a preset ratio coefficient, then the other node is marked as a node to be pruned. Remove all nodes to be pruned and all edges connected to the nodes to be pruned from the candidate subgraph to obtain the pruned subgraph; Sort all clause nodes in the pruned subgraph from largest to smallest according to their node depth values, select the top K clause nodes as target standard clause nodes, and generate a target standard clause set based on the target standard clause nodes.
8. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 4, characterized in that, The step of mapping action element objects in the element set of each entity to standard action categories in the preset action category library specifically includes: calculating the cosine similarity between the word vector of the action element object and the word vector of each standard action category label in the preset action category library, and taking the standard action category with the largest cosine similarity as the mapping result of the action element object.
9. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 5, characterized in that, In the candidate entity set, the scene condition label is matched with the standard condition category of the entity. When the match is successful, the entity is marked as an active node and the matching condition category of the active node is recorded. Specifically, when the scene condition label is a range-type condition, it is determined whether the standard condition category of the entity falls within the numerical range indicated by the scene condition label. If so, the match is successful.
10. The method for automatically parsing and generating standard clauses based on knowledge graphs and rule-based reasoning according to claim 6, characterized in that, The step of calculating the structural importance coefficient of the clause node based on the node depth value, the out-degree value, and the in-degree value specifically includes: calculating the structural importance coefficient as the quotient of the sum of the out-degree value and the in-degree value divided by the node depth value plus one.
