A disciplinary case auxiliary review method, device and equipment based on RAG technology and a storage medium
By using RAG technology to extract disciplinary elements and generate semantic vectors in disciplinary cases, candidate provisions are screened and similar cases are cited, solving the accuracy problem of exceptions in traditional disciplinary cases and achieving more accurate disciplinary auxiliary results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG POWER GRID CO LTD INFORMATION CENT
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-10
Smart Images

Figure CN122364765A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, equipment and storage medium for assisting in the review of disciplinary cases based on RAG technology. Background Technology
[0002] As the scale and complexity of data in disciplinary inspection work continue to rise, disciplinary inspection personnel need to process massive amounts of heterogeneous data from multiple sources, such as interview transcripts and audit reports, while also accurately matching them with dynamically updated Party discipline regulations. The efficiency and accuracy of traditional manual review methods can no longer meet practical needs. Large-scale models, with their powerful data processing and analysis capabilities, have become a key technological support for improving the efficiency and quality of disciplinary inspection work.
[0003] When traditional large-scale models are applied to the field of discipline inspection, they are based on the similarity between legal provisions and cases, and disciplinary action is taken according to the legal provisions. However, for cases involving common exceptions in discipline inspection reviews, such as cases with significantly minor offenses, voluntary confessions, or meritorious service, rigidly applying only the matching legal provisions to determine disciplinary action can lead to problems such as misinterpretation of the provisions and imprecise reasoning of evidence, thus affecting the accuracy of the auxiliary results of disciplinary action. Summary of the Invention
[0004] This invention provides a method, apparatus, equipment, and storage medium for assisting in the review of disciplinary cases based on RAG technology, which can solve the problem of low accuracy of disciplinary assistance results in the prior art.
[0005] To address the aforementioned technical problems, this invention provides a method for assisting in the review of disciplinary cases based on RAG technology, comprising: Various disciplinary elements are extracted from the disciplinary cases to be analyzed, and several semantic vectors of disciplinary elements are generated based on each disciplinary element. Based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, and the legal provisions with a semantic distance less than the preset distance threshold are identified as candidate disciplinary provisions. When there are preset exception clauses in the candidate disciplinary provisions, several reference cases with a case similarity greater than a preset similarity threshold with the disciplinary case to be analyzed are selected from several historical cases corresponding to the preset exception clauses. Disciplinary features are generated based on each disciplinary element and each reference case. The disciplinary characteristics are input into a preset disciplinary prediction model so that the preset disciplinary prediction model outputs auxiliary disciplinary results for the disciplinary cases to be analyzed.
[0006] As a preferred option, the types of disciplinary elements include: type of violation, degree of violation, rank of the person in charge, time of violation, geographical area of violation, consequences and impact, subjective attitude and type of evidence. When the types of disciplinary elements include violation type, violation degree, principal rank, violation time, violation location, consequences, subjective attitude, and evidence type, each disciplinary element corresponds to a preset semantic database; the preset semantic database includes preset text segments corresponding to the disciplinary element under different circumstances; the extraction of various disciplinary elements from the disciplinary cases to be analyzed, and the generation of several disciplinary element semantic vectors based on each disciplinary element, includes: Semantic segmentation is performed on the disciplinary inspection cases to be analyzed, resulting in several text fragments to be analyzed; For each text segment to be analyzed, the text segment to be analyzed is compared with all preset text segments, and the similarity between the text segment to be analyzed and each preset text segment is calculated. The preset text segments with a similarity exceeding the first similarity are selected as candidate text segments; the candidate text segment with the highest similarity is selected as the target text segment. The situation corresponding to the target text segment is used as the quantitative element of the text segment to be analyzed; By using a pre-defined semantic encoding model, each quantitative and chronological element is vectorized to obtain several semantic vectors for quantitative and chronological elements.
[0007] As a preferred option, the types of disciplinary elements also include the nature of the violation; When the type of disciplinary factor also includes the nature of the violation, the nature of the violation in the disciplinary case to be analyzed is determined by the following methods: Based on the subject of the disciplinary violation in the disciplinary case to be analyzed, the historical disciplinary violation records of the subject are retrieved from the preset historical case database; When historical disciplinary records are retrieved, the nature of the disciplinary violation in the case to be analyzed is determined to be multiple violations. When no historical records of disciplinary violations are found, the nature of the disciplinary violation in the case to be analyzed is determined to be the first violation.
[0008] As a preferred approach, based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, including: Extract several quantitative elements from each legal provision; The preset semantic coding model is used to vectorize each article's quantitative elements, resulting in several semantic vectors for the article's quantitative elements. For each legal provision, the semantic vector of each provision’s quantitative and disciplinary element is matched with the semantic vector of each quantitative and disciplinary element. The semantic vectors of the provisions’ quantitative and disciplinary elements of the same type and the semantic vectors of the quantitative and disciplinary elements are determined as the first semantic vector group. Calculate the cosine similarity within the first group of each first semantic vector group; The mean of the cosine similarities within all cases in the first group is used as the semantic distance between the disciplinary cases to be analyzed and the legal provisions.
[0009] As a preferred embodiment, from a number of historical cases corresponding to the preset exception clauses, several reference cases with a case similarity greater than a preset similarity threshold to the disciplinary inspection case to be analyzed are selected, including: Identify several historical cases corresponding to the preset exception clause in a preset historical case database; Extract several historical quantitative elements from each historical case; The preset semantic encoding model is used to vectorize each historical period element to obtain several semantic vectors of historical period elements. For each historical case, the semantic vectors of each historical statute element are matched with the semantic vectors of each statute element, and the semantic vectors of historical statute elements and statute elements of the same statute element type are determined as the second semantic vector group. Calculate the cosine similarity within the second group of each second semantic vector group; The mean of all cosine similarities within the second group is determined as the case similarity between the disciplinary inspection case to be analyzed and historical cases; Historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
[0010] As a preferred embodiment, before inputting the disciplinary characteristics into a preset disciplinary prediction model, and before the preset disciplinary prediction model outputs the disciplinary auxiliary results for the disciplinary cases to be analyzed, the method further includes: When there are no pre-defined exceptions in the candidate disciplinary provisions, obtain the case citation frequency, time-limited application scope, and geographical application scope of each candidate disciplinary provision; The time value corresponding to the violation time of the discipline inspection case to be analyzed is compared with the statute of limitations of each candidate disciplinary provision, and the regional value corresponding to the violation region of the discipline inspection case to be analyzed is compared with the regional scope of application of each candidate disciplinary provision. Candidate quantitative provisions whose applicable time range includes the time value and whose applicable geographical range includes the geographical value are determined as preferred quantitative provisions. For each preferred disciplinary provision, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provision with the disciplinary elements of the disciplinary case to be analyzed. Based on preset weights, the frequency of case citations, the degree of matching of quantitative and disciplinary elements, and the semantic distance between each preferred quantitative and disciplinary provision and the legal provisions are weighted and summed to obtain a comprehensive matching score for each preferred quantitative and disciplinary provision. The best-performing quantitative and disciplinary provision with the highest overall matching score is selected as the most applicable quantitative and disciplinary provision. Generate quantitative characteristics based on each quantitative element and the applicable quantitative provisions.
[0011] As a preferred approach, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, including: By comparing the disciplinary elements of the selected disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, the intersection and union of the elements are obtained. The ratio between the number of elements in the intersection of elements and the number of elements in the union of elements is determined as the degree of element matching.
[0012] Accordingly, the present invention provides a disciplinary case auxiliary review device based on RAG technology, including: an element extraction module, a clause screening module, a disciplinary feature generation module, and a disciplinary prediction module; The element extraction module is used to extract various quantitative and disciplinary elements from the disciplinary cases to be analyzed, and to generate several quantitative and disciplinary element semantic vectors based on each quantitative and disciplinary element. The article filtering module is used to calculate the semantic distance between the discipline inspection case to be analyzed and each legal article in the preset RAG knowledge base based on the semantic vector of each disciplinary element, and to determine the legal articles with a semantic distance less than the preset distance threshold as candidate disciplinary articles. The disciplinary feature generation module is used to select several reference cases from several historical cases corresponding to the preset exception clauses when there are preset exception clauses in the candidate disciplinary clauses. The reference cases have a case similarity greater than a preset similarity threshold with the disciplinary case to be analyzed. The module generates disciplinary features based on each disciplinary element and each reference case. The disciplinary assessment prediction module is used to input the disciplinary characteristics into a preset disciplinary assessment prediction model, so that the preset disciplinary assessment prediction model outputs auxiliary disciplinary assessment results for the disciplinary cases to be analyzed.
[0013] The present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the steps of the method for assisting in the review of disciplinary cases based on RAG technology of the present invention.
[0014] The present invention also provides a computer-readable storage medium item, comprising: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform the steps of the disciplinary inspection case auxiliary review method based on RAG technology of the present invention.
[0015] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention provides a method for assisting in the review of disciplinary cases based on RAG technology. It extracts various disciplinary elements from the disciplinary case to be analyzed and generates several semantic vectors for each element. Based on these semantic vectors, it calculates the semantic distance between the disciplinary case and various legal provisions in a pre-defined RAG knowledge base, and identifies legal provisions with a semantic distance less than a pre-defined distance threshold as candidate disciplinary provisions. When a pre-defined exception provision exists among the candidate provisions, it selects several reference cases from several historical cases corresponding to the exception provision whose case similarity to the disciplinary case to be analyzed is greater than a pre-defined similarity threshold. It then generates disciplinary features based on each disciplinary element and each reference case. Finally, it inputs these disciplinary features into a pre-defined disciplinary prediction model, enabling the model to output disciplinary assistance results for the disciplinary case to be analyzed. This invention uses the semantic vector of the disciplinary elements of the disciplinary case to be analyzed to select several candidate disciplinary provisions from a pre-set RAG knowledge base. If a pre-set exception provision exists among the candidate disciplinary provisions, the current disciplinary case to be analyzed is considered an exception case and is not subject to general legal provisions. Therefore, the historical case corresponding to the pre-set exception provision is determined as a reference case for the disciplinary case to be analyzed, so as to combine the disciplinary results of the reference case to make disciplinary predictions. This covers cases with exception circumstances and can effectively improve the accuracy of disciplinary auxiliary results. Attached Figure Description
[0016] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating an embodiment of the RAG-based auxiliary review method for disciplinary inspection cases provided by the present invention; Figure 2 This is a schematic diagram of one embodiment of the auxiliary review device for disciplinary cases based on RAG technology provided by the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0020] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0021] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0022] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0023] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0024] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0025] See Figure 1To address the issue of low accuracy in disciplinary investigation auxiliary results in existing technologies, an embodiment of the present invention provides a method for auxiliary review of disciplinary cases based on RAG technology. This method includes steps 101 to 104, each step being as follows: Step 101: Extract various quantitative and disciplinary elements from the disciplinary cases to be analyzed, and generate several semantic vectors of quantitative and disciplinary elements based on each quantitative and disciplinary element.
[0026] In this embodiment of the invention, extracting disciplinary elements is to transform the vague and fragmented facts of the disciplinary cases to be analyzed into standardized, comparable, and quantifiable disciplinary bases. These disciplinary elements include: type of violation, degree of violation, rank of the person in charge, time of violation, geographical location of violation, consequences, subjective attitude, type of evidence, and nature of violation.
[0027] In this embodiment of the invention, the types of violations include bribery and abuse of power, which are core qualitative elements. The degree of violation refers to the severity of the circumstances, which is a core element for determining disciplinary action. The subject's rank includes leading cadres, key positions, and ordinary personnel, used to adapt to hierarchical disciplinary rules; different responsibilities and authorities result in different disciplinary liabilities and impacts. The time and location of the violation are used to match the applicable legal provisions, avoiding provisions that are incompatible with timeliness or geographical scope. The consequences include economic losses, political impact, public opinion, damage to the interests of the masses, and harm to the leadership and team; the more serious the consequences, the heavier the disciplinary action, directly reflecting the objective harm. Subjective attitude includes intentional violation and voluntary admission of wrongdoing, reflecting subjective malice and an attitude of admitting and repenting, and is an important basis for leniency, mitigation, aggravation, or punishment. The types of evidence include documentary evidence, physical evidence, witness testimony, personal confessions, and expert opinions; the sufficiency of the evidence directly affects the reliability of the fact-finding, thus determining whether a conviction can be made and the severity of the disciplinary action.
[0028] As a preferred embodiment, the types of disciplinary elements include: type of violation, degree of violation, rank of the subject, time of violation, geographical area of violation, consequences, subjective attitude, and type of evidence. When the types of disciplinary elements include violation type, violation degree, principal rank, violation time, violation location, consequences, subjective attitude, and evidence type, each disciplinary element corresponds to a preset semantic database; the preset semantic database includes preset text segments corresponding to the disciplinary element under different circumstances; the extraction of various disciplinary elements from the disciplinary cases to be analyzed, and the generation of several disciplinary element semantic vectors based on each disciplinary element, includes: Semantic segmentation is performed on the disciplinary inspection cases to be analyzed, resulting in several text fragments to be analyzed; For each text segment to be analyzed, the text segment to be analyzed is compared with all preset text segments, and the similarity between the text segment to be analyzed and each preset text segment is calculated. The preset text segments with a similarity exceeding the first similarity are selected as candidate text segments; the candidate text segment with the highest similarity is selected as the target text segment. The situation corresponding to the target text segment is used as the quantitative element of the text segment to be analyzed; By using a pre-defined semantic encoding model, each quantitative and chronological element is vectorized to obtain several semantic vectors for quantitative and chronological elements.
[0029] In this embodiment of the invention, the disciplinary elements such as type of violation, degree of violation, rank of the subject, time of violation, region of violation, consequences, subjective attitude and type of evidence can be obtained by matching with a preset semantic database corresponding to each disciplinary element.
[0030] Specifically, each preset semantic database includes preset text segments corresponding to the disciplinary elements under different scenarios. For example, the preset semantic database for disciplinary types includes semantic descriptions of various scenarios such as bribery and abuse of power.
[0031] To extract disciplinary elements, the first step is to semantically segment the disciplinary case to be analyzed, resulting in multiple text fragments. For each text fragment, it is compared with all preset text segments in each preset semantic database. The similarity between the text fragment and each preset text segment is calculated. When the similarity exceeds a first similarity threshold, the text fragment is considered to contain valid information from which disciplinary elements can be extracted. Therefore, the preset text segments corresponding to these similarities are identified as candidate text segments. Further, the candidate text segment with the highest similarity among these candidate text segments is identified as the target text segment, and the situation corresponding to the target text segment is taken as the disciplinary element of the text fragment to be analyzed.
[0032] After extracting the disciplinary elements such as type of violation, degree of violation, rank of the person in charge, time of violation, region of violation, consequences and impact, subjective attitude and type of evidence, the disciplinary elements are vectorized using a pre-set semantic coding model to obtain the semantic vector of each disciplinary element.
[0033] As a preferred embodiment, the types of disciplinary elements also include the nature of the violation; When the type of disciplinary factor also includes the nature of the violation, the nature of the violation in the disciplinary case to be analyzed is determined by the following methods: Based on the subject of the disciplinary violation in the disciplinary case to be analyzed, the historical disciplinary violation records of the subject are retrieved from the preset historical case database; When historical disciplinary records are retrieved, the nature of the disciplinary violation in the case to be analyzed is determined to be multiple violations. When no historical records of disciplinary violations are found, the nature of the disciplinary violation in the case to be analyzed is determined to be the first violation.
[0034] In this embodiment of the invention, the disciplinary element of the nature of the violation needs to be determined in conjunction with the analysis of historical cases. Specifically, the subject of the violation in the disciplinary case to be analyzed is first identified. The subject's historical violation records are then retrieved from a pre-set historical case database. If a historical violation record is found, it indicates that the current disciplinary case to be analyzed is not the subject's first violation; therefore, the nature of the violation in the disciplinary case to be analyzed is determined to be a multiple violation. If no historical violation record is found in the pre-set historical case database, it indicates that the current disciplinary case to be analyzed is the subject's first violation; therefore, the nature of the violation in the disciplinary case to be analyzed is determined to be a first-time violation.
[0035] In this embodiment of the invention, determining whether the current disciplinary case to be analyzed is a first-time violation or a repeated violation serves to differentiate the severity of the offense. First-time and repeated violations exhibit similar behaviors, but their severity differs significantly. Therefore, it is necessary to assign differentiated weights to first-time and repeated violations to provide accurate data support for adjusting the disciplinary prediction results.
[0036] Step 102: Based on the semantic vectors of each disciplinary element, calculate the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base, and determine the legal provisions with a semantic distance less than the preset distance threshold as candidate disciplinary provisions.
[0037] In this embodiment of the invention, RAG (Retrieval-Augmented Generation) technology is a technical framework that combines information retrieval with large language model generation. By using an external knowledge base, the large model first retrieves real-world knowledge from external sources, and then generates answers based on the retrieval results, making the model output more accurate, reliable, and relevant to the domain. The RAG knowledge base is a database specifically designed to store and manage external knowledge within the RAG technology framework.
[0038] As a preferred embodiment, based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, including: Extract several quantitative elements from each legal provision; The preset semantic coding model is used to vectorize each article's quantitative elements, resulting in several semantic vectors for the article's quantitative elements. For each legal provision, the semantic vector of each provision’s quantitative and disciplinary element is matched with the semantic vector of each quantitative and disciplinary element. The semantic vectors of the provisions’ quantitative and disciplinary elements of the same type and the semantic vectors of the quantitative and disciplinary elements are determined as the first semantic vector group. Calculate the cosine similarity within the first group of each first semantic vector group; The mean of the cosine similarities within all cases in the first group is used as the semantic distance between the disciplinary cases to be analyzed and the legal provisions.
[0039] In this embodiment of the invention, the RAG knowledge base contains multiple legal provisions, which serve as the basis for disciplinary action. To determine which legal provision applies to a case to be analyzed, it is necessary to first identify the case.
[0040] The disciplinary cases to be analyzed and the relevant legal provisions can be matched by calculating semantic distance. Specifically, firstly, the disciplinary elements of each legal provision in the pre-set RAG knowledge base are extracted. Then, the same pre-set semantic encoding model is used to vectorize the disciplinary elements of the disciplinary cases to be analyzed. The extracted disciplinary elements are then vectorized using this pre-set semantic encoding model to obtain the corresponding semantic vectors of the disciplinary elements.
[0041] For each legal provision, the semantic vectors of the same type of disciplinary element are combined to obtain multiple first semantic vector groups. The cosine similarity between the two semantic vectors in each first semantic vector group is calculated and determined as the cosine similarity within the first group. Then, the mean of all cosine similarities within the first group is calculated and determined as the semantic distance between the disciplinary case to be analyzed and the legal provision.
[0042] In this embodiment of the invention, after calculating the semantic distance between each legal provision and the disciplinary case to be analyzed, legal provisions with a semantic distance less than a preset distance threshold are identified as candidate disciplinary provisions.
[0043] Step 103: When there are preset exception clauses in the candidate disciplinary provisions, select several reference cases from the several historical cases corresponding to the preset exception clauses, and select several reference cases whose case similarity with the disciplinary case to be analyzed is greater than a preset similarity threshold. Generate disciplinary features based on each disciplinary element and each reference case.
[0044] In this embodiment of the invention, when there are exceptional circumstances such as significantly minor offenses, voluntary confession, or meritorious service, applying general legal provisions to determine disciplinary action would lead to deviations in the disciplinary results. Therefore, after selecting candidate disciplinary provisions, it is necessary to compare the candidate provisions with preset exception provisions to determine whether any preset exception provisions exist among the candidate provisions. If so, the historical case corresponding to the preset exception provision is used as a reference case, and disciplinary prediction is made based on the disciplinary results of the reference case.
[0045] As a preferred embodiment, from the several historical cases corresponding to the preset exception clauses, several reference cases with a case similarity greater than a preset similarity threshold to the disciplinary inspection case to be analyzed are selected, including: Identify several historical cases corresponding to the preset exception clause in a preset historical case database; Extract several historical quantitative elements from each historical case; The preset semantic encoding model is used to vectorize each historical period element to obtain several semantic vectors of historical period elements. For each historical case, the semantic vectors of each historical statute element are matched with the semantic vectors of each statute element, and the semantic vectors of historical statute elements and statute elements of the same statute element type are determined as the second semantic vector group. Calculate the cosine similarity within the second group of each second semantic vector group; The mean of all cosine similarities within the second group is determined as the case similarity between the disciplinary inspection case to be analyzed and historical cases; Historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
[0046] In this embodiment of the invention, historical cases are stored in a preset historical case database. Based on the matched preset exception clauses, multiple corresponding historical cases can be extracted from the preset historical case database. By calculating the case similarity between historical cases and the disciplinary inspection cases to be analyzed, reference cases for the disciplinary inspection cases to be analyzed can be further filtered out.
[0047] In this embodiment of the invention, the similarity between historical cases and the disciplinary cases to be analyzed is calculated. First, the historical disciplinary elements of each historical case are extracted. Then, the same preset semantic coding model is used to vectorize the disciplinary elements of the disciplinary cases to be analyzed. The extracted historical disciplinary elements are vectorized using the preset semantic coding model to obtain the corresponding historical disciplinary element semantic vector.
[0048] For each historical case, the semantic vectors of historical disciplinary elements and disciplinary elements of the same type are combined to obtain multiple second semantic vector groups. The cosine similarity between the two semantic vectors in each second semantic vector group is calculated and determined as the cosine similarity within the second group. Then, the mean of all cosine similarities within the second group is calculated and determined as the case similarity between the disciplinary case to be analyzed and the historical case.
[0049] In this embodiment of the invention, after calculating the semantic distance between each historical case and the disciplinary inspection case to be analyzed, historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
[0050] As a preferred embodiment, before inputting the disciplinary characteristics into a preset disciplinary prediction model, and before the preset disciplinary prediction model outputs the disciplinary auxiliary results for the disciplinary cases to be analyzed, the method further includes: When there are no pre-defined exceptions in the candidate disciplinary provisions, obtain the case citation frequency, time-limited application scope, and geographical application scope of each candidate disciplinary provision; The time value corresponding to the violation time of the discipline inspection case to be analyzed is compared with the statute of limitations of each candidate disciplinary provision, and the regional value corresponding to the violation region of the discipline inspection case to be analyzed is compared with the regional scope of application of each candidate disciplinary provision. Candidate quantitative provisions whose applicable time range includes the time value and whose applicable geographical range includes the geographical value are determined as preferred quantitative provisions. For each preferred disciplinary provision, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provision with the disciplinary elements of the disciplinary case to be analyzed. Based on preset weights, the frequency of case citations, the degree of matching of quantitative and disciplinary elements, and the semantic distance between each preferred quantitative and disciplinary provision and the legal provisions are weighted and summed to obtain a comprehensive matching score for each preferred quantitative and disciplinary provision. The best-performing quantitative and disciplinary provision with the highest overall matching score is selected as the most applicable quantitative and disciplinary provision. Generate quantitative characteristics based on each quantitative element and the applicable quantitative provisions.
[0051] In this embodiment of the invention, when there are no preset exception clauses among the candidate disciplinary provisions, the current disciplinary case to be analyzed is considered an ordinary case, and disciplinary action can be taken based on the candidate disciplinary provisions. Therefore, it is necessary to select the most applicable disciplinary provision from multiple candidate disciplinary provisions in order to predict the disciplinary action of the disciplinary case to be analyzed based on the most applicable disciplinary provision.
[0052] In this embodiment of the invention, selecting the most applicable disciplinary provisions requires considering case citation frequency, statute of limitations, geographical scope, matching degree of disciplinary elements, and semantic distance from legal provisions. Specifically, firstly, the case citation frequency, statute of limitations, and geographical scope of each candidate disciplinary provision are obtained, as well as the values of the violation time and violation location of the disciplinary case to be analyzed. The time value corresponding to the violation time is compared with the statute of limitations of each candidate disciplinary provision, and the geographical value corresponding to the violation location is compared with the geographical scope of each candidate disciplinary provision; candidate disciplinary provisions whose statute of limitations includes the time value and whose geographical scope includes the geographical value are selected and determined as preferred disciplinary provisions.
[0053] The selected preferential disciplinary provisions obtained through the above screening are consistent with the timeliness and geographical application of the disciplinary cases to be analyzed. Further, it is necessary to select the most applicable disciplinary provision from these preferential provisions. Specifically, by comparing the disciplinary elements of the preferential provisions with the disciplinary elements of the disciplinary cases to be analyzed, the degree of matching of the disciplinary elements can be calculated. Then, based on preset weights, a weighted sum is applied to the case citation frequency, the degree of matching of the disciplinary elements, and the semantic distance between each preferential disciplinary provision and the legal provisions, to calculate the comprehensive matching score of each preferential disciplinary provision. By comparing the comprehensive matching scores of each preferential disciplinary provision, the preferential disciplinary provision with the highest comprehensive matching score is determined as the most applicable disciplinary provision.
[0054] As a preferred embodiment, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provisions with the disciplinary elements of the disciplinary case to be analyzed, including: By comparing the disciplinary elements of the selected disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, the intersection and union of the elements are obtained. The ratio between the number of elements in the intersection of elements and the number of elements in the union of elements is determined as the degree of element matching.
[0055] In this embodiment of the invention, the method for calculating the degree of matching of disciplinary elements specifically involves first determining the disciplinary elements of the preferred disciplinary provisions and the disciplinary elements of the disciplinary case to be analyzed, then identifying the common disciplinary elements between the preferred disciplinary provisions and the disciplinary case to be analyzed, thus determining the element intersection; and then determining the element union based on the different disciplinary elements between the preferred disciplinary provisions and the disciplinary case to be analyzed. Finally, the degree of matching of disciplinary elements is calculated by dividing the number of elements in the element intersection by the number of elements in the element union.
[0056] In this embodiment of the invention, when there are preset exception clauses in the candidate disciplinary provisions, the disciplinary elements of the disciplinary case to be analyzed and the reference cases selected from the historical cases of the preset exception clauses are used to generate disciplinary features, and these disciplinary features are used as the model input data of the preset disciplinary prediction model.
[0057] In this embodiment of the invention, when there are no preset exception clauses among the candidate disciplinary provisions, the disciplinary elements of the disciplinary case to be analyzed and the most applicable disciplinary provisions selected are used to generate disciplinary features, and these disciplinary features are used as the model input data of the preset disciplinary prediction model.
[0058] Step 104: Input the disciplinary characteristics into the preset disciplinary prediction model so that the preset disciplinary prediction model outputs the disciplinary auxiliary results of the disciplinary cases to be analyzed.
[0059] In this embodiment of the invention, the preset disciplinary action prediction model is a RAG large language model. This model has learned the relationship between disciplinary action features and disciplinary action results during model training, thus possessing the ability to predict disciplinary action scales. The input data for the preset disciplinary action prediction model is the aforementioned generated disciplinary action features, and the model output is a disciplinary action auxiliary result, which includes the disciplinary action result and the disciplinary action reason. The disciplinary action reason includes end-to-end logical data encompassing disciplinary action element extraction, legal provision matching, and dynamic adjustment of the disciplinary action magnitude, ensuring that the entire disciplinary action process is logically clear and hierarchically distinct.
[0060] In this embodiment of the invention, after the preset disciplinary prediction model outputs disciplinary assistance results, it is necessary to compare and verify these results with the preset disciplinary results database, as well as verify the completeness of the evidence chain. When the similarity between the disciplinary result in the disciplinary assistance result and the elements in the preset disciplinary results database is greater than the preset similarity, it is determined that the disciplinary result is based on evidence and is not a newly created disciplinary result by the model. The evidence chain needs to include evidence of the subject's identity, evidence of the violation, evidence of the amount involved, evidence of subjective attitude, and evidence of the consequences. Therefore, it is necessary to calculate the completeness of the evidence chain of the disciplinary reasons in the disciplinary assistance result by comparing these elements of the evidence. For example, when the semantic similarity reaches 0.9 or higher and the completeness of the evidence chain meets 85% or higher, it can be assessed that the output of the preset disciplinary prediction model has no risk of illusion. Then, the disciplinary assistance results output by the preset disciplinary prediction model can be provided to relevant disciplinary personnel as reference information to assist in decision-making, thereby reducing the time spent manually consulting legal provisions and similar cases and improving the efficiency of disciplinary proceedings.
[0061] Implementing the above embodiments has the following effects: This invention provides a method for assisting in the review of disciplinary cases based on RAG technology. It extracts various disciplinary elements from the disciplinary case to be analyzed and generates several semantic vectors for each element. Based on these semantic vectors, it calculates the semantic distance between the disciplinary case and various legal provisions in a pre-defined RAG knowledge base, and identifies legal provisions with a semantic distance less than a pre-defined distance threshold as candidate disciplinary provisions. When a pre-defined exception provision exists among the candidate provisions, it selects several reference cases from several historical cases corresponding to the exception provision whose case similarity to the disciplinary case to be analyzed is greater than a pre-defined similarity threshold. It then generates disciplinary features based on each disciplinary element and each reference case. Finally, it inputs these disciplinary features into a pre-defined disciplinary prediction model, enabling the model to output disciplinary assistance results for the disciplinary case to be analyzed. This invention uses the semantic vector of the disciplinary elements of the disciplinary case to be analyzed to select several candidate disciplinary provisions from a pre-set RAG knowledge base. If a pre-set exception provision exists among the candidate disciplinary provisions, the current disciplinary case to be analyzed is considered an exception case and is not subject to general legal provisions. Therefore, the historical case corresponding to the pre-set exception provision is determined as a reference case for the disciplinary case to be analyzed, so as to combine the disciplinary results of the reference case to make disciplinary predictions. This covers cases with exception circumstances and can effectively improve the accuracy of disciplinary auxiliary results.
[0062] like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; One embodiment of the present invention provides a disciplinary case auxiliary review device based on RAG technology, comprising: an element extraction module, a clause screening module, a disciplinary feature generation module, and a disciplinary prediction module; The element extraction module is used to extract various quantitative and disciplinary elements from the disciplinary cases to be analyzed, and to generate several quantitative and disciplinary element semantic vectors based on each quantitative and disciplinary element. The article filtering module is used to calculate the semantic distance between the discipline inspection case to be analyzed and each legal article in the preset RAG knowledge base based on the semantic vector of each disciplinary element, and to determine the legal articles with a semantic distance less than the preset distance threshold as candidate disciplinary articles. The disciplinary feature generation module is used to select several reference cases from several historical cases corresponding to the preset exception clauses when there are preset exception clauses in the candidate disciplinary clauses. The reference cases have a case similarity greater than a preset similarity threshold with the disciplinary case to be analyzed. The module generates disciplinary features based on each disciplinary element and each reference case. The disciplinary assessment prediction module is used to input the disciplinary characteristics into a preset disciplinary assessment prediction model, so that the preset disciplinary assessment prediction model outputs auxiliary disciplinary assessment results for the disciplinary cases to be analyzed.
[0063] In this embodiment of the invention, extracting disciplinary elements is to transform the vague and fragmented facts of the disciplinary cases to be analyzed into standardized, comparable, and quantifiable disciplinary bases. These disciplinary elements include: type of violation, degree of violation, rank of the person in charge, time of violation, geographical location of violation, consequences, subjective attitude, type of evidence, and nature of violation.
[0064] In this embodiment of the invention, the types of violations include bribery and abuse of power, which are core qualitative elements. The degree of violation refers to the severity of the circumstances, which is a core element for determining disciplinary action. The subject's rank includes leading cadres, key positions, and ordinary personnel, used to adapt to hierarchical disciplinary rules; different responsibilities and authorities result in different disciplinary liabilities and impacts. The time and location of the violation are used to match the applicable legal provisions, avoiding provisions that are incompatible with timeliness or geographical scope. The consequences include economic losses, political impact, public opinion, damage to the interests of the masses, and harm to the leadership and team; the more serious the consequences, the heavier the disciplinary action, directly reflecting the objective harm. Subjective attitude includes intentional violation and voluntary admission of wrongdoing, reflecting subjective malice and an attitude of admitting and repenting, and is an important basis for leniency, mitigation, aggravation, or punishment. The types of evidence include documentary evidence, physical evidence, witness testimony, personal confessions, and expert opinions; the sufficiency of the evidence directly affects the reliability of the fact-finding, thus determining whether a conviction can be made and the severity of the disciplinary action.
[0065] In this embodiment of the invention, RAG (Retrieval-Augmented Generation) technology is a technical framework that combines information retrieval with large language model generation. By using an external knowledge base, the large model first retrieves real-world knowledge from external sources, and then generates answers based on the retrieval results, making the model output more accurate, reliable, and relevant to the domain. The RAG knowledge base is a database specifically designed to store and manage external knowledge within the RAG technology framework.
[0066] In this embodiment of the invention, when there are exceptional circumstances such as significantly minor offenses, voluntary confession, or meritorious service, applying general legal provisions to determine disciplinary action would lead to deviations in the disciplinary results. Therefore, after selecting candidate disciplinary provisions, it is necessary to compare the candidate provisions with preset exception provisions to determine whether any preset exception provisions exist among the candidate provisions. If so, the historical case corresponding to the preset exception provision is used as a reference case, and disciplinary prediction is made based on the disciplinary results of the reference case.
[0067] In this embodiment of the invention, extracting disciplinary elements is to transform the vague and fragmented facts of the disciplinary cases to be analyzed into standardized, comparable, and quantifiable disciplinary bases. These disciplinary elements include: type of violation, degree of violation, rank of the person in charge, time of violation, geographical location of violation, consequences, subjective attitude, type of evidence, and nature of violation.
[0068] In this embodiment of the invention, the types of violations include bribery and abuse of power, which are core qualitative elements. The degree of violation refers to the severity of the circumstances, which is a core element for determining disciplinary action. The subject's rank includes leading cadres, key positions, and ordinary personnel, used to adapt to hierarchical disciplinary rules; different responsibilities and authorities result in different disciplinary liabilities and impacts. The time and location of the violation are used to match the applicable legal provisions, avoiding provisions that are incompatible with timeliness or geographical scope. The consequences include economic losses, political impact, public opinion, damage to the interests of the masses, and harm to the leadership and team; the more serious the consequences, the heavier the disciplinary action, directly reflecting the objective harm. Subjective attitude includes intentional violation and voluntary admission of wrongdoing, reflecting subjective malice and an attitude of admitting and repenting, and is an important basis for leniency, mitigation, aggravation, or punishment. The types of evidence include documentary evidence, physical evidence, witness testimony, personal confessions, and expert opinions; the sufficiency of the evidence directly affects the reliability of the fact-finding, thus determining whether a conviction can be made and the severity of the disciplinary action.
[0069] As a preferred embodiment, the types of disciplinary elements include: type of violation, degree of violation, rank of the subject, time of violation, geographical area of violation, consequences, subjective attitude, and type of evidence. When the types of disciplinary elements include violation type, violation degree, principal rank, violation time, violation location, consequences, subjective attitude, and evidence type, each disciplinary element corresponds to a preset semantic database; the preset semantic database includes preset text segments corresponding to the disciplinary element under different circumstances; the extraction of various disciplinary elements from the disciplinary cases to be analyzed, and the generation of several disciplinary element semantic vectors based on each disciplinary element, includes: Semantic segmentation is performed on the disciplinary inspection cases to be analyzed, resulting in several text fragments to be analyzed; For each text segment to be analyzed, the text segment to be analyzed is compared with all preset text segments, and the similarity between the text segment to be analyzed and each preset text segment is calculated. The preset text segments with a similarity exceeding the first similarity are selected as candidate text segments; the candidate text segment with the highest similarity is selected as the target text segment. The situation corresponding to the target text segment is used as the quantitative element of the text segment to be analyzed; By using a pre-defined semantic encoding model, each quantitative and chronological element is vectorized to obtain several semantic vectors for quantitative and chronological elements.
[0070] In this embodiment of the invention, the disciplinary elements such as type of violation, degree of violation, rank of the subject, time of violation, region of violation, consequences, subjective attitude and type of evidence can be obtained by matching with a preset semantic database corresponding to each disciplinary element.
[0071] Specifically, each preset semantic database includes preset text segments corresponding to the disciplinary elements under different scenarios. For example, the preset semantic database for disciplinary types includes semantic descriptions of various scenarios such as bribery and abuse of power.
[0072] To extract disciplinary elements, the first step is to semantically segment the disciplinary case to be analyzed, resulting in multiple text fragments. For each text fragment, it is compared with all preset text segments in each preset semantic database. The similarity between the text fragment and each preset text segment is calculated. When the similarity exceeds a first similarity threshold, the text fragment is considered to contain valid information from which disciplinary elements can be extracted. Therefore, the preset text segments corresponding to these similarities are identified as candidate text segments. Further, the candidate text segment with the highest similarity among these candidate text segments is identified as the target text segment, and the situation corresponding to the target text segment is taken as the disciplinary element of the text fragment to be analyzed.
[0073] After extracting the disciplinary elements such as type of violation, degree of violation, rank of the person in charge, time of violation, region of violation, consequences and impact, subjective attitude and type of evidence, the disciplinary elements are vectorized using a pre-set semantic coding model to obtain the semantic vector of each disciplinary element.
[0074] As a preferred embodiment, the types of disciplinary elements also include the nature of the violation; When the type of disciplinary factor also includes the nature of the violation, the nature of the violation in the disciplinary case to be analyzed is determined by the following methods: Based on the subject of the disciplinary violation in the disciplinary case to be analyzed, the historical disciplinary violation records of the subject are retrieved from the preset historical case database; When historical disciplinary records are retrieved, the nature of the disciplinary violation in the case to be analyzed is determined to be multiple violations. When no historical records of disciplinary violations are found, the nature of the disciplinary violation in the case to be analyzed is determined to be the first violation.
[0075] In this embodiment of the invention, the disciplinary element of the nature of the violation needs to be determined in conjunction with the analysis of historical cases. Specifically, the subject of the violation in the disciplinary case to be analyzed is first identified. The subject's historical violation records are then retrieved from a pre-set historical case database. If a historical violation record is found, it indicates that the current disciplinary case to be analyzed is not the subject's first violation; therefore, the nature of the violation in the disciplinary case to be analyzed is determined to be a multiple violation. If no historical violation record is found in the pre-set historical case database, it indicates that the current disciplinary case to be analyzed is the subject's first violation; therefore, the nature of the violation in the disciplinary case to be analyzed is determined to be a first-time violation.
[0076] In this embodiment of the invention, determining whether the current disciplinary case to be analyzed is a first-time violation or a repeated violation serves to differentiate the severity of the offense. First-time and repeated violations exhibit similar behaviors, but their severity differs significantly. Therefore, it is necessary to assign differentiated weights to first-time and repeated violations to provide accurate data support for adjusting the disciplinary prediction results.
[0077] As a preferred embodiment, based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, including: Extract several quantitative elements from each legal provision; The preset semantic coding model is used to vectorize each article's quantitative elements, resulting in several semantic vectors for the article's quantitative elements. For each legal provision, the semantic vector of each provision’s quantitative and disciplinary element is matched with the semantic vector of each quantitative and disciplinary element. The semantic vectors of the provisions’ quantitative and disciplinary elements of the same type and the semantic vectors of the quantitative and disciplinary elements are determined as the first semantic vector group. Calculate the cosine similarity within the first group of each first semantic vector group; The mean of the cosine similarities within all cases in the first group is used as the semantic distance between the disciplinary cases to be analyzed and the legal provisions.
[0078] In this embodiment of the invention, the RAG knowledge base contains multiple legal provisions, which serve as the basis for disciplinary action. To determine which legal provision applies to a case to be analyzed, it is necessary to first identify the case.
[0079] The disciplinary cases to be analyzed and the relevant legal provisions can be matched by calculating semantic distance. Specifically, firstly, the disciplinary elements of each legal provision in the pre-set RAG knowledge base are extracted. Then, the same pre-set semantic encoding model is used to vectorize the disciplinary elements of the disciplinary cases to be analyzed. The extracted disciplinary elements are then vectorized using this pre-set semantic encoding model to obtain the corresponding semantic vectors of the disciplinary elements.
[0080] For each legal provision, the semantic vectors of the same type of disciplinary element are combined to obtain multiple first semantic vector groups. The cosine similarity between the two semantic vectors in each first semantic vector group is calculated and determined as the cosine similarity within the first group. Then, the mean of all cosine similarities within the first group is calculated and determined as the semantic distance between the disciplinary case to be analyzed and the legal provision.
[0081] In this embodiment of the invention, after calculating the semantic distance between each legal provision and the disciplinary case to be analyzed, legal provisions with a semantic distance less than a preset distance threshold are identified as candidate disciplinary provisions.
[0082] As a preferred embodiment, from the several historical cases corresponding to the preset exception clauses, several reference cases with a case similarity greater than a preset similarity threshold to the disciplinary inspection case to be analyzed are selected, including: Identify several historical cases corresponding to the preset exception clause in a preset historical case database; Extract several historical quantitative elements from each historical case; The preset semantic encoding model is used to vectorize each historical period element to obtain several semantic vectors of historical period elements. For each historical case, the semantic vectors of each historical statute element are matched with the semantic vectors of each statute element, and the semantic vectors of historical statute elements and statute elements of the same statute element type are determined as the second semantic vector group. Calculate the cosine similarity within the second group of each second semantic vector group; The mean of all cosine similarities within the second group is determined as the case similarity between the disciplinary inspection case to be analyzed and historical cases; Historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
[0083] In this embodiment of the invention, historical cases are stored in a preset historical case database. Based on the matched preset exception clauses, multiple corresponding historical cases can be extracted from the preset historical case database. By calculating the case similarity between historical cases and the disciplinary inspection cases to be analyzed, reference cases for the disciplinary inspection cases to be analyzed can be further filtered out.
[0084] In this embodiment of the invention, the similarity between historical cases and the disciplinary cases to be analyzed is calculated. First, the historical disciplinary elements of each historical case are extracted. Then, the same preset semantic coding model is used to vectorize the disciplinary elements of the disciplinary cases to be analyzed. The extracted historical disciplinary elements are vectorized using the preset semantic coding model to obtain the corresponding historical disciplinary element semantic vector.
[0085] For each historical case, the semantic vectors of historical disciplinary elements and disciplinary elements of the same type are combined to obtain multiple second semantic vector groups. The cosine similarity between the two semantic vectors in each second semantic vector group is calculated and determined as the cosine similarity within the second group. Then, the mean of all cosine similarities within the second group is calculated and determined as the case similarity between the disciplinary case to be analyzed and the historical case.
[0086] In this embodiment of the invention, after calculating the semantic distance between each historical case and the disciplinary inspection case to be analyzed, historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
[0087] As a preferred embodiment, before inputting the disciplinary characteristics into a preset disciplinary prediction model, and before the preset disciplinary prediction model outputs the disciplinary auxiliary results for the disciplinary cases to be analyzed, the method further includes: When there are no pre-defined exceptions in the candidate disciplinary provisions, obtain the case citation frequency, time-limited application scope, and geographical application scope of each candidate disciplinary provision; The time value corresponding to the violation time of the discipline inspection case to be analyzed is compared with the statute of limitations of each candidate disciplinary provision, and the regional value corresponding to the violation region of the discipline inspection case to be analyzed is compared with the regional scope of application of each candidate disciplinary provision. Candidate quantitative provisions whose applicable time range includes the time value and whose applicable geographical range includes the geographical value are determined as preferred quantitative provisions. For each preferred disciplinary provision, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provision with the disciplinary elements of the disciplinary case to be analyzed. Based on preset weights, the frequency of case citations, the degree of matching of quantitative and disciplinary elements, and the semantic distance between each preferred quantitative and disciplinary provision and the legal provisions are weighted and summed to obtain a comprehensive matching score for each preferred quantitative and disciplinary provision. The best-performing quantitative and disciplinary provision with the highest overall matching score is selected as the most applicable quantitative and disciplinary provision. Generate quantitative characteristics based on each quantitative element and the applicable quantitative provisions.
[0088] In this embodiment of the invention, when there are no preset exception clauses among the candidate disciplinary provisions, the current disciplinary case to be analyzed is considered an ordinary case, and disciplinary action can be taken based on the candidate disciplinary provisions. Therefore, it is necessary to select the most applicable disciplinary provision from multiple candidate disciplinary provisions in order to predict the disciplinary action of the disciplinary case to be analyzed based on the most applicable disciplinary provision.
[0089] In this embodiment of the invention, selecting the most applicable disciplinary provisions requires considering case citation frequency, statute of limitations, geographical scope, matching degree of disciplinary elements, and semantic distance from legal provisions. Specifically, firstly, the case citation frequency, statute of limitations, and geographical scope of each candidate disciplinary provision are obtained, as well as the values of the violation time and violation location of the disciplinary case to be analyzed. The time value corresponding to the violation time is compared with the statute of limitations of each candidate disciplinary provision, and the geographical value corresponding to the violation location is compared with the geographical scope of each candidate disciplinary provision; candidate disciplinary provisions whose statute of limitations includes the time value and whose geographical scope includes the geographical value are selected and determined as preferred disciplinary provisions.
[0090] The selected preferential disciplinary provisions obtained through the above screening are consistent with the timeliness and geographical application of the disciplinary cases to be analyzed. Further, it is necessary to select the most applicable disciplinary provision from these preferential provisions. Specifically, by comparing the disciplinary elements of the preferential provisions with the disciplinary elements of the disciplinary cases to be analyzed, the degree of matching of the disciplinary elements can be calculated. Then, based on preset weights, a weighted sum is applied to the case citation frequency, the degree of matching of the disciplinary elements, and the semantic distance between each preferential disciplinary provision and the legal provisions, to calculate the comprehensive matching score of each preferential disciplinary provision. By comparing the comprehensive matching scores of each preferential disciplinary provision, the preferential disciplinary provision with the highest comprehensive matching score is determined as the most applicable disciplinary provision.
[0091] As a preferred embodiment, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provisions with the disciplinary elements of the disciplinary case to be analyzed, including: By comparing the disciplinary elements of the selected disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, the intersection and union of the elements are obtained. The ratio between the number of elements in the intersection of elements and the number of elements in the union of elements is determined as the degree of element matching.
[0092] In this embodiment of the invention, the method for calculating the degree of matching of disciplinary elements specifically involves first determining the disciplinary elements of the preferred disciplinary provisions and the disciplinary elements of the disciplinary case to be analyzed, then identifying the common disciplinary elements between the preferred disciplinary provisions and the disciplinary case to be analyzed, thus determining the element intersection; and then determining the element union based on the different disciplinary elements between the preferred disciplinary provisions and the disciplinary case to be analyzed. Finally, the degree of matching of disciplinary elements is calculated by dividing the number of elements in the element intersection by the number of elements in the element union.
[0093] In this embodiment of the invention, when there are preset exception clauses in the candidate disciplinary provisions, the disciplinary elements of the disciplinary case to be analyzed and the reference cases selected from the historical cases of the preset exception clauses are used to generate disciplinary features, and these disciplinary features are used as the model input data of the preset disciplinary prediction model.
[0094] In this embodiment of the invention, when there are no preset exception clauses among the candidate disciplinary provisions, the disciplinary elements of the disciplinary case to be analyzed and the most applicable disciplinary provisions selected are used to generate disciplinary features, and these disciplinary features are used as the model input data of the preset disciplinary prediction model.
[0095] Implementing the above embodiments has the following effects: This invention provides a device for assisting in the review of disciplinary cases based on RAG technology. It extracts various disciplinary elements from the disciplinary case to be analyzed and generates several semantic vectors for each element. Based on these semantic vectors, it calculates the semantic distance between the disciplinary case and the relevant legal provisions in a pre-defined RAG knowledge base, identifying legal provisions with a semantic distance less than a pre-defined threshold as candidate disciplinary provisions. When a pre-defined exception provision exists among the candidate provisions, it selects several reference cases from a number of historical cases corresponding to the exception provision, ensuring that the case similarity to the disciplinary case is greater than a pre-defined similarity threshold. It then generates disciplinary features based on each disciplinary element and each reference case. Finally, it inputs these disciplinary features into a pre-defined disciplinary prediction model, enabling the model to output disciplinary assistance results for the disciplinary case to be analyzed. This invention uses the semantic vector of the disciplinary elements of the disciplinary case to be analyzed to select several candidate disciplinary provisions from a pre-set RAG knowledge base. If a pre-set exception provision exists among the candidate disciplinary provisions, the current disciplinary case to be analyzed is considered an exception case and is not subject to general legal provisions. Therefore, the historical case corresponding to the pre-set exception provision is determined as a reference case for the disciplinary case to be analyzed, so as to combine the disciplinary results of the reference case to make disciplinary predictions. This covers cases with exception circumstances and can effectively improve the accuracy of disciplinary auxiliary results.
[0096] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can realize the method for assisting in the review of disciplinary cases based on RAG technology provided by any of the above-described method embodiments of the present invention.
[0097] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0098] Based on the above embodiments of the auxiliary review method for disciplinary inspection cases based on RAG technology, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the auxiliary review method for disciplinary inspection cases based on RAG technology of any embodiment of the present invention.
[0099] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0100] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0101] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0102] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the RAG-based auxiliary review method for disciplinary inspection cases described in any of the above-described method embodiments of the present invention.
[0103] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0104] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for assisting in the review of disciplinary inspection cases based on RAG technology, characterized in that, include: Various disciplinary elements are extracted from the disciplinary cases to be analyzed, and several semantic vectors of disciplinary elements are generated based on each disciplinary element. Based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, and the legal provisions with a semantic distance less than the preset distance threshold are identified as candidate disciplinary provisions. When there are preset exception clauses in the candidate disciplinary provisions, several reference cases with a case similarity greater than a preset similarity threshold with the disciplinary case to be analyzed are selected from several historical cases corresponding to the preset exception clauses. Disciplinary features are generated based on each disciplinary element and each reference case. The disciplinary characteristics are input into a preset disciplinary prediction model so that the preset disciplinary prediction model outputs auxiliary disciplinary results for the disciplinary cases to be analyzed.
2. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 1, characterized in that, The types of disciplinary elements include: type of violation, degree of violation, rank of the person in charge, time of violation, geographical area of violation, consequences and impact, subjective attitude and type of evidence; When the types of disciplinary elements include violation type, violation degree, principal rank, violation time, violation location, consequences, subjective attitude, and evidence type, each disciplinary element corresponds to a preset semantic database; the preset semantic database includes preset text segments corresponding to the disciplinary element under different circumstances; the extraction of various disciplinary elements from the disciplinary cases to be analyzed, and the generation of several disciplinary element semantic vectors based on each disciplinary element, includes: Semantic segmentation is performed on the disciplinary inspection cases to be analyzed, resulting in several text fragments to be analyzed; For each text segment to be analyzed, the text segment to be analyzed is compared with all preset text segments, and the similarity between the text segment to be analyzed and each preset text segment is calculated. The preset text segments with a similarity exceeding the first similarity are selected as candidate text segments; the candidate text segment with the highest similarity is selected as the target text segment. The situation corresponding to the target text segment is used as the quantitative element of the text segment to be analyzed; By using a pre-defined semantic encoding model, each quantitative and chronological element is vectorized to obtain several semantic vectors for quantitative and chronological elements.
3. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 2, characterized in that, The types of disciplinary elements also include the nature of the violation; When the type of disciplinary factor also includes the nature of the violation, the nature of the violation in the disciplinary case to be analyzed is determined by the following methods: Based on the subject of the disciplinary violation in the disciplinary case to be analyzed, the historical disciplinary violation records of the subject are retrieved from the preset historical case database; When historical disciplinary records are retrieved, the nature of the disciplinary violation in the case to be analyzed is determined to be multiple violations. When no historical records of disciplinary violations are found, the nature of the disciplinary violation in the case to be analyzed is determined to be the first violation.
4. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 3, characterized in that, Based on the semantic vectors of each disciplinary element, the semantic distance between the disciplinary case to be analyzed and each legal provision in the preset RAG knowledge base is calculated, including: Extract several quantitative elements from each legal provision; The preset semantic coding model is used to vectorize each article's quantitative elements, resulting in several semantic vectors for the article's quantitative elements. For each legal provision, the semantic vector of each provision’s quantitative and disciplinary element is matched with the semantic vector of each quantitative and disciplinary element. The semantic vectors of the provisions’ quantitative and disciplinary elements of the same type and the semantic vectors of the quantitative and disciplinary elements are determined as the first semantic vector group. Calculate the cosine similarity within the first group of each first semantic vector group; The mean of the cosine similarities within all cases in the first group is used as the semantic distance between the disciplinary cases to be analyzed and the legal provisions.
5. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 4, characterized in that, From a number of historical cases corresponding to the preset exception clauses, several reference cases are selected whose case similarity to the disciplinary inspection case to be analyzed is greater than a preset similarity threshold, including: Identify several historical cases corresponding to the preset exception clause in a preset historical case database; Extract several historical quantitative elements from each historical case; The preset semantic encoding model is used to vectorize each historical period element to obtain several semantic vectors of historical period elements. For each historical case, the semantic vectors of each historical statute element are matched with the semantic vectors of each statute element, and the semantic vectors of historical statute elements and statute elements of the same statute element type are determined as the second semantic vector group. Calculate the cosine similarity within the second group of each second semantic vector group; The mean of all cosine similarities within the second group is determined as the case similarity between the disciplinary inspection case to be analyzed and historical cases; Historical cases with a similarity greater than a preset similarity threshold are identified as reference cases.
6. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 5, characterized in that, Before the disciplinary characteristics are input into a preset disciplinary prediction model, and the preset disciplinary prediction model outputs the disciplinary auxiliary results for the disciplinary cases to be analyzed, the following steps are also included: When there are no pre-defined exceptions in the candidate disciplinary provisions, obtain the case citation frequency, time-limited application scope, and geographical application scope of each candidate disciplinary provision; The time value corresponding to the violation time of the discipline inspection case to be analyzed is compared with the statute of limitations of each candidate disciplinary provision, and the regional value corresponding to the violation region of the discipline inspection case to be analyzed is compared with the regional scope of application of each candidate disciplinary provision. Candidate quantitative provisions whose applicable time range includes the time value and whose applicable geographical range includes the geographical value are determined as preferred quantitative provisions. For each preferred disciplinary provision, the degree of matching of disciplinary elements is calculated by comparing the disciplinary elements of the preferred disciplinary provision with the disciplinary elements of the disciplinary case to be analyzed. Based on preset weights, the frequency of case citations, the degree of matching of quantitative and disciplinary elements, and the semantic distance between each preferred quantitative and disciplinary provision and the legal provisions are weighted and summed to obtain a comprehensive matching score for each preferred quantitative and disciplinary provision. The best-performing quantitative and disciplinary provision with the highest overall matching score is selected as the most applicable quantitative and disciplinary provision. Generate quantitative characteristics based on each quantitative element and the applicable quantitative provisions.
7. The method for assisting in the review of disciplinary cases based on RAG technology according to claim 6, characterized in that, By comparing the disciplinary elements of the selected disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, the degree of matching of disciplinary elements is calculated, including: By comparing the disciplinary elements of the selected disciplinary provisions with the disciplinary elements of the disciplinary cases to be analyzed, the intersection and union of the elements are obtained. The ratio between the number of elements in the intersection of elements and the number of elements in the union of elements is determined as the degree of element matching.
8. A device for assisting in the review of disciplinary cases based on RAG technology, characterized in that, include: The module includes an element extraction module, a clause filtering module, a quantitative and disciplinary feature generation module, and a quantitative and disciplinary prediction module. The element extraction module is used to extract various quantitative and disciplinary elements from the disciplinary cases to be analyzed, and to generate several quantitative and disciplinary element semantic vectors based on each quantitative and disciplinary element. The article filtering module is used to calculate the semantic distance between the discipline inspection case to be analyzed and each legal article in the preset RAG knowledge base based on the semantic vector of each disciplinary element, and to determine the legal articles with a semantic distance less than the preset distance threshold as candidate disciplinary articles. The disciplinary feature generation module is used to select several reference cases from several historical cases corresponding to the preset exception clauses when there are preset exception clauses in the candidate disciplinary clauses. The reference cases have a case similarity greater than a preset similarity threshold with the disciplinary case to be analyzed. The module generates disciplinary features based on each disciplinary element and each reference case. The disciplinary assessment prediction module is used to input the disciplinary characteristics into a preset disciplinary assessment prediction model, so that the preset disciplinary assessment prediction model outputs auxiliary disciplinary assessment results for the disciplinary cases to be analyzed.
9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the method for assisting in the review of disciplinary cases based on RAG technology as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the auxiliary review method for disciplinary cases based on RAG technology as described in any one of claims 1-7.