User role and scene-based compliance term retrieval method

By constructing a mapping relationship between user roles and weight vectors and using multi-channel hybrid retrieval, calculating the risk vector and suitability of clauses, and optimizing the retrieval of compliant clauses, the problem of high-risk clauses being hidden and irrelevant clauses being mixed in is solved, achieving efficient and accurate retrieval and screening of compliant clauses.

CN121786065APending Publication Date: 2026-04-03GUANGZHOU CITY UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing compliance clause retrieval methods fail to effectively link clause risk vectors with role weight vectors, resulting in high-risk clauses being hidden due to low semantic relevance scores. Furthermore, the lack of calculation of the matching degree between the applicable subject of the clause and the user's role and scenario leads to irrelevant clauses being mixed into the search results, increasing the user's screening burden.

Method used

A mapping function is constructed to user roles, weight vectors, and domain terms. The weight vector and terminology preference vocabulary corresponding to the current user role are obtained. Candidate terms are obtained from the compliance terms library through a multi-channel hybrid retrieval strategy. The risk vector and suitability of the candidate terms are calculated. A joint scoring function is constructed. A lazy greedy algorithm is used to optimize the subset of candidate terms. Term replacement and expression optimization are performed. Finally, a structured list item is generated.

Benefits of technology

Ensure that high-risk clauses receive higher evaluation weight, prevent irrelevant clauses from being mixed into search results, reduce the user's filtering burden, and improve the efficiency of information acquisition and the readability of clause content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786065A_ABST
    Figure CN121786065A_ABST
Patent Text Reader

Abstract

The invention discloses a compliance clause retrieval method based on a user role and a scene, which comprises the following steps of: constructing a mapping relationship between the user role and a weight vector as well as a term preference, and obtaining a weight vector corresponding to the current role; extracting scene feature vectors of user query and context; candidate terms are retrieved from the compliance term library, risk vectors of the candidate terms and the degree of adaptation between the candidate terms and the roles and the scenes are calculated, and then risk gains of the roles to the terms are obtained; constructing a joint scoring function according to the risk gain; solving an optimal candidate term for maximizing the target function under the budget constraint; performing scene feature clipping and user term preference optimization to obtain a final term; and generating structured list items for the final terms, scoring, and outputting in a descending order according to scores. The problem that in an existing compliance clause retrieval method, sorting is conducted only through semantic relevance, clause risk vectors and role weight vectors are not associated, and consequently high-risk clauses are hidden due to low semantic scores is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of information retrieval and natural language processing technology, specifically a method for retrieving compliance terms based on user roles and scenarios. Background Technology

[0002] The risk dimensions covered by compliance clauses exhibit significant differences in the severity of consequences. For example, risks such as electric shock and arc burns, once triggered, will cause significant safety hazards, and corresponding high-risk clauses should be prioritized in search results. From the perspective of the applicable attributes of the clauses, compliance clauses typically clearly define the applicable subjects, such as "dispatchers on duty should" or "maintenance personnel must," and the applicable scenarios, such as "during live-line work" or "during power outage maintenance." However, existing compliance clause retrieval methods have two main drawbacks. First, these methods rely primarily on semantic relevance for ranking, failing to establish a correlation mechanism between the clause's risk vector and the role's weight vector. This results in high-risk clauses with significant safety hazards being hidden in search results due to their low semantic relevance scores, making them difficult for users to prioritize. Second, these methods lack calculations on the matching degree between the applicable subjects of the clauses and the user's role and scenario, leading to clauses irrelevant to the user's role or scenario being included in the search results, increasing the user's filtering burden. Summary of the Invention

[0003] To address the aforementioned shortcomings, this invention proposes a compliance clause retrieval method based on user roles and scenarios. The aim is to solve the problems in existing compliance clause retrieval methods, which only sort by semantic relevance without associating clause risk vectors and role weight vectors, resulting in high-risk clauses being hidden due to low semantic scores; and the lack of calculation of the matching degree between clauses and user roles and scenarios, leading to irrelevant clauses being mixed into the search results.

[0004] To achieve this objective, the present invention adopts the following technical solution: A method for retrieving compliance clauses based on user roles and scenarios includes the following steps: Step S1: Construct a mapping function between user roles, weight vectors, and domain terms, and obtain the weight vector and term preference vocabulary corresponding to the current user role based on the mapping function; Step S2: Obtain the user query statement and multi-source context, and extract the scene feature vector from them; Step S3: Based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from the preset compliance clauses library, and the risk vector of the current candidate clause in the candidate clause set and the suitability of the current candidate clause with the current user role and the current scenario are calculated. Step S4: Calculate the risk gain of the current user role for the current candidate clause based on the weight vector of the current user role, the risk vector of the current candidate clause, and the fit between the current candidate clause and the current user role and the current scenario; and construct a joint scoring function based on the risk gain. Step S5: Construct the objective function for each subset of candidate terms in the candidate term set, and under the preset budget constraint, use a lazy greedy algorithm to find the optimal subset of candidate terms that maximizes the objective function. Step S6: Based on the scene feature vector, the optimal candidate clause subset is pruned to obtain the pruned optimal candidate clause subset; Step S7: Based on the terminology preference vocabulary of the current user role, perform term replacement and expression optimization on the trimmed optimal candidate clause subset to obtain the final selected clause set; Step S8: Generate corresponding structured list items for each of the final selected terms in the final selected terms set, calculate the score of each structured list item according to the joint scoring function, and sort all structured list items in descending order of score to form the final retrieval output list.

[0005] Preferably, in step S1, when obtaining the weight vector corresponding to the current user role, the following sub-steps are specifically included: If the current user's role is already defined, then the weight vector corresponding to the current user's role is used directly. If the current user role is not specified, then the prior mixed weights are calculated as the weight vector corresponding to the current user role. The specific calculation formula for the prior mixed weights is as follows: ; in, Indicates prior mixed weights; Represents the prior probability of a user role of type r; Represents the set of user role types; This represents the weight vector of a user role of type r. The specific calculation formula is as follows: ; in, Represents the weight matrix; Represents the bias vector; The feature vector representing a user role of type r; This represents the smooth activation function.

[0006] Preferably, in step S3, based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from the preset compliance clauses library. Specifically, this includes the following sub-steps: using the BM25 sparse retrieval algorithm to perform term matching on the compliance clauses in the preset compliance clauses library, and filtering out compliance clauses that highly match the keywords in the user's query; simultaneously, using the BERT-based dense vector retrieval algorithm to perform semantic matching on the compliance clauses in the preset compliance clauses library, and filtering out the compliance clauses with the best semantic similarity to the user's query, so as to form a set of candidate clauses C.

[0007] Preferably, in step S3, the specific formula for calculating the risk vector of the current candidate clause in the candidate clause set is as follows: ; in, This represents the risk vector of the current candidate clause c; Represents a risk multi-label classification vector. The specific acquisition steps are as follows: Construct a multi-label classifier based on clause text, tabular data, and historical accident labels. ; obtain The predicted probability of the risk dimension output by the current candidate clause c during the reasoning phase; Represents the consequence severity factor vector. The specific calculation formula is as follows: ; Where k represents the severity amplification factor; This indicates the severity of the consequences of the current candidate clause c; This represents the vector of legal modal intensity amplification factors. The specific calculation formula is as follows: ; in, This indicates the modal type of the current candidate clause c. When the modal type is licensed, The value is 0; when the modal type is Obligation, The value is 1; when the modal type is prohibited, The value is 2; This represents the modal amplification factor.

[0008] Preferably, in step S3, the specific formula for calculating the suitability of the current candidate clause with the current user role and the current scenario is as follows: ; in, This indicates the suitability of the current candidate terms with the current user role and the current scenario; This represents the subject matching degree, that is, the mapping relationship between the subject entity in the current candidate clause c and the user role of type r. The specific calculation formula is as follows: ; in, This indicates that the Named Entity Recognition (NER) algorithm is used to select from the current candidate terms. The main entity set extracted from it. , , where n represents the total number of main entities; Let i represent the similarity function between the i-th subject entity and the user role of type r; This represents the condition satisfaction degree, i.e., the conditional predicate in the current candidate clause c and the feature vector of the current scenario. The degree of matching, The specific calculation formula is as follows: ; Where p represents the conditional predicate in the current candidate clause c; This represents the set of conditional predicates in the current candidate clause c; This represents the conditional predicate p in the current candidate clause c and the current scene feature vector. The matching function; Indicates an indicator function; Indicates the number of conditional predicates; Represents a local maximum function; This represents a validity indicator function used to determine whether the current time t is within the validity period of the current candidate clause c. If t is inside Inside, then The value is 1 if t is not present. Inside, then The value is 0.

[0009] Preferably, in step S4, the specific formula for calculating the risk gain of the current user role for the current candidate clause is as follows: ; in, This indicates the risk gain or loss of the current user role relative to the current candidate terms; The specific mathematical expression of the joint scoring function is as follows: ; in, Represents the joint scoring function; Indicates the current candidate clause With user query statement Basic relevance score; This represents the risk gain weighting coefficient, used to control the strength of the influence of risk factors in the final ranking; This represents the irrelevance-based weighting coefficient, used to penalize terms that are incompatible with the user's role and context. This indicates irrelevant penalty items, used to identify and downgrade clauses where the subject entity and user role do not match, or where the predicate condition does not conform to the scene characteristics. The specific calculation formula is as follows: ; in, Indicates the subject matching degree threshold; This indicates the threshold for condition satisfaction.

[0010] Preferably, step S4 further includes the following step: Determine the risk gain / loss of the current user role for the current candidate terms. Is it greater than or equal to the risk gain significance threshold? If not, the joint scoring function of the current candidate clauses No additional gain adjustment is performed; if so, the joint scoring function of the current candidate terms. The following value conditions must be met: ; in, Indicates the minimum allowable gain amplitude; This indicates the maximum allowable gain.

[0011] Preferably, in step S5, the objective function of the current candidate clause subset A in the candidate clause set is... The mathematical expression is as follows: ; in, This represents the weighting coefficient of the basic relevance score; This represents the risk gain weighting coefficient; This represents the weighting coefficient for the coverage of risk dimensions; Indicates the coverage of risk dimensions. The specific calculation formula is as follows: ; Where h represents the risk dimension; Represents a set of risk dimensions; Indicates the weight of risk dimension h; This indicates the risk level of the current candidate clause c on the risk dimension h; Priority weighting coefficient between declaration obligations and prohibition clauses; The order of priority between obligations and prohibitions. The specific calculation formula is as follows: ; in, Indicates the modal type of the current candidate clause c; Indicates the redundancy penalty coefficient; This indicates that the current candidate clause c is compared with another candidate clause. The similarity between them; B represents the length of the current candidate clause c; B represents the budget limit, i.e., the maximum allowed size of the output.

[0012] Preferably, in step S8, the structured list items of the final selected clause include risk level, applicable conditions, handling and precautions, and reference information; The specific formula for calculating the risk level is as follows: ; in, Indicates the final selected clause Risk level; Represents the sigmoid function; Indicates the risk level coefficient; A weight vector representing a user role of type r; Indicates the final selected clause The risk vector; Indicates the final selected clause Conditional predicate and current scene feature vector The degree of matching; Indicates risk level bias; The applicable conditions are specifically the predicate conditions extracted from the final selected clauses; The handling and precautions are expressions in the corresponding format generated using predefined rule templates, based on the modal type of the final selected clause and the action verbs in the final selected clause. When the modal type of the finally selected clause is a permission clause, the "optional operation" template is used to generate a statement in the format of "can be performed + action verb + condition"; When the modal type of the finally selected clause is an obligation clause, the "mandatory operation" template is used to generate a statement in the format of "must be performed + action verb + condition". When the modal type of the finally selected clause is a prohibited clause, the "prohibited operation" template is used to generate a statement in the format of "prohibited + action verb + condition". The cited information includes the clause number, sentence or line number, start and end positions, effective date, and expiration date.

[0013] Preferably, the method further includes the following step: offline training of the joint scoring function, specifically including the following sub-steps: Based on the click, execution, and review records in the preset historical logs, construct positive and negative sample clause pairs. ; Construct the rearranger model, i.e., the parameters in the joint scoring function; Calculate the sorting loss function of the rearranger model. and minimize This allows the rearranger model to learn optimal parameters, achieving the goal of "prioritizing useful clauses and relegating irrelevant clauses to the next level." The specific calculation formula is as follows: ; in, Indicates positive sample terms The corresponding joint score; Indicates negative sample clause The corresponding joint score; This represents an exponential function.

[0014] The technical solution provided by this invention may include the following beneficial effects: This solution first constructs a mapping function between user roles, weight vectors, and domain terms, thereby obtaining the weight vector corresponding to the current user role. Then, it calculates the risk vector of the current candidate clause in the candidate clause set, as well as the suitability of the current candidate clause with the current user role and the current scenario. Finally, it combines these three factors to calculate a risk gain. This risk gain achieves a deep integration of the role weight vector, clause risk vector, and the suitability of the clause with the role and scenario, enabling high-risk clauses that are most critical to the current user role to receive higher evaluation weights. The algorithmic mechanism ensures that such clauses are not overlooked due to low semantic relevance scores. Furthermore, by calculating the suitability of the current candidate clause with the current user role and the current scenario, it prevents clauses unrelated to the user role or scenario from being included in the search results, thus reducing the user's filtering burden. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the steps of a compliance clause retrieval method based on user roles and scenarios. Detailed Implementation

[0016] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0017] A method for retrieving compliance clauses based on user roles and scenarios includes the following steps: Step S1: Construct a mapping function between user roles, weight vectors, and domain terms, and obtain the weight vector and term preference vocabulary corresponding to the current user role based on the mapping function; Step S2: Obtain the user query statement and multi-source context, and extract the scene feature vector from them; Step S3: Based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from the preset compliance clauses library, and the risk vector of the current candidate clause in the candidate clause set and the suitability of the current candidate clause with the current user role and the current scenario are calculated. Step S4: Calculate the risk gain of the current user role for the current candidate clause based on the weight vector of the current user role, the risk vector of the current candidate clause, and the fit between the current candidate clause and the current user role and the current scenario; and construct a joint scoring function based on the risk gain. Step S5: Construct the objective function for each subset of candidate terms in the candidate term set, and under the preset budget constraint, use a lazy greedy algorithm to find the optimal subset of candidate terms that maximizes the objective function. Step S6: Based on the scene feature vector, the optimal candidate clause subset is pruned to obtain the pruned optimal candidate clause subset; Step S7: Based on the terminology preference vocabulary of the current user role, perform term replacement and expression optimization on the trimmed optimal candidate clause subset to obtain the final selected clause set; Step S8: Generate corresponding structured list items for each of the final selected terms in the final selected terms set, calculate the score of each structured list item according to the joint scoring function, and sort all structured list items in descending order of score to form the final retrieval output list.

[0018] This solution includes a compliance clause retrieval method based on user roles and scenarios, such as... Figure 1As shown, the first step is to construct a mapping function between user roles, weight vectors, and domain terms. Based on this mapping function, the weight vector and terminology preference lexicon corresponding to the current user role are obtained. In this embodiment, by constructing the mapping function between user roles, weight vectors, and domain terms, abstract user role characteristics can be transformed into quantifiable weight vectors and explicit terminology preference lexicons, thereby determining the core needs and terminology usage habits of different user roles. Further explanation: User roles include dispatchers, maintenance personnel, repair personnel, and auditors, etc. The terminology preference lexicon for the current user role is a set of domain terminology mappings for the current user role, containing the correspondence between commonly used technical terms and synonyms. The second step is to obtain the user query statement and multi-source context, and extract the scene feature vector from them. In this embodiment, by extracting the scene feature vector from the user query statement and multi-source context, implicit scene information beyond the query statement can be captured. Further explanation: Multi-source context refers to the natural language expression of the query subject, the session history of previous operations, the current system's operating status information, the user's department and shift, and external environmental information such as weather and time. The third step involves retrieving a set of candidate clauses from a pre-defined compliance clause database based on the user's query, using a multi-channel hybrid retrieval strategy. It then calculates the risk vector of the current candidate clause and its suitability with the current user role and scenario. In this embodiment, using a multi-channel hybrid retrieval strategy to retrieve the candidate clause set from the pre-defined compliance clause database effectively covers more candidate clauses related to the user's query compared to a single retrieval strategy, reducing the risk of missed detections. By calculating the risk vector of the candidate clauses and their suitability with the user role and scenario, the risk level and matching degree of the candidate clauses can be transformed into calculable quantitative indicators, providing a data foundation for subsequent risk gain calculations. The fourth step involves calculating the risk gain for the current user role relative to the current candidate clause based on the weight vector of the current user role, the risk vector of the current candidate clause, and the suitability of the current candidate clause with the current user role and scenario. Based on this risk gain, a joint scoring function is constructed. In this embodiment, calculating the risk gain for the current user role relative to the current candidate clause provides a data foundation for the subsequent construction of the joint scoring function. By constructing a joint scoring function that integrates multi-dimensional indicators, an objective, unified, and quantifiable evaluation standard is provided for the subsequent clause ranking process.The fifth step is to construct the objective function for each subset of candidate clauses in the candidate clause set, and under a preset budget constraint, use a lazy greedy algorithm to find the optimal subset of candidate clauses that maximizes the objective function. In this embodiment, in a compliance management scenario, the size of the output result is usually constrained by the budget due to limitations in display space, processing time, or user attention. Therefore, by using a lazy greedy algorithm to find the optimal subset of candidate clauses that maximizes the objective function under budget constraints, the combination of candidate clause subsets with the highest overall benefit can be quickly located while meeting resource constraints. Furthermore, by constructing the objective function, the quality of candidate clause subsets can be effectively quantified. By utilizing the core characteristics of the lazy greedy algorithm—approximate optimal solution output and efficient computation—the optimal subset of candidate clauses can be selected in a very short time. The sixth step is to prune the optimal subset of candidate clauses based on the scenario feature vector to obtain the pruned optimal subset of candidate clauses. Specifically, by pruning the optimal subset of candidate clauses based on the scenario feature vector, it is ensured that the pruned optimal candidate clauses fully meet the actual needs of the current scenario. In this embodiment, the optimal candidate clause subset is pruned based on the scenario feature vector. Specifically, optimal candidate clauses are selectively retained according to the current scenario's indication. If the current scenario's indication is "maintenance or power outage" work, optimal candidate clauses involving safety measures such as "voltage testing, grounding, tagging, and permitting procedures" are prioritized for retention. If the current scenario's indication is "dispatching or live-line work," optimal candidate clauses involving "operation tickets, interlocking, relay protection settings, and dispatch command constraints" are prioritized for retention. The seventh step is to perform terminology replacement and expression optimization on the pruned optimal candidate clause subset based on the current user role's terminology preference glossary, resulting in the final selected clause set. Specifically, by performing terminology replacement and expression optimization on the pruned optimal candidate clause subset, the wording of the clauses is made consistent with the user's terminology usage habits, thereby reducing the user's understanding cost and improving the readability and execution accuracy of the clause content. In one embodiment, the technical term "relay protection setting" in the tailored optimal candidate clauses is rewritten as "setting sheet" familiar to dispatchers or "setting area" used by technical personnel, maintaining the semantic content and legal effect while improving the consistency of terminology with role habits. The eighth step is to generate corresponding structured list items for each of the final selected clauses in the final selected clause set, calculate the score for each structured list item based on the joint scoring function, and sort all structured list items in descending order of score to form the final retrieval output list. In this embodiment, generating structured list items for the final selected clauses facilitates users in quickly extracting core information, thereby improving information acquisition efficiency. By sorting all structured list items in descending order based on the joint scoring function, the clauses with the highest risk can be placed at the top, promptly reminding users of the most critical safety points.

[0019] This solution first constructs a mapping function between user roles, weight vectors, and domain terms, thereby obtaining the weight vector corresponding to the current user role. Then, it calculates the risk vector of the current candidate clause in the candidate clause set, as well as the suitability of the current candidate clause with the current user role and the current scenario. Finally, it combines these three factors to calculate a risk gain. This risk gain achieves a deep integration of the role weight vector, clause risk vector, and the suitability of the clause with the role and scenario, enabling high-risk clauses that are most critical to the current user role to receive higher evaluation weights. The algorithmic mechanism ensures that such clauses are not overlooked due to low semantic relevance scores. Furthermore, by calculating the suitability of the current candidate clause with the current user role and the current scenario, it prevents clauses unrelated to the user role or scenario from being included in the search results, thus reducing the user's filtering burden.

[0020] Preferably, in step S1, when obtaining the weight vector corresponding to the current user role, the following sub-steps are specifically included: If the current user's role is already defined, then the weight vector corresponding to the current user's role is used directly. If the current user role is not specified, then the prior mixed weights are calculated as the weight vector corresponding to the current user role. The specific calculation formula for the prior mixed weights is as follows: ; in, Indicates prior mixed weights; Represents the prior probability of a user role of type r; Represents the set of user role types; This represents the weight vector of a user role of type r. The specific calculation formula is as follows: ; in, Represents the weight matrix; Represents the bias vector; The feature vector representing a user role of type r; This represents the smooth activation function.

[0021] In this embodiment, when obtaining the weight vector corresponding to the current user role, if the current user role is already defined, directly using its corresponding weight vector ensures that the output result is consistent with the specific responsibilities and focus of the current user role. If the current user role is not accurately identified or there are multiple user operations in the system, a priori hybrid weight mechanism is used to integrate the risk focus dimensions of multiple user roles. This avoids risk blind spots from a single role's perspective, improves the robustness of the results in complex scenarios, and provides a unified risk assessment perspective across multiple roles.

[0022] Preferably, in step S3, based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from the preset compliance clauses library. Specifically, this includes the following sub-steps: using the BM25 sparse retrieval algorithm to perform term matching on the compliance clauses in the preset compliance clauses library, and filtering out compliance clauses that highly match the keywords in the user's query; simultaneously, using the BERT-based dense vector retrieval algorithm to perform semantic matching on the compliance clauses in the preset compliance clauses library, and filtering out the compliance clauses with the best semantic similarity to the user's query, so as to form a set of candidate clauses C.

[0023] In this embodiment, the BM25 sparse retrieval algorithm is used for term matching, which has low computational complexity and does not require high-dimensional vector operations, enabling rapid retrieval of a large-scale compliance clause database. Semantic matching is performed using a BERT-based dense vector retrieval algorithm, requiring only deep computation on the filtered candidate range, thus avoiding the computational cost of semantic computation across the entire compliance clause database. This parallel and collaborative mechanism of the two retrieval algorithms ensures both fast retrieval response speed and deep semantic matching.

[0024] Preferably, in step S3, the specific formula for calculating the risk vector of the current candidate clause in the candidate clause set is as follows: ; in, This represents the risk vector of the current candidate clause c; Represents a risk multi-label classification vector. The specific acquisition steps are as follows: Construct a multi-label classifier based on clause text, tabular data, and historical accident labels. ; obtain The predicted probability of the risk dimension output by the current candidate clause c during the reasoning phase; Represents the consequence severity factor vector. The specific calculation formula is as follows: ; Where k represents the severity amplification factor; This indicates the severity of the consequences of the current candidate clause c; This represents the vector of legal modal intensity amplification factors. The specific calculation formula is as follows: ; in, This indicates the modal type of the current candidate clause c. When the modal type is licensed, The value is 0; when the modal type is Obligation, The value is 1; when the modal type is prohibited, The value is 2; This represents the modal amplification factor.

[0025] In this embodiment, risk multi-label classification vectors are configured. It can accurately capture the risk attribute characteristics corresponding to the current candidate clause c. This is achieved by configuring the consequence severity factor vector. This enables differentiated quantification of the severity of risk consequences. This is achieved by configuring a legal modality intensity amplification factor vector. This allows for adaptation to differences in the compliance constraint strength of different modal clauses. To further explain, the severity amplification factor k is used to adjust the strength of the impact of consequence severity on the risk vector. Modal amplification factor. The rules for determining the values ​​ensure that in the risk vector, "the weight of prohibited clauses is greater than the weight of obligatory clauses, and the weight of obligatory clauses is greater than the weight of permitted clauses."

[0026] Preferably, in step S3, the specific formula for calculating the suitability of the current candidate clause with the current user role and the current scenario is as follows: ; in, This indicates the suitability of the current candidate terms with the current user role and the current scenario; This represents the subject matching degree, that is, the mapping relationship between the subject entity in the current candidate clause c and the user role of type r. The specific calculation formula is as follows: ; in, This indicates that the Named Entity Recognition (NER) algorithm is used to select from the current candidate terms. The main entity set extracted from it. , , where n represents the total number of main entities; Let i represent the similarity function between the i-th subject entity and the user role of type r; This represents the condition satisfaction degree, i.e., the conditional predicate in the current candidate clause c and the feature vector of the current scenario. The degree of matching, The specific calculation formula is as follows: ; Where p represents the conditional predicate in the current candidate clause c; This represents the set of conditional predicates in the current candidate clause c; This represents the conditional predicate p in the current candidate clause c and the current scene feature vector. The matching function; Indicates an indicator function; Indicates the number of conditional predicates; Represents a local maximum function; This represents a validity indicator function used to determine whether the current time t is within the validity period of the current candidate clause c. If t is inside Inside, then The value is 1 if t is not present. Inside, then The value is 0.

[0027] In this embodiment, the subject matching degree is configured. This allows for precise identification of the relationship between the parties involved in the terms and the user roles. It also allows for the configuration of condition satisfaction levels. This approach considers the coverage of all conditional predicates and ensures comparability between different clauses through normalization, making the search results more relevant to the current scenario. This is achieved by configuring a timeliness and validity indicator function. This can effectively detect expired clauses where "the current time is not within the validity period of the terms," ​​making it easy to filter them out. Further explanation: in the configuration... During the process, The calculation method is as follows: when there is an exact correspondence between the main entity and the user role, then The value is 1; when there is a semantic association but not a complete match, the word vector model such as Word2Vec or BERT is used to calculate... For irrelevant entities, then The value is 0 or close to 0. If there are no principal entities in the current candidate clause, then The default value is used, meaning the current candidate clause applies to all roles. (In configuration...) At that time, through It can determine the relationship between the conditional predicate p in the current candidate clause c and the current scene feature vector. Whether it matches, if the conditional predicate p matches the current scene feature vector. A perfect match, then The value is 1, and the conditional predicate p is related to the current scene feature vector. Partial match, then Take the average of all conditional matches. To further clarify, during the matching process, if the conditional predicate p is a structured conditional description, then it is compared with the current scene feature vector. The corresponding data or categories are compared. If the conditional predicate p is an unstructured conditional description, then the conditional predicate and the scene feature vector are compared. All conditions are encoded using BERT, and the cosine similarity between the encoded conditional predicate and the scene feature vector is calculated. The cosine similarity is then used to determine whether it exceeds a preset threshold.

[0028] Preferably, in step S4, the specific formula for calculating the risk gain of the current user role for the current candidate clause is as follows: ; in, This indicates the risk gain or loss of the current user role relative to the current candidate terms; The specific mathematical expression of the joint scoring function is as follows: ; in, Represents the joint scoring function; Indicates the current candidate clause With user query statement Basic relevance score; This represents the risk gain weighting coefficient, used to control the strength of the influence of risk factors in the final ranking; This represents the irrelevance-based weighting coefficient, used to penalize terms that are incompatible with the user's role and context. This indicates irrelevant penalty items, used to identify and downgrade clauses where the subject entity and user role do not match, or where the predicate condition does not conform to the scene characteristics. The specific calculation formula is as follows: ; in, Indicates the subject matching degree threshold; This indicates the threshold for condition satisfaction.

[0029] In this embodiment, In the calculation logic, through users of type r of Current Candidate c Quantifiable current candidates c Users of type r Combined Constraints are imposed to ensure that high gain values ​​are only obtained by fulfilling risk clauses that meet role responsibilities and scenario conditions. Joint scoring function. By “current candidate terms” With user query statement The basic relevance score is used as the basis for ranking, and a risk gain item is added. To optimize the presentation of high-risk clauses and remove irrelevant penalty items. This filters out inappropriate content, thus achieving a synergistic optimization of semantic relevance and risk perception. Further explanation is needed regarding the configuration... During the process, only when the subject matching degree and condition satisfaction Only when the values ​​fall below their respective thresholds are the current candidate terms deemed irrelevant to the current user role and the characteristics of the current scenario. The value is set to 1, which reduces the weight of its sorting score.

[0030] Preferably, step S4 further includes the following step: Determine the risk gain / loss of the current user role for the current candidate terms. Is it greater than or equal to the risk gain significance threshold? If not, the joint scoring function of the current candidate clauses No additional gain adjustment is performed; if so, the joint scoring function of the current candidate terms. The following value conditions must be met: ; in, Indicates the minimum allowable gain amplitude; This indicates the maximum allowable gain.

[0031] In this embodiment, the risk gain of the current user role for the current candidate terms is considered. Greater than or equal to the risk gain significance threshold At that time, by constraining the joint scoring function of the current candidate terms The range of values ​​is used to ensure that high-risk terms receive a significant ranking boost, while preventing excessive dominance of the ranking results.

[0032] Preferably, in step S5, the objective function of the current candidate clause subset A in the candidate clause set is... The mathematical expression is as follows: ; in, This represents the weighting coefficient of the basic relevance score; This represents the risk gain weighting coefficient; This represents the weighting coefficient for the coverage of risk dimensions; Indicates the coverage of risk dimensions. The specific calculation formula is as follows: ; Where h represents the risk dimension; Represents a set of risk dimensions; Indicates the weight of risk dimension h; This indicates the risk level of the current candidate clause c on the risk dimension h; Priority weighting coefficient between declaration obligations and prohibition clauses; The order of priority between obligations and prohibitions. The specific calculation formula is as follows: ; in, Indicates the modal type of the current candidate clause c; Indicates the redundancy penalty coefficient; This indicates that the current candidate clause c is compared with another candidate clause. The similarity between them; B represents the length of the current candidate clause c; B represents the budget limit, i.e., the maximum allowed size of the output.

[0033] In this embodiment, the objective function of the current subset A of candidate clauses in the candidate clause set is... In the computational logic, in " This ensures that the current subset of candidate terms satisfies both semantic relevance to the query and prioritizes candidate terms that pose a higher risk to the current user's role. "In this section, regarding the set of risk dimensions..." Each risk dimension If the current set of candidate terms If at least one candidate clause involves one of the risk dimensions, then the contribution is for that risk dimension. By increasing The system will tend to select a combination of candidate clauses that covers more diverse risk dimensions, thus avoiding the one-sided phenomenon of "focusing only on a single risk." This section allows you to compile statistics on the current set of candidate clauses. How many of the candidate clauses are either obligations or prohibitions? By increasing... The system will prioritize candidate clauses that are more standardized and have higher legal force, while relatively de-prioritizing permissive clauses. This section penalizes highly similar candidate clauses, encouraging the selection of diverse combinations of candidate clauses and avoiding the selection of too many duplicate or redundant items. "In this section, we can ensure that the size constraints are met while prioritizing the selection of more concise candidate clauses."

[0034] Preferably, in step S8, the structured list items of the final selected clause include risk level, applicable conditions, handling and precautions, and reference information; The specific formula for calculating the risk level is as follows: ; in, Indicates the final selected clause Risk level; Represents the sigmoid function; Indicates the risk level coefficient; A weight vector representing a user role of type r; Indicates the final selected clause The risk vector; Indicates the final selected clause Conditional predicate and current scene feature vector The degree of matching; Indicates risk level bias; The applicable conditions are specifically the predicate conditions extracted from the final selected clauses; The handling and precautions are expressions in the corresponding format generated using predefined rule templates, based on the modal type of the final selected clause and the action verbs in the final selected clause. When the modal type of the finally selected clause is a permission clause, the "optional operation" template is used to generate a statement in the format of "can be performed + action verb + condition"; When the modal type of the finally selected clause is an obligation clause, the "mandatory operation" template is used to generate a statement in the format of "must be performed + action verb + condition". When the modal type of the finally selected clause is a prohibited clause, the "prohibited operation" template is used to generate a statement in the format of "prohibited + action verb + condition". The cited information includes the clause number, sentence or line number, start and end positions, effective date, and expiration date.

[0035] In this embodiment, the risk level is calculated using a sigmoid function, combined with the user role weight vector, clause risk vector, and the matching degree between the clause conditional predicate and the current scenario, and then overlaid with a risk level bias term. This approach quantifies risk by utilizing the association dimension between roles and clauses, while the sigmoid function constrains the result to a reasonable range. The added bias term flexibly adapts to different scenarios. Applicable conditions are obtained by directly extracting the predicates from the clauses, allowing users to quickly understand the triggering scenarios of the clauses. Handling and precautions are generated by matching the modal types of "permission, obligation, and prohibition" with corresponding preset templates, reducing the user's understanding cost. Since the cited information includes clause number, sentence or line number, start and end positions, effective date, and expiration date, it provides auditors with complete traceability information, facilitating subsequent compliance verification.

[0036] Preferably, the method further includes the following steps: offline training of the joint scoring function, specifically including the following sub-steps: Based on the click, execution, and review records in the preset historical logs, construct positive and negative sample clause pairs. ; Construct the rearranger model, i.e., the parameters in the joint scoring function; Calculate the sorting loss function of the rearranger model. and minimize This allows the rearranger model to learn optimal parameters, achieving the goal of "prioritizing useful clauses and relegating irrelevant clauses to the next level." The specific calculation formula is as follows: ; in, Indicates positive sample terms The corresponding joint score; Indicates negative sample clause The corresponding joint score; This represents an exponential function.

[0037] In this embodiment, the joint scoring function is trained offline to better distinguish between high-quality and low-quality terms. Positive and negative sample terms are constructed based on click, execution, and review records from preset historical logs, ensuring their authenticity and representativeness by aligning them with real-world business scenarios. A reordering model is built and used as the parameter carrier for the joint scoring function, enabling it to dynamically optimize with data. By minimizing the reordering model's ranking loss function, the model is driven to prioritize positive sample terms, ensuring they score higher than negative sample terms, thus accurately reflecting users' actual term selection preferences during training.

[0038] To further explain, in order to ensure that high-risk clauses are not suppressed by low-risk clauses in the long term, a risk consistency regularization term is added to the ranking loss function. ,in, The specific calculation formula is as follows: ; in, High-risk candidate clauses The corresponding joint score; Indicates low-risk candidate terms The corresponding combined score, This represents the minimum interval threshold. This regularization term ensures that high-risk candidate clauses score at least higher than low-risk candidate clauses. This gap helps prevent the system from overlearning correlations and ignoring risk factors due to deviations in user click history.

[0039] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0040] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for retrieving compliance clauses based on user roles and scenarios, characterized in that: Includes the following steps: Step S1: Construct a mapping function between user roles, weight vectors, and domain terms, and obtain the weight vector and term preference vocabulary corresponding to the current user role based on the mapping function; Step S2: Obtain the user query statement and multi-source context, and extract the scene feature vector from them; Step S3: Based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from the preset compliance clauses library, and the risk vector of the current candidate clause in the candidate clause set and the suitability of the current candidate clause with the current user role and the current scenario are calculated. Step S4: Calculate the risk gain of the current user role for the current candidate clause based on the weight vector of the current user role, the risk vector of the current candidate clause, and the fit between the current candidate clause and the current user role and the current scenario; and construct a joint scoring function based on the risk gain. Step S5: Construct the objective function for each subset of candidate terms in the candidate term set, and under the preset budget constraint, use a lazy greedy algorithm to find the optimal subset of candidate terms that maximizes the objective function. Step S6: Based on the scene feature vector, the optimal candidate clause subset is pruned to obtain the pruned optimal candidate clause subset; Step S7: Based on the terminology preference vocabulary of the current user role, perform term replacement and expression optimization on the trimmed optimal candidate clause subset to obtain the final selected clause set; Step S8: Generate corresponding structured list items for each of the final selected terms in the final selected terms set, calculate the score of each structured list item according to the joint scoring function, and sort all structured list items in descending order of score to form the final retrieval output list.

2. The compliance clause retrieval method based on user roles and scenarios according to claim 1, characterized in that: In step S1, obtaining the weight vector corresponding to the current user role specifically includes the following sub-steps: If the current user's role is already defined, then the weight vector corresponding to the current user's role is used directly. If the current user role is not specified, then the prior mixed weights are calculated as the weight vector corresponding to the current user role. The specific calculation formula for the prior mixed weights is as follows: ; in, Indicates prior mixed weights; Represents the prior probability of a user role of type r; This represents the set of user role types; This represents the weight vector of a user role of type r. The specific calculation formula is as follows: ; in, Represents the weight matrix; Represents the bias vector; The feature vector representing a user role of type r; This represents the smooth activation function.

3. The compliance clause retrieval method based on user roles and scenarios according to claim 1, characterized in that: In step S3, based on the user's query, a multi-channel hybrid retrieval strategy is used to retrieve a set of candidate clauses from a preset compliance clauses database. This includes the following sub-steps: The BM25 sparse retrieval algorithm is used to perform term matching on the compliance clauses in the preset compliance clauses library, and the compliance clauses that highly match the keywords in the user's query are selected. At the same time, the BERT-based dense vector retrieval algorithm is used to perform semantic matching on the compliance clauses in the preset compliance clauses library, and the compliance clauses with the best semantic similarity to the user's query are selected to form a candidate clause set C.

4. The compliance clause retrieval method based on user roles and scenarios according to claim 2, characterized in that: In step S3, the specific formula for calculating the risk vector of the current candidate clause in the candidate clause set is as follows: ; in, This represents the risk vector of the current candidate clause c; Represents a risk multi-label classification vector. The specific acquisition steps are as follows: Construct a multi-label classifier based on clause text, tabular data, and historical accident labels. ; obtain The predicted probability of the risk dimension output by the current candidate clause c during the reasoning phase; Represents the consequence severity factor vector. The specific calculation formula is as follows: ; Where k represents the severity amplification factor; This indicates the severity of the consequences of the current candidate clause c; This represents the vector of legal modal intensity amplification factors. The specific calculation formula is as follows: ; in, This indicates the modal type of the current candidate clause c. When the modal type is licensed, The value is 0; when the modal type is Obligation, The value is 1; when the modal type is prohibited, The value is 2; This represents the modal amplification factor.

5. The compliance clause retrieval method based on user roles and scenarios according to claim 4, characterized in that: In step S3, the specific formula for calculating the suitability of the current candidate clause with the current user role and the current scenario is as follows: ; in, This indicates the suitability of the current candidate terms with the current user role and the current scenario; This represents the subject matching degree, that is, the mapping relationship between the subject entity in the current candidate clause c and the user role of type r. The specific calculation formula is as follows: ; in, This indicates that the Named Entity Recognition (NER) algorithm is used to select from the current candidate terms. The main entity set extracted from it. , , where n represents the total number of main entities; Let i represent the similarity function between the i-th subject entity and the user role of type r; This represents the condition satisfaction degree, i.e., the conditional predicate in the current candidate clause c and the feature vector of the current scenario. The degree of matching, The specific calculation formula is as follows: ; Where p represents the conditional predicate in the current candidate clause c; This represents the set of conditional predicates in the current candidate clause c; This represents the conditional predicate p in the current candidate clause c and the feature vector of the current scene. The matching function; Indicates an indicator function; Indicates the number of conditional predicates; Represents a local maximum function; This represents a validity indicator function used to determine whether the current time t is within the validity period of the current candidate clause c. If t is inside Inside, then The value is 1 if t is not present. Inside, then The value is 0.

6. The compliance clause retrieval method based on user roles and scenarios according to claim 5, characterized in that: In step S4, the specific formula for calculating the risk gain of the current user role for the current candidate clause is as follows: ; in, This indicates the risk gain or loss of the current user role relative to the current candidate terms; The specific mathematical expression of the joint scoring function is as follows: ; in, Represents the joint scoring function; Indicates the current candidate clause With user query statement Basic relevance score; This represents the risk gain weighting coefficient, used to control the strength of the influence of risk factors in the final ranking; This represents the irrelevance-based weighting coefficient, used to penalize terms that are incompatible with the user's role and context. This indicates irrelevant penalty items, used to identify and downgrade clauses where the subject entity and user role do not match, or where the predicate condition does not conform to the scene characteristics. The specific calculation formula is as follows: ; in, Indicates the subject matching degree threshold; This indicates the threshold for condition satisfaction.

7. The compliance clause retrieval method based on user roles and scenarios according to claim 6, characterized in that: Step S4 also includes the following steps: Determine the risk gain / loss of the current user role for the current candidate terms. Is it greater than or equal to the risk gain significance threshold? If not, the joint scoring function of the current candidate clauses No additional gain adjustment is performed; if so, the joint scoring function of the current candidate terms. The following value conditions must be met: ; in, Indicates the minimum allowable gain amplitude; This indicates the maximum allowable gain.

8. The compliance clause retrieval method based on user roles and scenarios according to claim 6, characterized in that: In step S5, the objective function of the current candidate clause subset A in the candidate clause set is... The mathematical expression is as follows: ; in, This represents the weighting coefficient of the basic relevance score; This represents the risk gain weighting coefficient; This represents the weighting coefficient for the coverage of risk dimensions; Indicates the coverage of risk dimensions. The specific calculation formula is as follows: ; Where h represents the risk dimension; Represents a set of risk dimensions; Indicates the weight of risk dimension h; This indicates the risk level of the current candidate clause c on the risk dimension h; Priority weighting coefficient between declaration obligations and prohibition clauses; The order of priority between obligations and prohibitions. The specific calculation formula is as follows: ; in, Indicates the modal type of the current candidate clause c; Indicates the redundancy penalty coefficient; This indicates that the current candidate clause c is compared with another candidate clause. The similarity between them; B represents the length of the current candidate clause c; B represents the budget limit, i.e., the maximum allowed size of the output.

9. The compliance clause retrieval method based on user roles and scenarios according to claim 1, characterized in that: In step S8, the structured list items for the final selected clause include risk level, applicable conditions, handling and precautions, and reference information; The specific formula for calculating the risk level is as follows: ; in, Indicates the final selected clause Risk level; Represents the sigmoid function; Indicates the risk level coefficient; The weight vector representing a user role of type r; Indicates the final selected clause The risk vector; Indicates the final selected clause Conditional predicate and current scene feature vector The degree of matching; Indicates risk level bias; The applicable conditions are specifically the predicate conditions extracted from the final selected clauses; The handling and precautions are expressions in the corresponding format generated using predefined rule templates, based on the modal type of the final selected clause and the action verbs in the final selected clause. When the modal type of the finally selected clause is a permission clause, the "optional operation" template is used to generate a statement in the format of "can be performed + action verb + condition"; When the modal type of the finally selected clause is an obligation clause, the "mandatory operation" template is used to generate a statement in the format of "must be performed + action verb + condition". When the modal type of the finally selected clause is a prohibited clause, the "prohibited operation" template is used to generate a statement in the format of "prohibited + action verb + condition". The cited information includes the clause number, sentence or line number, start and end positions, effective date, and expiration date.

10. The compliance clause retrieval method based on user roles and scenarios according to claim 1, characterized in that: It also includes the following steps: The joint scoring function is trained offline, which includes the following sub-steps: Based on the click, execution, and review records in the preset historical logs, construct positive and negative sample clause pairs. ; Construct the rearranger model, i.e., the parameters in the joint scoring function; Calculate the sorting loss function of the rearranger model. and minimize This allows the rearranger model to learn optimal parameters, achieving the goal of "prioritizing useful clauses and relegating irrelevant clauses to the next level." The specific calculation formula is as follows: ; in, Indicates positive sample terms The corresponding joint score; Indicates negative sample clause The corresponding joint score; This represents an exponential function.