System rule text generation method and device
By splitting and similarity search of rule text, combining the conflict detection of knowledge graphs and large language models, the problems of low processing efficiency of rules and system text and inaccurate analysis results in the existing technology are solved, and efficient system review and Management support.
Patent Information
- Application Number
- CN202411490779.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-07
AI Technical Summary
In the existing technology, the processing efficiency of rules and system texts is low, the text analysis results are inaccurate, and conflict analysis cannot be provided during the system formulation process, resulting in inefficient system review.
By obtaining the original rule text provided by the user, splitting it, and obtaining multiple sub-rule texts. Then, each subrule text is calculated similarity with the subrule text in the rule database, and the subrule text that meets the preset similarity threshold is selected. Next, query the subrule text with the upper and lower relationships with the preliminary search results from the knowledge graph. Finally, the large language model is used to detect each subrule text and similar subrule text conflicts, eliminate conflict items, and generate the final rule text.
It improves the efficiency of processing rules texts, improves the accuracy of text analysis, realizes efficient system review, and provides strong support for the formulation and management of rules and regulations.
Smart Images

Figure CN119397004A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for generating system rule texts. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] In modern organizational management, the formulation and maintenance of rules and regulations are crucial. They provide the basic framework and guiding principles for the operation of the organization. However, with the expansion of organizational scale and the complexity of business, the number and complexity of rules and regulations are also increasing, which brings great challenges to the makers and managers of the rules and regulations. The existing technology has low efficiency in processing the text of rules and regulations, inaccurate text analysis results, and cannot provide conflict analysis in the process of rule formulation, resulting in low efficiency of system review and failure to provide support for the formulation and management of rules and regulations. Summary of the invention
[0004] The embodiment of the present invention provides a method for generating a system rule text, which is used to improve the processing efficiency of the rule text, improve the accuracy of text analysis, and realize efficient review of the system. The method includes:
[0005] Obtaining the original rule text provided by the user, splitting the original rule text to obtain multiple sub-rule texts after splitting;
[0006] Calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, and select multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule texts;
[0007] According to the first search result, other sub-rule texts that have a hierarchical relationship with the preliminary search result are queried from a pre-established knowledge graph as the second search result; the knowledge graph is constructed according to the hierarchical relationship between the sub-rule text and the original rule text;
[0008] According to the first search result and the second search result of each sub-rule text, a similar sub-rule text that is most similar to the corresponding sub-rule text is screened out;
[0009] A large language model is used to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, and the conflicting sub-rule text is eliminated to obtain the final sub-rule text after elimination, and the final rule text is generated based on the final sub-rule text.
[0010] The embodiment of the present invention also provides a device for generating a system rule text, which is used to improve the processing efficiency of the rule text, improve the accuracy of text analysis, and realize efficient review of the system. The device includes:
[0011] A sub-rule text acquisition module is used to acquire the original rule text provided by the user, split the original rule text, and obtain multiple sub-rule texts after splitting;
[0012] The first search result acquisition module is used to calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, and select multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule text;
[0013] A second search result acquisition module is used to query and obtain other sub-rule texts that have a superior-female relationship with the preliminary search result from a pre-established knowledge graph according to the first search result, as the second search result; the knowledge graph is constructed according to the superior-female relationship between the sub-rule text and the original rule text;
[0014] A similar sub-rule text determination module is used to screen out similar sub-rule texts that are most similar to the corresponding sub-rule text according to the first search result and the second search result of each sub-rule text;
[0015] The final rule text generation module is used to use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, eliminate the sub-rule text with conflicts, obtain the final sub-rule text after elimination, and generate the final rule text based on the final sub-rule text.
[0016] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating the system rule text when executing the computer program.
[0017] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating the above-mentioned system rule text is implemented.
[0018] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for generating the above-mentioned system rule text is implemented.
[0019] In an embodiment of the present invention, the original rule text provided by the user is obtained, the original rule text is split to obtain a plurality of sub-rule texts after the split; the similarity between each sub-rule text and the existing sub-rule text in the rule database is calculated, and a plurality of existing sub-rule texts that meet a preset similarity threshold are screened out as the first search result according to the similarity calculation result; the rule database is pre-established according to the historical rule text; according to the first search result, other sub-rule texts that have a superior-female relationship with the preliminary search result are queried from the pre-established knowledge graph as the second search result; the knowledge graph is constructed according to the superior-female relationship between the sub-rule text and the original rule text; according to the first search result and the second search result of each sub-rule text, the similar sub-rule text that is most similar to the corresponding sub-rule text is screened out; a large language model is used to perform conflict detection between each sub-rule text and the corresponding similar sub-rule text, and the sub-rule text with conflict is eliminated to obtain the final sub-rule text after elimination, and the final rule text is generated according to the final sub-rule text. In the above process, the embodiment of the present invention obtains sub-rule text through text splitting, and searches the sub-rule text twice in the rule database and the knowledge graph to improve the processing efficiency of the rule text and the accuracy of text analysis; screens out similar sub-rule texts that are most similar to the sub-rule text, and uses a large language model to perform conflict detection, thereby realizing conflict analysis in the process of system formulation, realizing efficient review of the system, and providing strong support for the formulation and management of rules and regulations. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0021] Figure 1 is a flow chart of a method for generating a system rule text in an embodiment of the present invention;
[0022] Figure 2 A flowchart of constructing a knowledge graph in an embodiment of the present invention;
[0023] Figure 3 This is a flow chart of conflict detection for a large language model according to an embodiment of the present invention;
[0024] Figure 4 Schematic diagram of a device for generating a system rule text in an embodiment of the present invention;
[0025] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0027] Figure 1 Flow chart of a method for generating a system rule text in an embodiment of the present invention, the method comprising:
[0028] Step 101, obtaining an original rule text provided by a user, splitting the original rule text to obtain a plurality of sub-rule texts after splitting;
[0029] Step 102, calculating the similarity between each sub-rule text and the existing sub-rule text in the rule database, and selecting multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule texts;
[0030] Step 103, based on the first search result, query from the pre-established knowledge graph to obtain other sub-rule texts that have a hyponymous relationship with the preliminary search result as the second search result; the knowledge graph is constructed based on the hyponymous relationship between the sub-rule text and the original rule text;
[0031] Step 104, based on the first search result and the second search result of each sub-rule text, screen out similar sub-rule texts that are most similar to the corresponding sub-rule text;
[0032] Step 105, using the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, eliminating the conflicting sub-rule text to obtain the final sub-rule text after elimination, and generating the final rule text according to the final sub-rule text.
[0033] Each step is described in detail below.
[0034] In step 101, an original rule text provided by a user is obtained, and the original rule text is split to obtain a plurality of sub-rule texts after the splitting.
[0035] In a specific embodiment, in the process of splitting the complete rule text input by the user into independent sub-rule texts, multiple splitting methods can be used. Regular expressions are used to match common patterns of sub-rule texts, such as digital numbers, Chinese digital numbers, etc. It is also possible to use a pre-trained sequence labeling model based on a deep learning method to label each token in the input rule text as a corresponding sub-rule text.
[0036] In one embodiment, before the original rule text is split, the following steps are included:
[0037] Remove blank characters and special characters from the original rule text to obtain the processed original rule text;
[0038] Split the original rule text into:
[0039] The processed original rule text is split to obtain multiple split sub-rule texts.
[0040] In a specific embodiment, the split sub-rule texts are cleaned and formatted to ensure that each sub-rule text is complete and meaningful.
[0041] In step 102, a similarity calculation is performed between each sub-rule text and existing sub-rule texts in a rule database, and multiple existing sub-rule texts that meet a preset similarity threshold are screened out as the first search result based on the similarity calculation result; the rule database is pre-established based on historical rule texts.
[0042] In one embodiment, before calculating the similarity between each sub-rule text and the existing sub-rule text in the rule database, the following steps are performed:
[0043] Convert each sub-rule text into a vector form to obtain a corresponding sub-rule vector; convert the existing sub-rule text in the rule database into a vector form to obtain a corresponding existing sub-rule vector;
[0044] Calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, including:
[0045] The similarity between the sub-rule vector and the existing sub-rule vectors in the rule database is calculated.
[0046] In a specific embodiment, the rule database is used to store the rule texts corresponding to the existing rules and regulations and the split sub-rule texts.
[0047] In step 103, based on the first search result, other sub-rule texts that have a hierarchical relationship with the preliminary search result are queried from a pre-established knowledge graph as the second search result; the knowledge graph is constructed based on the hierarchical relationship between the sub-rule text and the original rule text.
[0048] Figure 2 The flowchart of constructing a knowledge graph in an embodiment of the present invention is as follows. In one embodiment, the knowledge graph is constructed according to the upper and lower relationships between the sub-rule text and the original rule text, including:
[0049] Step 201, according to the original rule text and the multiple sub-rule texts after the splitting, determine the entity type of each sub-rule text after the splitting, and the relationship type between each sub-rule text and the original rule text; the entity type of the sub-rule text includes one or any combination of clauses, regulations, executive departments and responsibilities; the relationship type between each sub-rule text and the original rule text includes: belonging relationship, constraint relationship, association relationship and conflict relationship;
[0050] Step 202, according to the entity type of each sub-rule text and the relationship type between each sub-rule text and the original rule text, determine the hierarchical relationship between each sub-rule text and the original rule text, and construct a knowledge graph based on the hierarchical relationship.
[0051] In a specific embodiment, the process of constructing a knowledge graph includes:
[0052] a) Define entity types: such as clauses, regulations, departments, responsibilities, etc.
[0053] b) Define the relationship type: such as "belongs to", "constrained", "associated", "potentially conflicting", etc.
[0054] c) Extract entities and relations: Use natural language processing technology to obtain entity types and relationship types based on sub-rule texts and original rule texts.
[0055] d) Build a graph structure: Organize the extracted entities and relationships into a graph structure.
[0056] In step 104, based on the first search result and the second search result of each sub-rule text, similar sub-rule texts that are most similar to the corresponding sub-rule text are screened out.
[0057] In a specific embodiment, an approximate nearest neighbor search is performed in the rule database to retrieve multiple sub-rule texts that are most similar to the input sub-rule text. The relationship information in the knowledge graph is then used to expand the search results to include directly related sub-rule texts and potentially conflicting sub-rule texts.
[0058] In step 105, a large language model is used to perform conflict detection on each sub-rule text and a corresponding similar sub-rule text, and the sub-rule text with conflicts is eliminated to obtain the final sub-rule text after elimination, and a final rule text is generated according to the final sub-rule text.
[0059] In one embodiment, a large language model is used to perform conflict detection on each sub-rule text and a corresponding similar sub-rule text, including:
[0060] Construct a conflict prompt message between each sub-rule text and the corresponding similar sub-rule text, use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, and obtain the conflict detection result.
[0061] In a specific embodiment, the conflict detection process of the large language model is as follows:
[0062] First, construct a prompt for the large language model that contains the user input terms, retrieved similar terms, and related knowledge graph information. Prompt example: Based on the content in terms 1 and 2, analyze the possible conflicts between the two terms from the dimensions of semantic conflict, logical conflict, scope of application conflict, execution conflict, and regulatory compliance conflict. For each conflict, refer to the relationship in the knowledge graph for analysis. Then, evaluate the degree of the conflict.
[0063] Example 1:
[0064] Clause 1: The working hours of the company's employees shall not exceed 40 hours per week.
[0065] Clause 2: All departments must ensure that at least one employee is on duty during the weekends.
[0066] Analysis results:
[0067] 1. Semantic conflict: There is no obvious semantic conflict.
[0068] 2. Logical conflict: There is a potential logical conflict. If employees work on weekends, their weekly working hours may exceed 40 hours.
[0069] 3. Scope conflict: Clause 1 applies to all employees, while Clause 2 specifically refers to on-duty situations, and there is an overlap in scope.
[0070] 4. Implementation conflicts: In actual implementation, meeting the requirements of Clause 2 may violate the provisions of Clause 1, especially for small departments.
[0071] 5. Effective time conflict: Today’s date is [today]. Determine whether there is an effective time conflict.
[0072] Conflict Assessment:
[0073] The detected conflicts are evaluated using a large language model based on factors such as clause importance, regulatory enforceability, and scope of impact.
[0074] Figure 3 This is a flow chart of conflict detection by a large language model in an embodiment of the present invention. In one embodiment, conflict detection is performed on each sub-rule text and a corresponding similar sub-rule text using a large language model, and further includes:
[0075] Step 301, based on the conflict detection result, using the large language model to formulate rewriting suggestions, includes the following steps:
[0076] Step 302: If the conflict detection result is that there is no conflict, the large language model outputs a response that there is no conflict; if the conflict detection result is that there is a conflict, the large language model outputs a response that there is a conflict, analyzes the conflict detection result, and uses the large language model to make rewriting suggestions.
[0077] In a specific embodiment, when providing rewriting suggestions, the large language model is also used to provide rewriting suggestions for conflicting clauses. Construct a prompt: Construct a prompt for the large language model that contains conflicting clause information, conflict analysis results, and related knowledge graph information. The information in the knowledge graph is used to ensure that the rewriting suggestions meet the requirements of relevant regulations.
[0078] The present invention also provides a device for generating a system rule text, as described in the following embodiments. Since the principle of the device to solve the problem is similar to the method for generating a system rule text, the implementation of the device can refer to the implementation of the method for generating a system rule text, and the repeated parts will not be repeated.
[0079] Figure 4 Schematic diagram of a device 400 for generating a system rule text in an embodiment of the present invention, the device comprising:
[0080] The sub-rule text acquisition module 401 is used to acquire the original rule text provided by the user, split the original rule text, and obtain multiple sub-rule texts after the split;
[0081] The first search result acquisition module 402 is used to calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, and select multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule texts;
[0082] The second search result acquisition module 403 is used to query and obtain other sub-rule texts that have a superior-female relationship with the preliminary search result from a pre-established knowledge graph according to the first search result as the second search result; the knowledge graph is constructed according to the superior-female relationship between the sub-rule text and the original rule text;
[0083] A similar sub-rule text determination module 404 is used to screen out similar sub-rule texts that are most similar to the corresponding sub-rule text according to the first search result and the second search result of each sub-rule text;
[0084] The final rule text generation module 405 is used to use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, eliminate the sub-rule text with conflicts, obtain the final sub-rule text after elimination, and generate the final rule text according to the final sub-rule text.
[0085] In one embodiment, a text preprocessing module is further included, which is specifically used to:
[0086] Remove blank characters and special characters from the original rule text to obtain the processed original rule text;
[0087] Split the original rule text into:
[0088] The processed original rule text is split to obtain multiple split sub-rule texts.
[0089] In one embodiment, a text vectorization module is also included, which is specifically used to:
[0090] Convert each sub-rule text into a vector form to obtain a corresponding sub-rule vector; convert the existing sub-rule text in the rule database into a vector form to obtain a corresponding existing sub-rule vector;
[0091] Calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, including:
[0092] The similarity between the sub-rule vector and the existing sub-rule vectors in the rule database is calculated.
[0093] In one embodiment, the second search result acquisition module 403 is further used to:
[0094] According to the original rule text and the multiple sub-rule texts after the splitting, determine the entity type of each sub-rule text after the splitting, and the relationship type of each sub-rule text with the original rule text; the entity type of the sub-rule text includes one or any combination of clauses, regulations, executive departments and responsibilities; the relationship type of each sub-rule text with the original rule text includes: belonging relationship, constraint relationship, association relationship and conflict relationship;
[0095] According to the entity type of each sub-rule text and the relationship type between each sub-rule text and the original rule text, the hierarchical relationship between each sub-rule text and the original rule text is determined, and a knowledge graph is constructed based on the hierarchical relationship.
[0096] In one embodiment, the final rule text generation module 405 is specifically used to:
[0097] Construct conflict prompt information between each sub-rule text and the corresponding similar sub-rule text, use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, and obtain the conflict detection result.
[0098] In one embodiment, the final rule text generation module 405 is further used to:
[0099] Based on the conflict detection results, a large language model is used to formulate rewriting suggestions, including the following steps:
[0100] If the conflict detection result is that there is no conflict, the large language model outputs a response that there is no conflict;
[0101] If the conflict detection result is that there is a conflict, the large language model outputs a reply with the conflict, analyzes the conflict detection result, and uses the large language model to make rewriting suggestions.
[0102] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0103] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0104] An embodiment of the present invention further provides a computer device, Figure 5 It is a schematic diagram of a computer device in an embodiment of the present invention. The computer device 500 includes a memory 510, a processor 520, and a computer program 530 stored in the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 530, the method for generating the above-mentioned system rule text is implemented.
[0105] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating the above-mentioned system rule text is implemented.
[0106] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for generating the above-mentioned system rule text is implemented.
[0107] In an embodiment of the present invention, the original rule text provided by the user is obtained, the original rule text is split to obtain a plurality of sub-rule texts after the split; the similarity between each sub-rule text and the existing sub-rule text in the rule database is calculated, and a plurality of existing sub-rule texts that meet a preset similarity threshold are screened out as the first search result according to the similarity calculation result; the rule database is pre-established according to the historical rule text; according to the first search result, other sub-rule texts that have a superior-female relationship with the preliminary search result are queried from the pre-established knowledge graph as the second search result; the knowledge graph is constructed according to the superior-female relationship between the sub-rule text and the original rule text; according to the first search result and the second search result of each sub-rule text, the similar sub-rule text that is most similar to the corresponding sub-rule text is screened out; a large language model is used to perform conflict detection between each sub-rule text and the corresponding similar sub-rule text, and the sub-rule text with conflict is eliminated to obtain the final sub-rule text after elimination, and the final rule text is generated according to the final sub-rule text. In the above process, the embodiment of the present invention obtains sub-rule text through text splitting, and searches the sub-rule text twice in the rule database and the knowledge graph to improve the processing efficiency of the rule text and the accuracy of text analysis; screens out similar sub-rule texts that are most similar to the sub-rule text, and uses a large language model to perform conflict detection, thereby realizing conflict analysis in the process of system formulation, realizing efficient review of the system, and providing strong support for the formulation and management of rules and regulations.
[0108] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0109] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0110] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0112] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating a system rule text, characterized in that: include: Obtaining the original rule text provided by the user, splitting the original rule text to obtain multiple sub-rule texts after splitting; Calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, and select multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule texts; According to the first search result, other sub-rule texts that have a hierarchical relationship with the preliminary search result are queried from a pre-established knowledge graph as the second search result; the knowledge graph is constructed according to the hierarchical relationship between the sub-rule text and the original rule text; According to the first search result and the second search result of each sub-rule text, a similar sub-rule text that is most similar to the corresponding sub-rule text is screened out; A large language model is used to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, and the conflicting sub-rule text is eliminated to obtain the final sub-rule text after elimination, and the final rule text is generated based on the final sub-rule text.
2. The method according to claim 1, characterized in that Before splitting the original rule text, include: Remove blank characters and special characters from the original rule text to obtain the processed original rule text; Split the original rule text into: The processed original rule text is split to obtain multiple split sub-rule texts.
3. The method according to claim 1, characterized in that Before calculating the similarity between each sub-rule text and the existing sub-rule text in the rule database, the following steps are performed: Convert each sub-rule text into a vector form to obtain a corresponding sub-rule vector; convert the existing sub-rule text in the rule database into a vector form to obtain a corresponding existing sub-rule vector; Calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, including: The similarity between the sub-rule vector and the existing sub-rule vectors in the rule database is calculated.
4. The method according to claim 1, characterized in that The knowledge graph is constructed based on the hierarchical relationship between the sub-rule text and the original rule text, including: According to the original rule text and the multiple sub-rule texts after the splitting, determine the entity type of each sub-rule text after the splitting, and the relationship type of each sub-rule text with the original rule text; the entity type of the sub-rule text includes one or any combination of clauses, regulations, executive departments and responsibilities; the relationship type of each sub-rule text with the original rule text includes: belonging relationship, constraint relationship, association relationship and conflict relationship; According to the entity type of each sub-rule text and the relationship type between each sub-rule text and the original rule text, the hierarchical relationship between each sub-rule text and the original rule text is determined, and a knowledge graph is constructed based on the hierarchical relationship.
5. The method according to claim 1, characterized in that Use the large language model to perform conflict detection between each sub-rule text and the corresponding similar sub-rule text, including: Construct conflict prompt information between each sub-rule text and the corresponding similar sub-rule text, use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, and obtain the conflict detection result.
6. The method according to claim 1, characterized in that Using the large language model to perform conflict detection between each sub-rule text and the corresponding similar sub-rule text, it also includes: Based on the conflict detection results, a large language model is used to formulate rewriting suggestions, including the following steps: If the conflict detection result is that there is no conflict, the large language model outputs a response that there is no conflict; If the conflict detection result is that there is a conflict, the large language model outputs a reply with the conflict, analyzes the conflict detection result, and uses the large language model to make rewriting suggestions.
7. A device for generating a system rule text, characterized in that: include: A sub-rule text acquisition module is used to acquire the original rule text provided by the user, split the original rule text, and obtain multiple sub-rule texts after splitting; The first search result acquisition module is used to calculate the similarity between each sub-rule text and the existing sub-rule text in the rule database, and select multiple existing sub-rule texts that meet a preset similarity threshold as the first search result according to the similarity calculation result; the rule database is pre-established based on the historical rule text; A second search result acquisition module is used to query and obtain other sub-rule texts that have a superior-female relationship with the preliminary search result from a pre-established knowledge graph according to the first search result, as the second search result; the knowledge graph is constructed according to the superior-female relationship between the sub-rule text and the original rule text; A similar sub-rule text determination module is used to screen out similar sub-rule texts that are most similar to the corresponding sub-rule text according to the first search result and the second search result of each sub-rule text; The final rule text generation module is used to use the large language model to perform conflict detection on each sub-rule text and the corresponding similar sub-rule text, eliminate the sub-rule text with conflicts, obtain the final sub-rule text after elimination, and generate the final rule text based on the final sub-rule text.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Knowledge base conflict decision-making system and method
CN121117236A