Regulation and regulation data processing method and device
Through the intelligent judgment model of twin neural networks and convolutional neural networks and rewrite suggestions models, disassembly and detect similarities or contradictions of rules and regulations, the problem of insufficient detection accuracy and improvement suggestions in the existing technology is solved, and efficient regulations are achieved System data processing and user experience improvement.
Patent Information
- Application Number
- CN202411416623.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-10
AI Technical Summary
The existing rules and regulations data processing methods are difficult to accurately detect similarities or contradictions in rules and regulations, and lack intelligent improvement suggestions, so the user experience is poor.
An intelligent judgment model is adopted that combines the twin neural network module and the convolutional neural network module. By disassembling the rules and regulations to multiple clauses, eigenvector extraction and similarity judgment are performed, and modification suggestions are provided in combination with the rewrite suggestion model.
It improves the accuracy of detection of similar or contradictions in rules and regulations, reduces misjudgments and misjudgments, directly outputs reliable modification suggestions, and improves user experience.
Smart Images

Figure CN119293213A_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 processing rules and regulations data. 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, as they provide the basic framework and guiding principles for the operation of an organization. However, as the scale of an organization expands and its business becomes more complex, the number and complexity of rules and regulations are also increasing, which poses a huge challenge to the makers and managers of the rules and regulations.
[0004] There are several existing methods for processing regulatory data:
[0005] -Legal text review systems based on rule bases. This type of system reviews legal texts based on a predefined rule base. Although it has certain effects in specific areas, it is difficult to adapt to the rapid changes in rules and requires a lot of manual maintenance of the rule base.
[0006] - Traditional text editing and version control systems. These systems mainly provide text editing and version management functions and can track the modification history of documents, but lack intelligent conflict detection and suggestion functions.
[0007] -Text similarity detection systems based on keyword matching. This type of system detects potential conflicts by extracting keywords from texts and calculating the similarity between texts. However, this method can only detect literal similarities and is difficult to understand the deep semantics, which is prone to misjudgment or omission.
[0008] -Text classification systems based on machine learning: These systems use machine learning algorithms to classify text to identify potentially problematic terms. However, they often have difficulty providing specific suggestions for improvement and require users to make revisions again, resulting in a poor user experience. Summary of the invention
[0009] The embodiment of the present invention provides a method for processing rules and regulations data, which is used to improve the accuracy of detecting similarities or contradictions in rules and regulations, and to provide reliable modification suggestions to improve user experience. The method includes:
[0010] Break down the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested;
[0011] Input multiple clauses to be tested and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the clauses to be tested that need to be modified, and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the clauses to be tested and the preset clauses respectively; the similarity judgment module is used to determine whether the clauses to be tested and the preset clauses are similar according to the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations;
[0012] For each tested clause that needs to be modified: the tested clause that needs to be modified and the preset clauses that are similar or contradictory to the tested clause that needs to be modified are input into a rewriting suggestion model, and the modified tested clause is output; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
[0013] In one embodiment, the rules and regulations to be tested are decomposed into multiple clauses as the clauses to be tested and output, including: based on a preset decomposition method, the rules and regulations to be tested are decomposed into multiple clauses as the clauses to be tested and output; the preset decomposition method includes a decomposition method based on regular expression matching, or a decomposition method using a pre-trained deep learning model to identify.
[0014] In one embodiment, based on a preset decomposition method, the rules and regulations to be tested are decomposed into multiple clauses as the clauses to be tested, including: determining the symbol marks of the multiple clauses of the rules and regulations to be tested; constructing a regular expression according to the symbol marks; applying the regular expression to the text of the rules and regulations to be tested, and outputting the starting positions of the multiple clauses; dividing the text of the rules and regulations to be tested according to the starting positions of the multiple clauses to obtain multiple clauses to be tested.
[0015] In one embodiment, based on a preset disassembly method, the rules and regulations to be tested are disassembled into multiple clauses as the output clauses to be tested, including: inputting the text of the rules and regulations to be tested into a trained deep learning model, and outputting multiple clauses as the output clauses to be tested; the deep learning model is pre-: trained on a deep learning network model using existing rules and regulations and clauses that have been correctly disassembled from the existing rules and regulations, and the deep learning network model includes a bidirectional long short-term memory network or a Transformer model.
[0016] In one embodiment, the two sub-networks of the twin neural network module have multiple layers, and the two sub-networks share the same parameters and weights, and the layers include a word embedding layer, a convolutional layer, a recurrent layer and an output layer.
[0017] In one embodiment, the similarity judgment module is used to calculate the similarity value of the two feature vectors output by the twin neural network module through the Euclidean distance algorithm or the cosine similarity algorithm, and determine whether the test clause and the preset clause are similar through the similarity value.
[0018] In one embodiment, the convolutional neural network is pre-trained using a plurality of positive sample pairs and a plurality of negative sample pairs to train a neural network model of the SimCLRv2 architecture, wherein the positive sample pairs are non-contradictory clause pairs, and the negative sample pairs are contradictory clause pairs.
[0019] In one embodiment, the test clause that needs to be modified and the preset clauses that are similar to or contradictory to the test clause that needs to be modified are input into a rewriting suggestion model, and the modified test clause is output, including: inputting the test clause that needs to be modified and the preset clauses that are similar to or contradictory to the test clause that needs to be modified into the rewriting suggestion model; displaying the preset prompt data set check options and the custom prompt input interface to the user; the preset prompt data set includes descriptions and instructions for guiding the modification; receiving the options checked by the user and / or the information input by the user through the custom prompt input interface; inputting the options checked by the user and / or the information input by the user through the custom prompt input interface into the rewriting suggestion model, outputting the modified test clause, and displaying the modified test clause to the user.
[0020] The embodiment of the present invention further provides a rules and regulations data processing device, which is used to improve the accuracy of similarity or contradiction detection of rules and regulations, and to provide reliable modification suggestions to improve user experience. The device includes:
[0021] The clause decomposition module is used to decompose the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested;
[0022] A similarity and contradiction judgment module is used to input multiple clauses to be tested and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the clauses to be tested that need to be modified, and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the clauses to be tested and the preset clauses respectively; the similarity judgment module is used to determine whether the clauses to be tested and the preset clauses are similar according to the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations;
[0023] The clause modification module is used for each clause to be modified: inputting the clause to be modified and the preset clauses that are similar to or contradictory to the clause to be modified into a rewriting suggestion model, and outputting the modified clause to be tested; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
[0024] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for processing rules and regulations data when executing the computer program.
[0025] 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 above-mentioned method for processing rules and regulations data is implemented.
[0026] 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 above-mentioned rules and regulations data processing method is implemented.
[0027] In the embodiment of the present invention, when judging the clauses to be tested that are similar or contradictory to the existing rules and regulations, the twin neural network is first used to process the clauses to be tested and the preset conditions. The twin neural network is composed of two identical sub-networks, which can ensure that the clauses to be tested and the preset conditions are processed in the same way. After that, the features output by the two sub-networks are similar, and then the two features are further judged by comparative learning. Compared with the technical solution of simply matching keywords in the prior art, the judgment is more accurate, which improves the accuracy of similarity or conflict detection of rules and regulations. At the same time, according to the similarity and contradiction judgment results, the embodiment of the present invention uses a rewriting suggestion model to directly output the modified clauses to be tested. The rewriting suggestion model is adjusted based on the pre-trained large language model, and the output result is reliable, without the need for users to modify it themselves, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] 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:
[0029] Figure 1 A flowchart of a method for processing rules and regulations data in an embodiment of the present invention;
[0030] Figure 2 A diagram showing a specific example of a method for processing rules and regulations data in an embodiment of the present invention;
[0031] Figure 3 FIG. 2 is another specific example of the method for processing rules and regulations data in an embodiment of the present invention;
[0032] Figure 4 Schematic diagram of a rules and regulations data processing device in an embodiment of the present invention;
[0033] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] 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.
[0035] 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.
[0036] 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.
[0037] Figure 1 FIG. 1 is a flow chart of a method for processing rules and regulations data in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0038] Step 101, breaking down the rules and regulations to be tested into multiple clauses as output clauses to be tested;
[0039] Step 102: Input multiple test clauses and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the test clauses that need to be modified and the preset clauses that are similar to or contradictory to the test clauses that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the test clauses and the preset clauses respectively; the similarity judgment module is used to determine whether the test clauses and the preset clauses are similar according to the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory by comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations;
[0040] Step 103: for each tested clause that needs to be modified: input the tested clause that needs to be modified and the preset clauses that are similar to or contradictory to the tested clause that needs to be modified into a rewriting suggestion model, and output the modified tested clause; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
[0041] from Figure 1 It can be seen from the process shown that in the embodiment of the present invention, when judging the clauses to be tested that are similar or contradictory to the existing rules and regulations, the twin neural network is first used to process the clauses to be tested and the preset conditions. The twin neural network is composed of two identical sub-networks, which can ensure that the clauses to be tested and the preset conditions are processed in the same way. After that, the features output by the two sub-networks are similar, and then the two features are further judged by comparative learning. Compared with the technical solution of simply matching keywords in the prior art, the judgment is more accurate, which improves the accuracy of similarity or conflict detection of rules and regulations. At the same time, according to the similarity and contradiction judgment results, the embodiment of the present invention uses a rewriting suggestion model to directly output the modified clauses to be tested. The rewriting suggestion model is adjusted based on the pre-trained large language model, and the output result is reliable, without the need for users to modify it themselves, thereby improving the user experience.
[0042] Below Figure 1 The data processing methods in the regulations are explained in detail.
[0043] In an embodiment of the present invention, a user platform is constructed. Based on the user platform, the user can directly upload the rules and regulations to be tested to the corresponding interface. The background processes them based on the rules and regulations data processing method, and finally outputs the processing results and displays them to the user. The processing results displayed to the user include intermediate judgments, clauses that are similar or contradictory to existing rules and regulations, and modified clauses. The user does not need to perform too much operation, which greatly reduces the user's workload and improves the user experience.
[0044] When the method for processing rules and regulations data in the embodiment of the present invention is implemented, the rules and regulations to be tested are first broken down into multiple clauses as output clauses to be tested.
[0045] In one embodiment, the rules and regulations to be tested are decomposed into multiple clauses as the output of the clauses to be tested, which may include:
[0046] Based on a preset disassembly method, the rules and regulations to be tested are disassembled into multiple clauses as the output of the clauses to be tested; the preset disassembly method includes a disassembly method based on regular expression matching, or a disassembly method using a pre-trained deep learning model to identify and disassemble.
[0047] Based on the regular expression matching decomposition method, specifically using regular expressions to match common patterns of clauses, such as digital numbers, Chinese digital numbers, etc.
[0048] Figure 2 FIG. 1 is a specific example of a method for processing rules and regulations data in an embodiment of the present invention. Figure 2 As shown, based on the preset decomposition method, the rules and regulations to be tested are decomposed into multiple clauses as the output of the clauses to be tested, which may include:
[0049] Step 201, determining the symbol marks of multiple clauses of the rules and regulations to be tested;
[0050] Step 202: construct a regular expression according to the symbol mark;
[0051] Step 203: Apply the regular expression to the text of the rules and regulations to be tested, and output the starting positions of multiple clauses;
[0052] Step 204 , segment the text of the rules and regulations to be tested according to the starting positions of the multiple clauses to obtain multiple clauses to be tested.
[0053] During implementation, first determine what markers are used in the regulations to be tested to distinguish different clauses, such as Arabic numerals, Roman numerals, letters, or specific phrases such as Clause 1 or Article 1. Then, build a regular expression based on the symbol markers, use the regular expression to match the starting position of all clauses, and finally perform segmentation. The segmentation logic can use line breaks for segmentation.
[0054] In one embodiment, based on a preset disassembly method, the rules and regulations to be tested are disassembled into multiple clauses as the output clauses to be tested, which may include: inputting the text of the rules and regulations to be tested into a trained deep learning model, and outputting multiple clauses as the output clauses to be tested; the deep learning model is pre-: trained on a deep learning network model using existing rules and regulations and clauses that have been correctly disassembled from the existing rules and regulations, and the deep learning network model includes a bidirectional long short-term memory network or a Transformer model.
[0055] For example, use a pre-trained language model (such as BERT) to fine-tune a sequence labeling model to label each token in the input text as the beginning of a clause, clause content, or non-clause part. Or use a bidirectional long short-term memory network combined with a conditional random field to build a deep learning network model for clause decomposition.
[0056] The specific steps for clause disassembly are as follows:
[0057] 1. Data preprocessing: Clean the input text and remove extra spaces and special characters.
[0058] 2. Clause identification: Identify clause boundaries using the selected method (regular expressions or deep learning models).
[0059] 3. Clause extraction: Split the text into independent clauses based on the identified boundaries.
[0060] 4. Post-processing: Clean and format the extracted terms to ensure that each term is complete and meaningful.
[0061] The method based on regular expression matching and decomposition generally requires developers to have an in-depth understanding of text structure and rules, and needs to repeatedly adjust regular expressions. The method of using pre-trained deep learning model recognition and decomposition does not require manual feature design and is highly efficient and convenient, but it also takes time to train the model. Technical personnel in this field can choose the appropriate method according to actual conditions.
[0062] Afterwards, multiple clauses to be tested and multiple preset clauses in the rules and regulations library are input into the intelligent judgment model to determine the clauses to be tested that need to be modified and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified.
[0063] The rules and regulations library is the core data storage unit of the entire processing system. It stores multiple preset clauses obtained by disassembling existing rules and regulations. The specific implementation method of the rules and regulations library is as follows:
[0064] 1. Data collection: Collect all existing rules and regulations texts.
[0065] 2. Clause decomposition: Use the aforementioned clause decomposition method to decompose each rule and regulation.
[0066] 3. Data storage: Store the disassembled clauses in a vector database (such as Elasticsearch) to form a one-to-many relationship between "regulations-clauses".
[0067] 4. Vectorization: Use text2vec or other text vectorization methods to convert each term into vector form for storage.
[0068] In an embodiment of the present invention, the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module.
[0069] The twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the test clause and the preset clause respectively. In one embodiment, the two sub-networks of the twin neural network module have multiple layers, and the two sub-networks share the same parameters and weights. The layers include input layers, word embedding layers, convolutional layers, loop layers, and output layers, etc., which are used to extract feature representations of input data. If the two input data are similar, the sub-networks will respond similarly to the two inputs.
[0070] The similarity judgment module is used to determine whether the clause to be tested and the preset clause are similar based on the similarity of the two feature vectors output by the twin neural network module. In one embodiment, the similarity judgment module is used to calculate the similarity value of the two feature vectors output by the twin neural network module through the Euclidean distance algorithm or the cosine similarity algorithm, and determine whether the clause to be tested and the preset clause are similar through the similarity value. If the two inputs are similar, the distance between their feature vectors in space will be small; conversely, if the two inputs are not similar, the distance between their feature vectors will be large.
[0071] In one embodiment, the similarity judgment module may also perform an approximate nearest neighbor search in the rules and regulations library to find the top N terms that are most similar to the input terms.
[0072] The convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through contrastive learning. The goal of contrastive learning is to make similar pairs of terms close in the feature space and dissimilar pairs of terms far away in the feature space. In an embodiment of the present invention, the contrastive learning method of InfoNCE loss can be adopted, and by optimizing a loss function, the model can learn the similarities and differences between terms. At the same time, the convolutional neural network can further determine whether two features are similar or contradictory based on the results processed by the similarity judgment module.
[0073] In one embodiment, the convolutional neural network is pre-trained using a plurality of positive sample pairs and a plurality of negative sample pairs to train a neural network model of the SimCLRv2 architecture, wherein the positive sample pairs are non-contradictory clause pairs, and the negative sample pairs are contradictory clause pairs.
[0074] When training the neural network model of the SimCLRv2 architecture, different text processing techniques can be used to generate different versions of the terms, such as synonym replacement, sentence reorganization, random word replacement, word deletion, word insertion, etc., to create more positive sample pairs, and use the contrast loss function to optimize the model. The goal of the contrast loss function is to maximize the similarity between positive sample pairs in a given sample set, while minimizing the similarity between negative sample pairs. The neural network model of the SimCLRv2 architecture trains the model through contrastive learning, so that samples from the same category are closer in the embedding space, while samples from different categories are farther away.
[0075] Finally, for each tested clause that needs to be modified: the tested clause that needs to be modified and the preset clauses that are similar or contradictory to the tested clause that needs to be modified are input into a rewriting suggestion model, and the modified tested clause is output; the rewriting suggestion model is pre-adjusted based on a pre-trained large language.
[0076] For example, this can be achieved as follows:
[0077] 1. Construct prompt: Construct a prompt containing conflicting clause information for the large language model, and ask the model to give rewriting suggestions.
[0078] 2. Model reasoning: Send the constructed prompt to the large language model for reasoning.
[0079] 3. Result analysis: Analyze the model output and extract specific rewriting suggestions.
[0080] 4. Suggestion presentation: Rewriting suggestions are presented to users in a user-friendly manner.
[0081] The workflow of the entire processing system can be as follows:
[0082] 1. The user enters a new rules and regulations text.
[0083] 2. Break down the text of rules and regulations into independent clauses.
[0084] 3. For each broken down clause, search for similar clauses in the rules and regulations library.
[0085] 4. The intelligent judgment model analyzes whether there is a conflict between each clause and its similar clauses.
[0086] 5. Generate rewriting suggestions for conflicting clauses.
[0087] 6. Present conflict information and rewriting suggestions to the user.
[0088] 7. The user can modify the rules and regulations according to the system's suggestions and repeat the above steps until there are no conflicts.
[0089] In this case, by combining technologies such as rule basis, deep learning, vector retrieval and large language model, intelligent assistance is provided for the writing of rules and regulations, effectively improving the consistency and standardization of rules and regulations.
[0090] Figure 3 FIG. 2 is another specific example of the method for processing rules and regulations data in an embodiment of the present invention. Figure 3 As shown, the method includes:
[0091] Step 301: input the tested clause that needs to be modified and the preset clauses that are similar to or contradictory to the tested clause that needs to be modified into the rewriting suggestion model;
[0092] Step 302: Displaying the preset prompt data set check options and the custom prompt input interface to the user; the preset prompt data set includes descriptions and instructions for guiding modification;
[0093] Step 303: receiving options selected by the user and / or information input by the user through a custom prompt input interface;
[0094] Step 304: Input the options checked by the user and / or the information input by the user through the custom prompt input interface into the rewriting suggestion model, output the modified clause to be tested, and display the modified clause to be tested to the user.
[0095] In this example, the modification records of existing rules and regulations are collected in advance to form a preset prompt dataset. These prompts can be questions, descriptions, instructions, etc., which are used to guide the model to perform specific rewriting tasks. For each prompt, the corresponding original sentence and the expected rewriting result are prepared to form a prompt dataset.
[0096] In this example, prompt data check options are displayed to users, and users can directly check the options or enter the options themselves, which further improves the user experience.
[0097] In summary, the embodiments of the present invention have the following beneficial technical effects:
[0098] 1. High-precision semantic understanding: When breaking down clauses, by introducing a pre-trained large language model, we can deeply understand the semantic content of the clauses, greatly improve the accuracy of conflict detection, and effectively reduce misjudgments and missed judgments.
[0099] 2. Intelligent rewriting suggestions: The embodiments of the present invention can not only point out potential conflicts, but also generate specific rewriting suggestions using a large language model, greatly reducing labor costs.
[0100] 3. Strong adaptability: The combination of vectorized rules and regulations library and large language model makes the entire processing system highly adaptable and can quickly adapt to new rules and regulations environment without frequent updates of the rule base.
[0101] 4. Low data dependence: The embodiments of the present invention mainly rely on pre-trained large language models and general text vectorization technology, which greatly reduces the dependence on annotated data in specific fields.
[0102] 5. Comprehensive system considerations: By establishing a complete library of rules and regulations, the embodiments of the present invention can analyze and make recommendations within the framework of the overall system to ensure that the newly formulated system is consistent with the existing system.
[0103] 6. Highly efficient processing capability: Thanks to the high efficiency of vector retrieval and large language models, the embodiments of the present invention can quickly process a large number of rules and regulations to meet the needs of rapid review.
[0104] 7. Better explainability: Although a complex large language model is used, the embodiments of the present invention can provide clear explanations of conflict causes, rewriting suggestions and revised clauses, thereby improving the transparency of the decision-making process.
[0105] 8. Flexibility of modular design: Each processing step of the embodiment of the present invention can be designed in a modular manner. The modular design allows each functional module to be independently upgraded and optimized, thereby improving the maintainability and scalability of the entire processing system.
[0106] 9. Integration of multi-source technologies: By combining multiple technologies such as rule-based methods, deep learning, vector retrieval and large language models, the system achieves complementary advantages and provides more comprehensive and reliable auxiliary functions.
[0107] These advantages enable the intelligent rules and regulations writing assistance method of the embodiment of the present invention to effectively solve the problems existing in the prior art and provide a powerful tool support for the formulation and management of rules and regulations.
[0108] The present invention also provides a device for processing rules and regulations data, as described in the following embodiments. Since the principle of solving the problem by the device is similar to that of the method for processing rules and regulations data, the implementation of the device can refer to the implementation of the method for processing rules and regulations data, and the repeated parts will not be repeated.
[0109] Figure 4 FIG. 4 is a schematic diagram of a rules and regulations data processing device 400 according to an embodiment of the present invention. Figure 4 As shown, the device includes a clause disassembly module 401, a similarity and contradiction judgment module 402 and a clause modification module 403.
[0110] The clause decomposition module 401 is used to decompose the rules and regulations to be tested into multiple clauses as output clauses to be tested.
[0111] The similarity and contradiction judgment module 402 is used to input multiple clauses to be tested and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the clauses to be tested that need to be modified, and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the clauses to be tested and the preset clauses respectively; the similarity judgment module is used to determine whether the clauses to be tested and the preset clauses are similar based on the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations.
[0112] The clause modification module 403 is used to input the clause to be tested that needs to be modified and the preset clauses that are similar to or contradictory to the clause to be tested that needs to be modified into a rewriting suggestion model for each clause to be tested that needs to be modified, and output the modified clause to be tested; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
[0113] In one embodiment, the clause decomposition module 401 is specifically used to: based on a preset decomposition method, decompose the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested; the preset decomposition method includes a decomposition method based on regular expression matching, or a decomposition method using a pre-trained deep learning model to identify.
[0114] In one embodiment, the clause disassembly module 401 is specifically used to: determine the symbol marks of multiple clauses of the rules and regulations to be tested; construct a regular expression based on the symbol marks; apply the regular expression to the text of the rules and regulations to be tested, and output the starting positions of multiple clauses; split the text of the rules and regulations to be tested according to the starting positions of the multiple clauses to obtain multiple clauses to be tested.
[0115] In one embodiment, the clause decomposition module 401 is specifically used to: input the text of the rules and regulations to be tested into a trained deep learning model, and output multiple clauses as the output of the clauses to be tested; the deep learning model is pre-: trained on a deep learning network model using existing rules and regulations and clauses that have been correctly decomposed from the existing rules and regulations, and the deep learning network model includes a bidirectional long short-term memory network or a Transformer model.
[0116] In one embodiment, the two sub-networks of the twin neural network module have multiple layers, and the two sub-networks share the same parameters and weights, and the layers include a word embedding layer, a convolutional layer, a recurrent layer and an output layer.
[0117] In one embodiment, the similarity judgment module is used to calculate the similarity value of the two feature vectors output by the twin neural network module through the Euclidean distance algorithm or the cosine similarity algorithm, and determine whether the test clause and the preset clause are similar through the similarity value.
[0118] In one embodiment, the convolutional neural network is pre-trained using a plurality of positive sample pairs and a plurality of negative sample pairs to train a neural network model of the SimCLRv2 architecture, wherein the positive sample pairs are non-contradictory clause pairs, and the negative sample pairs are contradictory clause pairs.
[0119] In one embodiment, the clause modification module 403 is specifically used to: input the clause to be tested that needs to be modified, and the preset clauses that are similar to or contradictory to the clause to be tested that needs to be modified, into the rewriting suggestion model; display the preset prompt data set check options and the custom prompt input interface to the user; the preset prompt data set includes descriptions and instructions for guiding the modification; receive the options checked by the user, and / or the information input by the user through the custom prompt input interface; input the options checked by the user, and / or the information input by the user through the custom prompt input interface into the rewriting suggestion model, output the modified clause to be tested, and display the modified clause to be tested to the user.
[0120] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention further provides a computer device 500, including a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, wherein the processor 501 implements the above-mentioned rules and regulations data processing method when executing the computer program 503.
[0121] 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 above-mentioned method for processing rules and regulations data is implemented.
[0122] 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 above-mentioned rules and regulations data processing method is implemented.
[0123] In the embodiment of the present invention, when judging the clauses to be tested that are similar or contradictory to the existing rules and regulations, the twin neural network is first used to process the clauses to be tested and the preset conditions. The twin neural network is composed of two identical sub-networks, which can ensure that the clauses to be tested and the preset conditions are processed in the same way. After that, the features output by the two sub-networks are similar, and then the two features are further judged by comparative learning. Compared with the technical solution of simply matching keywords in the prior art, the judgment is more accurate, which improves the accuracy of similarity or conflict detection of rules and regulations. At the same time, according to the similarity and contradiction judgment results, the embodiment of the present invention uses a rewriting suggestion model to directly output the modified clauses to be tested. The rewriting suggestion model is adjusted based on the pre-trained large language model, and the output result is reliable, without the need for users to modify it themselves, thereby improving the user experience.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0128] 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 processing rules and regulations data, characterized in that: include: Break down the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested; Input multiple clauses to be tested and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the clauses to be tested that need to be modified, and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the clauses to be tested and the preset clauses respectively; the similarity judgment module is used to determine whether the clauses to be tested and the preset clauses are similar according to the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations; For each tested clause that needs to be modified: the tested clause that needs to be modified and the preset clauses that are similar or contradictory to the tested clause that needs to be modified are input into a rewriting suggestion model, and the modified tested clause is output; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
2. The method according to claim 1, characterized in that Break down the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested, including: Based on a preset disassembly method, the rules and regulations to be tested are disassembled into multiple clauses as the output of the clauses to be tested; the preset disassembly method includes a disassembly method based on regular expression matching, or a disassembly method using a pre-trained deep learning model to identify and disassemble.
3. The method according to claim 2, characterized in that Based on the preset decomposition method, the rules and regulations to be tested are decomposed into multiple clauses as the output of the clauses to be tested, including: Determine the symbolic notation for multiple clauses of the regulations to be tested; Build regular expressions based on symbolic tokens; Apply regular expressions to the text of the regulations to be tested and output the starting positions of multiple clauses; The text of the rules and regulations to be tested is divided according to the starting positions of the multiple clauses to obtain the multiple clauses to be tested.
4. The method according to claim 2, characterized in that Based on the preset decomposition method, the rules and regulations to be tested are decomposed into multiple clauses as the output of the clauses to be tested, including: The text of the rules and regulations to be tested is input into a trained deep learning model, and multiple clauses are output as the clauses to be tested; the deep learning model is pre-trained using the existing rules and regulations and the clauses that have been correctly disassembled from the existing rules and regulations to obtain a deep learning network model, and the deep learning network model includes a bidirectional long short-term memory network or a Transformer model.
5. The method according to claim 1, characterized in that The two sub-networks of the twin neural network module have multiple layers, and the two sub-networks share the same parameters and weights. The layers include a word embedding layer, a convolutional layer, a loop layer and an output layer.
6. The method according to claim 1, characterized in that The similarity judgment module is used to calculate the similarity value of the two feature vectors output by the twin neural network module through the Euclidean distance algorithm or the cosine similarity algorithm, and determine whether the clause to be tested and the preset clause are similar through the similarity value.
7. The method according to claim 1, characterized in that The convolutional neural network is pre-trained using a plurality of positive sample pairs and a plurality of negative sample pairs to train a neural network model of the SimCLRv2 architecture, wherein the positive sample pairs are non-contradictory clause pairs, and the negative sample pairs are contradictory clause pairs.
8. The method according to claim 1, characterized in that Input the tested clauses that need to be modified and the preset clauses that are similar or contradictory to the tested clauses that need to be modified into the rewriting suggestion model, and output the modified tested clauses, including: Inputting the tested clauses that need to be modified and the preset clauses that are similar to or contradictory to the tested clauses that need to be modified into the rewriting suggestion model; Show the user the preset prompt data set check options and the custom prompt input interface; the preset prompt data set includes descriptions and instructions for guiding modification; Receive options selected by the user and / or information entered by the user through a custom prompt input interface; The options checked by the user and / or the information input by the user through the custom prompt input interface are input into the rewriting suggestion model, the modified clause to be tested is output, and the modified clause to be tested is displayed to the user.
9. A rules and regulations data processing device, characterized in that: include: The clause decomposition module is used to decompose the rules and regulations to be tested into multiple clauses as the output of the clauses to be tested; A similarity and contradiction judgment module is used to input multiple clauses to be tested and multiple preset clauses in the rules and regulations library into the intelligent judgment model to determine the clauses to be tested that need to be modified, and the preset clauses that are similar to or contradictory to the clauses to be tested that need to be modified; the intelligent judgment model includes a twin neural network module, a similarity judgment module and a convolutional neural network module; the twin neural network module includes two identical sub-networks, and the two sub-networks are used to extract feature vectors of the clauses to be tested and the preset clauses respectively; the similarity judgment module is used to determine whether the clauses to be tested and the preset clauses are similar according to the similarity of the two feature vectors output by the twin neural network module; the convolutional neural network is used to determine whether the two feature vectors output by the twin neural network module are contradictory through comparative learning; the rules and regulations library includes multiple preset clauses obtained by disassembling existing rules and regulations; The clause modification module is used for each clause to be modified: inputting the clause to be modified and the preset clauses that are similar to or contradictory to the clause to be modified into a rewriting suggestion model, and outputting the modified clause to be tested; the rewriting suggestion model is pre-adjusted based on a pre-trained large language model.
10. 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 8 is implemented.
11. 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 8 is implemented.
12. 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 8 is implemented.