A case classification method, apparatus and computer program product

By extracting case elements using a large language model and adjusting the weight matrix, and combining this with a case database and a legal provision database for retrieval, a legal logic chain is generated. This solves the problem of inaccurate case characterization in existing technologies and enables rapid and accurate case characterization and a visualized adjudication process.

CN122243691APending Publication Date: 2026-06-19ANHUI IFLYTEK INTELLIGENT SYST
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI IFLYTEK INTELLIGENT SYST
Filing Date
2026-03-25
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing methods for classifying cases suffer from semantic gaps, are ill-suited to new types of cases, and are unable to handle the cross-correlation of multiple elements, resulting in inaccurate classification results.

Method used

The Big Language Model (LLM) is used to extract the seven key elements of the target case. By adjusting the weight matrix and combining the case database and the legal provisions database, a dual-channel hierarchical retrieval is performed to generate a legal logic chain for case characterization.

Benefits of technology

It achieves more accurate semantic matching and timeliness filtering, quickly and accurately obtains case characterization results, and supports visualization of the adjudication process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122243691A_ABST
    Figure CN122243691A_ABST
Patent Text Reader

Abstract

This application discloses a method, device, and computer program product for case characterization. The method includes: firstly, performing structured analysis of the elements of the legal documents of the target case to obtain the seven W's related to the target case (including when, where, who, what, what, what, what, and why); then, based on the weight matrix corresponding to the seven W's, performing a dual-channel hierarchical search of the case database and the legal provision database to accurately match the target case with the target case and the target legal provision that is more relevant to the target case, thereby simultaneously solving the problems of semantic generalization and timeliness filtering (such as filtering out case examples older than 5 years and filtering out expired legal provisions). On this basis, the method further utilizes the target legal logic chain (including the associated evidence chain of "facts -> legal provisions -> case examples -> conclusion") generated by LLM based on the target case and the target legal provision to perform integrated characterization of the target case, thereby obtaining the case characterization result more quickly and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a method, device and computer program product for case characterization. Background Technology

[0002] With the improvement of the legal system and the increasing legal awareness of the people, the demand for justice is also growing, resulting in a year-on-year increase in the number of cases filed in courts. How to accurately characterize these cases and determine the applicable charges and sentencing ranges for each case will directly affect the establishment of legal authority, the maintenance of public trust, and the stability of social order.

[0003] Currently, three retrieval methods are commonly used in case characterization: The first is keyword matching, such as document retrieval systems based on the TF-IDF algorithm. However, this method suffers from semantic gaps. For example, when matching "illegal possession," similar cases or legal provisions containing the phrase "theft" may be missed. The second is rule-based engine-based retrieval, but this relies on manually defined legal element rules and is ill-suited for novel cases. The third is vector-based retrieval, such as similar case recommendations using Doc2Vec. However, this method cannot handle the cross-correlation of multiple elements. For example, tests show that the recall rate for the composite element of "subjective intent + substantial amount" is only 58%. Clearly, all three existing retrieval methods have significant problems, making it difficult to accurately retrieve relevant similar cases and legal provisions, thus affecting the accuracy of the final case characterization and failing to achieve the desired outcome. Summary of the Invention

[0004] The main objective of this application is to provide a case characterization method, device, and computer program product that can utilize a large language model (LLM) to improve the efficiency and accuracy of legal case characterization, thereby achieving the desired case characterization effect.

[0005] This application provides a method for case characterization, including:

[0006] Obtain the legal documents of the pending target case; and extract the target seven-way elements related to the target case from the legal documents;

[0007] Calculate the weight values ​​corresponding to the target seven geometric elements; and use a preset case attenuation factor to determine the weight matrix corresponding to the target seven geometric elements by adjusting the weight values ​​corresponding to the target seven geometric elements.

[0008] Select target cases from the case study library that match the weight matrix corresponding to the target seven geometric elements; and select target legal provisions from the legal provision library that match the weight matrix corresponding to the target seven geometric elements.

[0009] Using the target seven elements, target similar cases, and target legal provisions, a prompt instruction is generated and input into the large language model for legal logic chain generation to obtain the target legal logic chain for the target case;

[0010] Using the target legal logic chain, a case characterization instruction is generated, which is then input into a large language model for case characterization processing to obtain the case characterization result for the target case.

[0011] In one possible implementation, the extraction of the target seven-key elements related to the target case from the legal document includes:

[0012] Using the legal documents of the target case, a seven-question element extraction instruction is generated, which is then input into a large language model for seven-question element extraction processing to obtain the target seven-question elements related to the target case.

[0013] The seven elements of the objective include when, where, who, what, what situation, what object, and why.

[0014] In one possible implementation, calculating the weight values ​​corresponding to the target geometric elements includes:

[0015] Calculate the type importance weight, position weight, and length weight for each element in the target geometric elements;

[0016] The weighted sum of the type importance weight, position weight, and length weight corresponding to each element is obtained to obtain the comprehensive weight value corresponding to each element in the target geometric elements.

[0017] In one possible implementation, determining the weight matrix corresponding to the target geometric elements by adjusting the weight values ​​corresponding to the target geometric elements using a preset case attenuation factor includes:

[0018] The target case type is identified using a large language model; and the product of the preset case attenuation factor corresponding to the target case type and the comprehensive weight value corresponding to each element in the target seven-key elements is calculated as the adjusted comprehensive weight value corresponding to each element in the target seven-key elements.

[0019] The adjusted comprehensive weight values ​​corresponding to each of the seven target geometric elements are summed to obtain the summed comprehensive weight value corresponding to each element.

[0020] Calculate the ratio between the adjusted comprehensive weight value for each element and the summed comprehensive weight value, and use this ratio as the final weight value for the corresponding element.

[0021] For each element, field expansion processing is performed, and the comprehensive weight value, adjusted comprehensive weight value, and final weight value of each element are combined with the expansion results to construct the weight matrix corresponding to the target geometric element.

[0022] In one possible implementation, the step of selecting target cases from the case library that match the weight matrix corresponding to the target geometric elements includes:

[0023] From the weight matrix corresponding to the target seven geometric elements, select the weight matrix corresponding to the case elements;

[0024] Candidate cases are selected from the case study library based on the top-K cosine similarity of the weight matrix corresponding to the case study elements; where K is a positive integer greater than 0.

[0025] The candidate cases in the Top-K are sorted from most recent to oldest based on their occurrence time, and candidate cases older than 5 years are filtered out from the sorting results to obtain the filtered target cases.

[0026] In one possible implementation, the step of selecting target legal provisions from the legal provision library that match the weight matrix corresponding to the target geometric elements includes:

[0027] From the weight matrix corresponding to the seven target elements, select the weight matrix corresponding to the legal provisions elements;

[0028] The text in the weight matrix corresponding to the legal provisions is segmented to obtain legal provisions keywords; and the legal provisions keywords are expanded based on a pre-built thesaurus of legal related terms to obtain expanded legal provisions keywords.

[0029] Each legal provision in the legal provision database is segmented into words to obtain candidate legal provision words; and from all candidate legal provision words, the top-N candidate legal provisions with the same similarity to the expanded legal provision keywords are selected; where N is a positive integer greater than 0.

[0030] Filter out invalid legal provisions from the Top-N candidate legal provisions to obtain the filtered target legal provisions.

[0031] In one possible implementation, after generating a case characterization instruction using the target legal logic chain, inputting it into a large language model for case characterization processing, and obtaining a case characterization result for the target case, the method further includes:

[0032] When the confidence level of the case characterization result is lower than a preset threshold, the problem points in the target legal logic chain are obtained; and the problem points are used to generate element improvement instructions, which are input into the big language model to improve the target seven-way elements, and the improved target seven-way elements are obtained.

[0033] Repeat the calculation of the weight values ​​corresponding to the improved target seven geometric elements and subsequent steps until the confidence level of the obtained case characterization result is not lower than the preset threshold.

[0034] This application also provides a case characterization device, including: a processor, a memory, and a system bus;

[0035] The processor and the memory are connected via the system bus;

[0036] The memory is used to store one or more programs, the one or more programs including instructions, which, when executed by the processor, cause the processor to perform any of the above-described methods for characterizing cases.

[0037] This application also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-described methods for determining the nature of a case.

[0038] This application provides a case characterization method, device, and computer program product. First, it acquires the legal documents of the target case to be characterized; then, it extracts the target seven-way elements (KH elements, WH elements, GH elements, and HH elements) related to the target case from the legal documents; next, it calculates the weight values ​​corresponding to the target seven-way elements; and using a preset case attenuation factor, it determines the weight matrix corresponding to the target seven-way elements by adjusting the weight values. Then, it filters target similar cases from a case library that match the weight matrix corresponding to the target seven-way elements; and it filters target legal provisions from a legal provision library that match the weight matrix corresponding to the target seven-way elements. Furthermore, it uses the target seven-way elements, target similar cases, and target legal provisions to generate prompt instructions, inputs them into a large language model for legal logic chain generation, obtains the target legal logic chain for the target case; and uses the target legal logic chain to generate a case characterization instruction, inputs it into the large language model for case characterization processing, and obtains the case characterization result for the target case.

[0039] As can be seen, when determining the nature of the target case, this application first performs a structured analysis of the legal documents of the target case to obtain the seven "what" elements related to the target case (including when, where, who, what, how, object, and why). Then, based on the weight matrix corresponding to the seven "what" elements, a dual-channel hierarchical search is performed on the case database and the legal provision database to accurately match the target case with the target case. This simultaneously solves the problems of semantic generalization (i.e., compared with existing similar case recommendation methods such as Doc2Vec, this matching method of the synonym combination tree can achieve more accurate semantic matching and expansion) and timeliness filtering (such as filtering out cases older than 5 years and filtering out expired legal provisions). Furthermore, based on this, the target legal logic chain (including the associated evidence chain of "facts -> legal provisions -> similar cases -> conclusions") generated by the large language model based on the target case and the target legal provisions is used to integrate and characterize the target case, thereby obtaining the case characterization result more quickly and accurately.

[0040] In addition, when the confidence level of the obtained case characterization result is lower than the preset threshold (such as 0.85), the problem points in the target legal logic chain can be obtained. Based on the problem points, the problem can be backtracked through the large language model to improve the target seven W's elements. Then, the improved target seven W's elements are used to re-characterize the case, so that the entire case characterization process can meet the requirement of "visualizing the adjudication process" and thus achieve the ideal case characterization effect. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a case characterization method provided in an embodiment of this application;

[0043] Figure 2 An example diagram illustrating the overall process of characterizing a target case provided in this application embodiment;

[0044] Figure 3 This is a schematic diagram of a case characterization device provided in an embodiment of this application. Detailed Implementation

[0045] Currently, qualitative analysis of legal cases largely relies on human experience or rule engines, typically employing three retrieval methods: The first is keyword matching, such as document retrieval systems based on the TF-IDF algorithm, but this method suffers from semantic gaps. For example, when matching "illegal possession," similar cases or legal provisions containing the phrase "theft" may be missed. The second is rule engine-based retrieval, but this method depends on manually defined legal element rules and is ill-suited for novel cases. The third is vector retrieval, such as similar case recommendations using Doc2Vec, but this method cannot handle the cross-correlation of multiple elements. For example, tests show that the recall rate for the combined element of "subjective intent + substantial amount" is only 58%.

[0046] It is evident that the existing search methods have at least three major shortcomings in determining the nature of a case, making it difficult to achieve the desired outcome.

[0047] (1) Insufficient accuracy of element extraction.

[0048] Specifically, traditional rule templates (such as regular expressions) can only capture about 30%-40% of case elements and cannot handle abstract elements requiring semantic understanding, such as "what circumstances / why." This approach does not consider the element attenuation characteristics unique to the legal field. This is because legal expertise reflects the varying importance of different elements in different types of cases. For example, in theft, the focus is on the value of the property and the act of theft; in intentional injury, the focus is on the degree of harm and subjective intent; and in contract fraud, the focus is on fabricating facts and the delivery of property.

[0049] (2) The limitations of the performance of existing retrieval systems.

[0050] Specifically, current mainstream legal search tools typically rely on keyword matching, which has two major drawbacks: first, they miss synonyms (such as the semantic gap between "robbery" and "violent acquisition"); second, the current static legal provisions database cannot automatically exclude invalid clauses (such as contract law clauses that are still cited after the implementation of the Civil Code), resulting in a lack of interpretability in decision-making.

[0051] (3) Existing case recommendation systems usually only output similarity scores and do not construct a chain of evidence connecting "facts -> legal provisions -> precedents", which does not meet the current requirement of "explicit rules of judgment basis".

[0052] To address the aforementioned deficiencies, this application provides a case characterization method. First, it obtains the legal documents of the target case to be characterized; then, it extracts the target seven-question elements (HQ elements) related to the target case from the legal documents; next, it calculates the weight values ​​corresponding to the target seven-question elements; and using a preset case attenuation factor, it determines the weight matrix corresponding to the target seven-question elements by adjusting the weight values. Then, it selects target similar cases from a case library that match the weight matrix corresponding to the target seven-question elements; and selects target legal provisions from a legal provision library that match the weight matrix corresponding to the target seven-question elements. Furthermore, it uses the target seven-question elements, target similar cases, and target legal provisions to generate prompt instructions, which are input into a large language model for legal logic chain generation, resulting in a target legal logic chain for the target case; and uses this target legal logic chain to generate a case characterization instruction, which is input into the large language model for case characterization processing, yielding the case characterization result for the target case.

[0053] As can be seen, when determining the nature of the target case, this application first performs a structured analysis of the legal documents of the target case to obtain the seven "what" elements related to the target case (including when, where, who, what, how, object, and why). Then, based on the weight matrix corresponding to the seven "what" elements, a dual-channel hierarchical search is performed on the case database and the legal provision database to accurately match the target case with the target case. This simultaneously solves the problems of semantic generalization (i.e., compared with existing similar case recommendation methods such as Doc2Vec, this matching method of the synonym combination tree can achieve more accurate semantic matching and expansion) and timeliness filtering (such as filtering out cases older than 5 years and filtering out expired legal provisions). Furthermore, based on this, the target legal logic chain (including the associated evidence chain of "facts -> legal provisions -> similar cases -> conclusions") generated by the large language model based on the target case and the target legal provisions is used to integrate and characterize the target case, thereby obtaining the case characterization result more quickly and accurately.

[0054] In addition, when the confidence level of the obtained case characterization result is lower than the preset threshold (such as 0.85), the problem points in the target legal logic chain can be obtained. Based on the problem points, the problem backtracking is carried out through the Large Language Model (LLM) to cyclically supplement the retrieval, realize the improvement of the target seven W's elements, and then use the improved target seven W's elements to re-characterize the case, so that the entire case characterization process can meet the requirement of "visualizing the adjudication process (which can also be understood as adjudicating based on explicit rules)", thereby achieving the ideal case characterization effect.

[0055] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. 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.

[0056] See Figure 1 This is a flowchart illustrating a case characterization method provided in this embodiment. The method includes the following steps:

[0057] S101: Obtain the legal documents of the pending target case; and extract the target seven Ws elements related to the target case from the legal documents.

[0058] In this embodiment, any legal case that undergoes qualitative processing using the qualitative method provided in this application is defined as a target case pending determination. Furthermore, this embodiment does not limit the language type of the legal documents obtained for the target case pending determination; for example, the legal documents can be Chinese text or English text. This embodiment also does not limit the length of the legal documents; that is, the legal documents can be sentence text (i.e., a collection of words) or paragraph text (i.e., a collection of sentences), etc.

[0059] For example, the legal documents for the target case could be something like, "On the evening of August 15, 2023, in a residential community in District B of City A, the defendant, Li, who owed gambling debts, broke into the home of the victim, Wang, by prying open the lock and stole a mobile phone worth 8,000 yuan and 5,000 yuan in cash, thus committing theft."

[0060] It should be noted that with the widespread application of Large Language Models (LLM) in natural language processing, applicants have considered using LLM to quickly read massive amounts of case files (transcripts, evidence, contracts, chat logs), automatically extract and structure elements (i.e., the ability to subsequently mention when, where, who, what, what, what, what, and why), and apply LLM to the qualitative analysis of legal cases (replacing human experience or rule engines, etc.) in order to transform unstructured text into structured data. This can not only help case handlers quickly grasp the whole picture of the case, but also avoid missing key details, thereby improving the efficiency and accuracy of the qualitative analysis of legal cases, and ultimately achieving the ideal case qualitative effect.

[0061] Large Language Models (LLMs) are deep learning-based language models that can generate new language expressions, such as text, sentences, paragraphs, and even articles, based on input text content. LLMs are trained using an autoregressive approach to generate language rules and patterns from a large language dataset, and can simulate human commands to generate language expressions (such as text data). Specifically, when generating new text data, LLMs predict the probability of the next language unit based on previously generated content until a complete text dataset is generated.

[0062] Specifically, after obtaining the legal documents for the pending target case, such as Figure 2 As shown, the content of the legal document can first be integrated into a pre-built prompt template to generate a seven-question element extraction instruction. This instruction is then input into a Large Language Model (LLM) to extract the seven questions: "when," "where," "who," "what," "how," "object," and "why." These seven questions are then used as the target seven questions related to the target case to execute subsequent step S102. In practical applications, after constructing the seven-question element extraction instruction, the LLM API can be called first, and then the JSON format results returned by the model can be parsed to further verify the completeness and consistency of the extraction results.

[0063] For example, a design example of a pre-built prompt template is shown below:

[0064] "You are a legal text information extraction expert. Please extract the seven elements from the given text" and output a strict JSON (without any extraneous text).

[0065] Feature type qualification: ['When', 'Where', 'Who', 'What', 'How', 'Object', 'Why'].

[0066] Output format: {"elements":[{"type":"type","text":"original text excerpt"},...]}

[0067] rule:

[0068] - Retain the original wording and do not rewrite it.

[0069] - Multiple items of the same type are allowed

[0070] - Do not output if uncertain.

[0071] Text: {text}.

[0072] Thus, for the legal document of the target case in the example above, "On the evening of August 15, 2023, in a residential community in District B of City A, the defendant Li, due to gambling debts, broke into the home of the victim Wang by picking the lock and stole a mobile phone worth 8,000 yuan and 5,000 yuan in cash, committing the crime of theft," after integrating it into the prompt template, generating the seven-way element extraction instruction, and inputting it into the Large Language Model (LLM), the example content of the model output result can be as follows:

[0073] {

[0074] "elements": [

[0075] {"type": "When", "text": "Evening of August 15, 2023"},

[0076] {"type": "Where","text": "Inside a residential community in District B, City A"},

[0077] {"type" : "Who","text" : "Defendant Li Mou"},

[0078] {"type" : "Who","text" : "Victim Wang Mou"},

[0079] {"type": "Why","text": "Debts incurred due to gambling"},

[0080] {"type" : "How","text" : "Used lock picking method"},

[0081] {"type": "How","text": "Entered the home of the victim, Wang"}

[0082] {"type": "How","text": "Stolen"},

[0083] {"type" : "Object","text" : "A mobile phone worth 8000 yuan"},

[0084] {"type": "Object","text": "Cash 5000 yuan"},

[0085] {"type" : "What","text" : "Committed theft"} ]

[0087] }".

[0088] S102: Calculate the weight values ​​corresponding to the target seven elements; and use the preset case attenuation factor to determine the weight matrix corresponding to the target seven elements by adjusting the weight values ​​corresponding to the target seven elements.

[0089] In this embodiment, after extracting the target KJ elements related to the target case through step S101, in order to improve the efficiency and accuracy of case characterization and solve the problems of semantic generalization and timeliness filtering, the type importance weight (represented as type_weight), position weight (represented as pos_weight), and length weight (represented as length_weight) corresponding to each element in the target KJ elements can be calculated first. Then, the type importance weight (type_weight), position weight (pos_weight), and length weight (length_weight) corresponding to each element are weighted and summed to obtain the comprehensive weight value corresponding to each element in the target KJ elements. Next, a preset case attenuation factor (the specific value is not limited and can be preset according to the actual situation and experience) can be used to adjust the weight values ​​corresponding to the target KJ elements to determine the weight matrix (represented as weight_matrix) corresponding to the target KJ elements, such as... Figure 2 As shown, this is used to execute the subsequent step S103.

[0090] It should be noted that, in order to further improve the efficiency and accuracy of case characterization, before calculating the weight values ​​of the target seven elements, the fields of each extracted element can be expanded to enrich the element content and facilitate the subsequent construction of a more complete weight matrix.

[0091] The field expansion performed on each extracted feature mainly includes the following three fields:

[0092] The first field is start_idx, which indicates the element's position in the original legal document, helping to understand the element's context and importance. The position at the beginning of the text is set to 0.

[0093] The second field is `tokens`, which represents the tokenization results of the stored feature text, used for subsequent lexical analysis, keyword extraction, and other processing. The specific method of obtaining it is not limited; for example, it can be obtained using BERT, i.e., `tokens = BertModel.tokenizer()`. The default value for all values ​​is `None`.

[0094] The third field is vector, which represents the semantic vector representation of the feature. It is a 768-dimensional vector (this is just an example value; other dimensions are also possible). The specific method of obtaining it is not limited. For example, it can be obtained using BERT, i.e., vector=BertModel.embedding(). The default value is all 0.

[0095] For example: Based on the above example, after performing field expansion processing on each extracted feature, the sample content of the expanded result can be shown below:

[0096] “[

[0097] {'type' : 'When','text' : 'Evening of August 15, 2023','start_idx' : 0,'tokens' : None,'vector' : [0.0, 0.0, ..., 0.0]},

[0098] {'type' : 'Where','text' : 'Inside a residential community in District B, City A','start_idx' :14,'tokens' : None,'vector' : [0.0, 0.0, ..., 0.0]},

[0099] {'type' : 'Who', 'text' : 'Defendant Li Mou', 'start_idx' : 25, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0100] {'type' : 'Who', 'text' : 'Victim Wang Mou', 'start_idx' : 44, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0101] {'type' : 'Why', 'text' : 'Debts incurred due to gambling', 'start_idx' : 30, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0102] { 'type' : 'How', 'text' : 'Use lock picking method', 'start_idx' : 36, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0103] {'type' : 'How', 'text' : 'Entering the home of the victim Wang', 'start_idx' : 42, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0104] { 'type' : 'How', 'text' : 'Stolen', 'start_idx' : 52, 'tokens' :None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0105] {'type' : 'Object', 'text' : 'A mobile phone worth 8000 yuan', 'start_idx': 55, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0106] {'type' : 'Object', 'text' : 'Cash 5000 yuan', 'start_idx' : 68, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]},

[0107] {'type' : 'What', 'text' : 'Committed theft', 'start_idx' : 76, 'tokens' : None, 'vector' : [0.0, 0.0, ..., 0.0]}

[0108] ]".

[0109] Based on this, the type weight of each element in the seven Ws is usually determined according to the actual situation and business experience. The specific value is not limited. It can be understood that for legal cases, the cause of action is usually the most important, followed by the behavior, the person, the item, the reason, the time, and the place. The importance weight of different types of elements can be set accordingly. Example values ​​are shown below:

[0110] type_weights = {

[0111] "What": 1.0, # The cause of the case is the most important

[0112] "How": 0.9, # The behavior is the second most important

[0113] "Who": 0.8, # The person is important

[0114] "Object": 0.7, # The item is important

[0115] "Why": 0.6, # The reason is important

[0116] "When": 0.5, # The time is moderately important

[0117] "Where": 0.5 # The location is moderately important

[0118] }

[0119] For the position weight (pos_weight) of each element in the 5W2H elements, its value is usually set according to the position where the element first appears in the legal document, and the specific value is not limited. In practical applications, when calculating the position weight (the importance of the beginning of the text is higher), the text quality within the preset reference length (denoted as reference_length, the specific value is limited and can be set according to the actual situation and empirical values, such as it can be set to 1000, etc.) can be measured according to experience. If start_idx < reference_length, the calculation formula for the position weight can be: pos_weight = 1.0 - (start_idx / reference_length), otherwise, pos_weight = 0.3. Here, 0.3 is only an example value, and other values can also be taken.

[0120] In addition, for the length weight (length_weight) of each element in the 5W2H elements, its value is usually set according to the number of times the element appears in the legal document. The longer the text, the more information it usually contains, and the specific value is not limited. In practical applications, when calculating the length weight (length_weight), if the text length is less than 50 (only an example value, and other values can also be taken), the calculation formula for the length weight can be: length_weight = length / 50, otherwise, length_weight = 1.

[0121] Furthermore, by weighting and summing the type importance weight (type_weight), position weight (pos_weight), and length weight (length_weight) for each element, we can obtain the comprehensive weight (denoted as base_weight) for each element in the target geometric elements. The specific calculation formula is as follows:

[0122] base_weight=(0.5*type_weight+0.3*pos_weight+0.2*length_weight)

[0123] Among them, 0.5, 0.3, and 0.2 are just example values, and can be set to other values ​​according to actual situations and experience.

[0124] It should also be noted that, regarding the pre-defined case attenuation factor (denoted as DecayFactor) mentioned above in this application, in the weighting of legal elements (the seven "what" elements: when, where, who, what, how, object, and why), the case attenuation factor refers to an adjustment coefficient related to a case type, used to dynamically adjust the importance weight of different element types. Based on legal expertise, it reflects the different importance of various elements in different types of cases. For example, in theft, the focus is on the value of the property and the act of theft; in intentional injury, the focus is on the degree of injury and subjective intent; and in contract fraud, the focus is on fabricating facts and the delivery of property. The specific value of the attenuation factor is usually pre-set based on actual circumstances and business experience.

[0125] For example, the case attenuation factors for various elements corresponding to theft, intentional injury, robbery, fraud, and contract fraud, as well as the example values ​​for the case attenuation factors for various elements in the default position corresponding to unknown case types, can be shown below:

[0126] {

[0127] "Theft": {

[0128] "When": 0.8, # Time is relatively unimportant

[0129] "Where": 0.9, # Location of moderate importance

[0130] "Who": 1.1, # The person is relatively important

[0131] "What": 1.0, # The cause of action is important (fixed)

[0132] "How": 1.4, # The method of theft is very important

[0133] "Object": 1.3, # The value of the property is very important.

[0134] "Why": 0.9 # Motivation is of moderate importance

[0135] },

[0136] "Intentional injury": {

[0137] "When": 0.7,

[0138] "Where": 0.8,

[0139] "Who": 1.2, # The perpetrator and the victim are very important.

[0140] "What": 1.0,

[0141] "How": 1.3, # The method of causing damage is very important

[0142] "Object": 0.6, # The murder weapon is relatively unimportant

[0143] "Why": 1.1 # Motivation is more important

[0144] },

[0145] "Robbery": {

[0146] "When": 0.8,

[0147] "Where": 0.9,

[0148] "Who": 1.1,

[0149] "What": 1.0,

[0150] "How": 1.5, # Violent methods are very important

[0151] "Object": 1.2, # Important items stolen

[0152] Why: 0.8

[0153] },

[0154] "Fraud": {

[0155] "When": 0.9,

[0156] "Where": 0.7, # Location is usually not important

[0157] "Who": 1.1,

[0158] "What": 1.0,

[0159] "How": 1.4, # Scam tactics are very important

[0160] "Object": 1.3, # The amount of money involved in the scam is very important

[0161] Why: 1.0 # The purpose of illegal possession is important

[0162] },

[0163] "Contract fraud": {

[0164] "When": 0.9,

[0165] "Where": 0.7,

[0166] "Who": 1.2, # Both parties to the contract are very important

[0167] "What": 1.0,

[0168] "How": 1.5, # Fabricating facts is important

[0169] "Object": 1.4, # Contract amount is important

[0170] Why: 1.1 # The purpose of illegal possession is important

[0171] },

[0172] # Default configuration (for unknown case types)

[0173] "default": {

[0174] "When": 1.0,

[0175] "Where": 1.0,

[0176] "Who": 1.0,

[0177] "What": 1.0,

[0178] "How": 1.0,

[0179] "Object": 1.0,

[0180] Why: 1.0

[0181] }

[0182] }".

[0183] Based on this, an optional implementation method is to use these preset case attenuation factors to determine the weight matrix corresponding to the target KYC elements by adjusting the weight values ​​of the target KYC elements. The specific implementation process may include:

[0184] First, a large language model is used to identify the target case type (e.g., which category it belongs to, such as theft, intentional injury, robbery, fraud, contract fraud, etc.; if no suitable category can be found, it can be determined as an unknown case type). Then, the product of the preset case attenuation factor corresponding to the target case type (such as the values ​​of each case attenuation factor mentioned in the example above) and the comprehensive weight (base_weight) value corresponding to each element in the target seven-way elements is calculated as the adjusted comprehensive weight (represented as adjusted_weight) value corresponding to each element in the target seven-way elements. The specific calculation formula is as follows:

[0185] adjusted_weight=base_weight*decay_factor

[0186] Wherein, adjusted_weight represents the adjusted comprehensive weight value corresponding to each of the seven target elements; base_weight represents the comprehensive weight value corresponding to each of the seven target elements; and decay_factor represents the value of the preset case decay factor.

[0187] Then, the adjusted total weight (adjusted_weight) values ​​for each of the seven target elements can be summed to obtain the total adjusted weight (represented as total_adjusted) value for each element. The specific calculation formula is as follows:

[0188] total_adjusted = sum(adjusted_weight)

[0189] The sum() function performs a summation calculation.

[0190] Next, the ratio between the adjusted total weight (adjusted_weight) and the summed total weight (total_adjusted) for each element is calculated and used as the final weight (final_weight) for that element. The specific calculation formula is as follows:

[0191] final_weight=adjusted_weight / total_adjusted

[0192] Furthermore, after performing field expansion processing on each element, the weight matrix corresponding to the target geometric element can be constructed by combining the comprehensive weight (base_weight), adjusted comprehensive weight (adjusted_weight), and final weight (final_weight) of each element with the obtained expansion results.

[0193] For example: Based on the above example, regarding the legal document of the target case mentioned above, "On the evening of August 15, 2023, in a residential community in District B of City A, the defendant Li, due to gambling debts, broke into the home of the victim Wang by picking the lock and stole a mobile phone worth 8,000 yuan and 5,000 yuan in cash, committing theft.", the sample content of the weight matrix corresponding to the target seven elements can be as follows:

[0194] “[

[0195] {'type' : 'When','text' : 'Evening of August 15, 2023','start_idx' : 0,'tokens' : ['202', '##3', 'Year', '8', 'Month', '15', 'Day', 'Evening', 'Time'],'vector' :[-1.1168783903121948, 1.6438777446746826, ... , -0.05398029088973999], 'base_weight' : 0.5980, adjusted_weight : 0.4784, final_weight : 0.0540},

[0196] {'type' : 'Where','text' : 'Inside a certain residential community in District B, City A','start_idx' :14,'tokens' : ['A', 'City', 'B', 'District', 'certain', 'resident', 'community', 'small', 'district', 'inside'],'vector' : [-0.10185160487890244, 0.5344988107681274, ... ,0.3058702349662781], 'base_weight' : 0.5858, adjusted_weight : 0.5272, final_weight : 0.0595},

[0197] {"type": "Who", "text": "Defendant Li", "start_idx": 25, "tokens": ["被", "告", "人", "李", "某"], "vector": [-0.17935135960578918,0.4197244346141815,... , 0.1978841871023178], "base_weight": 0.7125, "adjusted_weight": 0.7838, "final_weight": 0.0885},

[0198] {"type": "Who", "text": "Victim Wang", "start_idx": 44, "tokens": ["被", "害", "人", "王", "某"], "vector": [0.01899295300245285,0.4222692847251892,... , 0.2840574085712433], "base_weight": 0.7068, "adjusted_weight": 0.7775, "final_weight": 0.0878},

[0199] {"type": "Why", "text": "Due to gambling debts", "start_idx": 30, "tokens": ["因", "赌", "博", "欠", "债"], "vector": [0.16258767247200012,0.4994851052761078,... , 0.1623823642730713], "base_weight": 0.611, "adjusted_weight": 0.5499, "final_weight": 0.0621},

[0200] { 'type' : 'How', 'text' : 'Use lock picking method', 'start_idx' : 36, 'tokens' : ['take', 'get', 'pry', 'lock', 'method', 'style'], 'vector' : [-0.5265649557113647, 0.21795113384723663, ... , 0.3602695167064667], 'base_weight' : 0.7632, adjusted_weight : 1.0685, final_weight : 0.1206},

[0201] {'type' : 'How', 'text' : 'Entering the home of victim Wang', 'start_idx' : 42,'tokens' : ['enter', 'enter', 'victim', 'person', 'Wang', 'someone', 'home', 'in'], 'vector' :[-0.09023622423410416, 0.21245823800563812, ... , 0.19171105325222015], 'base_weight' : 0.7734, adjusted_weight : 1.0828, final_weight : 0.1222},

[0202] { 'type' : 'How', 'text' : 'Stealed', 'start_idx' : 52, 'tokens' : ['Stealed', 'Stealed', 'Left'], 'vector' : [-0.6418704986572266, 0.34471607208251953, ..., -0.10079636424779892], 'base_weight' : 0.7464, adjusted_weight : 1.0450, final_weight : 0.1180, adjusted_weight : 1.0450, final_weight : 0.1180},

[0203] {"type": "Object", "text": "A mobile phone worth 8,000 yuan", "start_idx": 55, "tokens": ["一", "部", "价", "值", "8000", "元", "的", "手", "机"], "vector": [0.3633929491043091, -0.2349979728460312, ..., -0.4205746054649353], "base_weight": 0.6815, "adjusted_weight": 0.8860, "final_weight": 0.1000},

[0204] {"type": "Object", "text": "5,000 yuan in cash", "start_idx": 68, "tokens": ["现", "金", "5000", "元"], "vector": [-0.47127217054367065, 0.4088614881038666, ..., 0.08657730370759964], "base_weight": 0.6576, "adjusted_weight": 0.8549, "final_weight": 0.0965},

[0205] {"type": "What", "text": "Committed the crime of theft", "start_idx": 76, "tokens": null, "vector": [-0.41919344663619995, 0.35285091400146484, ..., 0.46851301193237305], "base_weight": 0.8052, "adjusted_weight": 0.8052, "final_weight": 0.0909}

[0206] ”.

[0207] S103: Screen out the target case laws from the case law library that match the weight matrix corresponding to the target seven Ws; and screen out the target legal provisions from the legal provision library that match the weight matrix corresponding to the target seven Ws.

[0208] In this embodiment, after determining the weight matrix corresponding to the target geometric elements in step S102, further, as follows: Figure 2 As shown, a hierarchical dual-channel retrieval can be performed on the case study database and the legal provision database. The case study database precisely filters out target cases that better match the weight matrix corresponding to the target KYC elements, and the legal provision database precisely filters out target legal provisions that better match the weight matrix corresponding to the target KYC elements, for use in subsequent step S104. This simultaneously solves the problems of semantic generalization (i.e., compared to existing similar case recommendation methods such as Doc2Vec, this thesaurus matching method achieves more accurate semantic matching and expansion) and timeliness filtering (such as filtering out case studies older than 5 years and filtering out expired legal provisions).

[0209] Specifically, one possible implementation is that, in order to accurately match target similar cases that are more relevant to the target case, after determining the weight matrix (weight_matrix) corresponding to the target seven W's elements, the weight matrix corresponding to the similar case elements can be filtered out from the weight matrix (weight_matrix) corresponding to the target seven W's elements. The specific content of the similar case elements is not limited and can be set according to the actual situation and experience values. For example, for the target seven W's elements composed of "when, where, who, what, how, object, and why", the weight matrix corresponding to the similar case elements filtered out from its corresponding weight matrix (weight_matrix) can be the weight matrix corresponding to the three elements "how", "what", and "object", and the set of similar case elements composed of these three elements can be represented as case_elements.

[0210] For example: Based on the above example, regarding the legal document of the target case mentioned above, "On the evening of August 15, 2023, in a residential community in District B of City A, the defendant Li, due to gambling debts, broke into the home of the victim Wang by picking the lock and stole a mobile phone worth 8,000 yuan and 5,000 yuan in cash, thus committing theft," the weight matrix corresponding to the target seven "how" elements can be used to select the following example of the case element set (case_elements) consisting of the three elements "how," "what," and "object":

[0211] “[

[0212] { 'type' : 'How', 'text' : 'Use lock picking method', 'start_idx' : 36, 'tokens' : ['take', 'get', 'pry', 'lock', 'method', 'style'], 'vector' : [-0.5265649557113647, 0.21795113384723663, ... , 0.3602695167064667], 'base_weight' : 0.7632, adjusted_weight : 1.0685, final_weight : 0.1206},

[0213] {'type' : 'How', 'text' : 'Entering the home of victim Wang', 'start_idx' : 42,'tokens' : ['enter', 'enter', 'victim', 'person', 'Wang', 'someone', 'home', 'in'], 'vector' :[-0.09023622423410416, 0.21245823800563812, ... , 0.19171105325222015], 'base_weight' : 0.7734, adjusted_weight : 1.0828, final_weight : 0.1222},

[0214] { 'type' : 'How', 'text' : 'Stealed', 'start_idx' : 52, 'tokens' : ['Stealed', 'Stealed', 'Left'], 'vector' : [-0.6418704986572266, 0.34471607208251953, ..., -0.10079636424779892], 'base_weight' : 0.7464, adjusted_weight : 1.0450, final_weight : 0.1180, adjusted_weight : 1.0450, final_weight : 0.1180},

[0215] {"type": "Object", "text": "A mobile phone worth 8,000 yuan", "start_idx": 55, "tokens": ["一", "部", "价", "值", "8000", "元", "的", "手", "机"], "vector": [0.3633929491043091, -0.2349979728460312, ..., -0.4205746054649353], "base_weight": 0.6815, "adjusted_weight": 0.8860, "final_weight": 0.1000},

[0216] {"type": "Object", "text": "5,000 yuan in cash", "start_idx": 68, "tokens": ["现", "金", "5000", "元"], "vector": [-0.47127217054367065, 0.4088614881038666, ..., 0.08657730370759964], "base_weight": 0.6576, "adjusted_weight": 0.8549, "final_weight": 0.0965},

[0217] {"type": "What", "text": "Committed the crime of theft", "start_idx": 76, "tokens": None, "vector": [-0.41919344663619995, 0.35285091400146484, ..., 0.46851301193237305], "base_weight": 0.8052, "adjusted_weight": 0.8052, "final_weight": 0.0909}

[0218] ”.

[0219] Then, candidate similar cases with the top-K cosine similarities of the weight matrix corresponding to the similar case elements can be screened out from the similar case library, where K is a positive integer greater than 0. The specific calculation formula is as follows:

[0220] similarity_score=cosine_similarity(query_vector,case_vector)

[0221] Among them, query_vector represents the semantic vector representation of each element in the case element set (case_elements); case_vector represents the semantic vector representation of the corresponding element in the case stored in the case library; similarity_score represents the cosine similarity score; and cosine_similarity() represents the function of calculating cosine similarity.

[0222] Next, the Top-K candidate cases can be sorted from most recent to oldest based on their occurrence time, and candidate cases older than 5 years can be filtered out from the sorting results to obtain the filtered target cases. The Top-K candidate cases can include, but are not limited to, core fields such as title, abstract, relevant legal provisions, and similarity score.

[0223] For example, taking K=5 as an example, after obtaining the top-5 candidate cases with the highest cosine similarity scores, these 5 candidate cases are sorted from most recent to oldest in terms of occurrence time. Candidate cases older than 5 years are then filtered out, and the top-3 candidate cases (if there are fewer than 3, the most recent top-3 candidate cases can be retained) are kept as the target cases. A specific example is shown below:

[0224] 1. Li's theft case (Similarity: 0.8542)

[0225] Abstract: In August 2023, Li, who owed gambling debts, broke into Wang's home and stole his mobile phone and cash.

[0226] Relevant legal provision: Article 264 of the Criminal Law

[0227] 2. Zhang's burglary case (Similarity: 0.7321)

[0228] Abstract: In May 2022, Zhang used lock-picking techniques to break into a resident's home and steal valuables.

[0229] Relevant legal provision: Article 264 of the Criminal Law

[0230] 3. Wang's robbery case (similarity: 0.4215)

[0231] Abstract: In June 2023, Wang robbed a passerby of his mobile phone and wallet at gunpoint.

[0232] Relevant legal provision: Article 263 of the Criminal Law

[0233] Another alternative implementation is to accurately match the target legal provisions that are more relevant to the target case. After determining the weight matrix corresponding to the target seven W's, we can first filter out the weight matrix corresponding to the legal provision elements from the weight matrix corresponding to the target seven W's. The specific content of the legal provision elements is not limited and can be set according to the actual situation and experience. For example, for the target seven W's consisting of "when, where, who, what, how, object, and why", the weight matrix corresponding to the legal provision elements filtered out from its corresponding weight matrix can be the weight matrix corresponding to the three elements "what", "why", and "how". The set of legal provision elements composed of these three elements can be represented as law_elements.

[0234] For example: Based on the above example, regarding the legal document of the target case mentioned above, "On the evening of August 15, 2023, in a residential community in District B of City A, the defendant Li, due to gambling debts, broke into the home of the victim Wang by picking the lock and stole a mobile phone worth 8,000 yuan and 5,000 yuan in cash, thus committing theft," the weight matrix corresponding to the target seven elements can be analyzed as follows: The example content of the legal element set (law_elements) composed of the three elements "what," "why," and "how" can be as follows:

[0235] “[

[0236] {'type' : 'Why', 'text' : 'Gambling debt', 'start_idx' : 30, 'tokens' : ['cause', 'gambling', 'betting', 'owe', 'debt'], 'vector' : [0.16258767247200012,0.4994851052761078, ... , 0.1623823642730713], 'base_weight' : 0.611,adjusted_weight : 0.5499, final_weight : 0.0621},

[0237] { 'type' : 'How', 'text' : 'Use lock picking method', 'start_idx' : 36, 'tokens' : ['take', 'get', 'pry', 'lock', 'method', 'style'], 'vector' : [-0.5265649557113647, 0.21795113384723663, ... , 0.3602695167064667], 'base_weight' : 0.7632, adjusted_weight : 1.0685, final_weight : 0.1206},

[0238] {'type' : 'How', 'text' : 'Entering the home of victim Wang', 'start_idx' : 42,'tokens' : ['enter', 'enter', 'victim', 'person', 'Wang', 'someone', 'home', 'in'], 'vector' :[-0.09023622423410416, 0.21245823800563812, ... , 0.19171105325222015], 'base_weight' : 0.7734, adjusted_weight : 1.0828, final_weight : 0.1222},

[0239] { 'type' : 'How', 'text' : 'Stealed', 'start_idx' : 52, 'tokens' : ['Stealed', 'Stealed', 'Left'], 'vector' : [-0.6418704986572266, 0.34471607208251953, ..., -0.10079636424779892], 'base_weight' : 0.7464, adjusted_weight : 1.0450, final_weight : 0.1180, adjusted_weight : 1.0450, final_weight : 0.1180},

[0240] {'type' : 'What', 'text' : 'Committed theft', 'start_idx' : 76, 'tokens' : None, 'vector' : [-0.41919344663619995, 0.35285091400146484, ... ,0.46851301193237305], 'base_weight' : 0.8052, adjusted_weight : 0.8052, final_weight : 0.0909}

[0241] ]".

[0242] Then, the text in the weight matrix corresponding to the legal provisions can be segmented to obtain legal provisions keywords; and based on a pre-built thesaurus of legal terms, the legal provisions keywords can be expanded to obtain expanded legal provisions keywords (represented as expanded_keywords).

[0243] The specific implementation method and content of the legal-related thesaurus are not limited and can be implemented according to the actual situation and experience. The thesaurus structure and sample content can be as follows:

[0244] {

[0245] "Theft": ["steal", "robbery", "steal", "borrow"],

[0246] "Pry open the lock": ["pry open the door", "break the lock", "damage the lock"],

[0247] "Mobile phone": ["mobile phone", "smartphone", "telephone"],

[0248] "Cash": ["banknotes", "money", "currency"],

[0249] "Gambling": ["betting money", "gambling", "gambling game"],

[0250] "Enter": ["break in", "intrude", "enter the room"]

[0251] }".

[0252] Based on this, the text of various elements in law_elements (such as “What”, “Why”, and “How”) can be segmented into Chinese words, and then expanded based on the thesaurus constructed above to obtain expanded legal keywords (expanded_keywords).

[0253] Next, existing or future text segmentation methods (such as jieba segmentation) can be used to segment each legal provision in the legal provision library, resulting in candidate legal provision segments (denoted as law_keywords). From all candidate legal provision segments (law_keywords), the top-N candidate legal provisions with the highest similarity to the expanded legal provision keywords (expanded_keywords) are selected. Then, expired legal provisions are filtered out from the top-N candidate legal provisions to obtain the filtered target legal provisions. Here, N is a positive integer greater than 0. The top-N candidate legal provisions may include, but are not limited to, core fields such as legal provision, status, similarity score, and effective date.

[0254] For example, first use jieba segmentation to segment Article 264 of the Criminal Law, and the candidate legal provisions segmentation results are shown below:

[0255] "[Theft of public or private property, involving a relatively large amount, or repeated theft, burglary, or carrying a weapon]"

[0256] Theft and pickpocketing are punishable by imprisonment for up to three years, detention, or public surveillance, and may also be subject to other penalties.

[0257] ', single', fine', ;', amount', huge', or', with', other', serious', circumstances',', shall', three years', not less than', ten years', not more than', imprisonment', ,', and', fine', ;', amount', especially', huge', or', with', other', especially', serious', circumstances',

[0258] The sentence is imprisonment for ten years or more, or life imprisonment, and a fine or confiscation of property.

[0259] Taking N=5 as an example, based on the Jaccard similarity calculation method, the similarity score between the expanded legal provisions keywords and all candidate legal provisions segmented words is calculated. After obtaining the top-5 candidate legal provisions with the highest similarity scores, invalid legal provisions are filtered out from these 5 candidate legal provisions, and the top-3 candidate legal provisions are retained (if all are invalid, only the latest top-1 candidate legal provisions are retained) as the target legal provisions. A specific example is shown below:

[0260] 1. Article 264 of the Criminal Law (Similarity: 0.7824)

[0261] Status: Valid

[0262] Effective Date: 2015-11-01

[0263] 2. Interpretation of Several Issues Concerning the Application of Law in Handling Theft Criminal Cases (Similarity: 0.6543)

[0264] Status: Valid

[0265] Effective Date: 2013-04-02

[0266] 3. Article 263 of the Criminal Law (Similarity: 0.3210)

[0267] Status: Valid

[0268] Effective Date: 2015-11-01

[0269] Based on this, the following result can be obtained by combining the target case and the target legal provision:

[0270] {

[0271] "case_results":[

[0272] {

[0273] "case_name": "Li's Theft Case",

[0274] "similarity": 0.8542,

[0275] Summary: "In August 2023, Li, who owed gambling debts, broke into Wang's home and stole a mobile phone and cash."

[0276] "related_laws": [

[0277] Article 264 of the Criminal Law ]

[0279] },

[0280] {

[0281] "case_name": "Zhang's burglary case",

[0282] "similarity": 0.7321,

[0283] Summary: "In May 2022, Zhang used lock-picking techniques to break into a resident's home and steal valuables."

[0284] "related_laws": [

[0285] Article 264 of the Criminal Law ]

[0287] },

[0288] {

[0289] "case_name": "Wang's robbery case",

[0290] "similarity": 0.4215,

[0291] Summary: "In June 2023, Wang robbed a passerby of their mobile phone and wallet at gunpoint."

[0292] "related_laws": [

[0293] Article 263 of the Criminal Law ]

[0295] } ]

[0297] "law_results":[

[0298] {

[0299] "law_name": "Article 264 of the Criminal Law",

[0300] "similarity": 0.7824,

[0301] "status": "Valid",

[0302] "effective_date": "2015-11-01"

[0303] },

[0304] {

[0305] "law_name": "Interpretation of Several Issues Concerning the Application of Law in Handling Theft Criminal Cases",

[0306] "similarity": 0.6543,

[0307] "status": "Valid",

[0308] "effective_date": "2013-04-02"

[0309] },

[0310] {

[0311] "law_name": "Article 263 of the Criminal Law",

[0312] "similarity": 0.321,

[0313] "status": "Valid",

[0314] "effective_date": "2015-11-01"

[0315] } ]

[0317] }".

[0318] S104: Utilize the target seven W's elements, target similar cases, and target legal provisions to generate prompt instructions, input them into the large language model for legal logic chain generation, and obtain the target legal logic chain for the target case.

[0319] In this embodiment, after obtaining the target case and target legal provision that match the weight matrix corresponding to the target geometric elements through step S103, further, as... Figure 2 As shown, the content of the target seven elements, target similar cases, and target legal provisions can be integrated into the prompt instruction template to generate a prompt instruction. This prompt instruction is then input into the large language model for the generation of an interpretable legal logic chain (which includes a chain of related evidence of "facts -> legal provisions -> similar cases -> conclusions") to obtain the target legal logic chain (represented as logic_chain) for the target case, which is then used to execute the subsequent step S105.

[0320] For example: Based on the above example, the generated prompt command could be as follows:

[0321] "You are a senior judge. Please generate a complete legal logic chain based on the following case facts, relevant similar cases, and legal provisions."

[0322] [Case Facts] #The Seven Elements of Objectives

[0323] [Related Cases] #Target Cases

[0324] [Relevant Legal Provisions] #Target Legal Provisions

[0325]

Task Requirements

[0326] Please generate a structured legal logic chain connecting facts, legal provisions, similar cases, and conclusions. The logic chain should include the following parts:

[0327] 1. Chain of Fact-Finding

[0328] - Transformation from raw text to legal facts

[0329] - Extraction and confirmation of key facts

[0330] 2. Chain of Applicable Law

[0331] - Selection and interpretation of legal provisions

[0332] - Matching analysis of constituent elements

[0333] - The derivation process of legal characterization

[0334] 3. Case Study Reference Chain

[0335] - Identification of similar cases

[0336] Extraction of key points from similar case judgments

[0337] - The reference value of similar cases to current cases

[0338] 4. Reasoning and Decision-Making Chain

[0339] - Step-by-step reasoning from facts to qualitative analysis

[0340] - Analysis and resolution of points of contention

[0341] - The process of forming the final conclusion

[0342] Output Format

[0343] Please output in the following JSON format:

[0344] {{

[0345] "logic_chain": {{

[0346] "nodes": [

[0347] {{

[0348] "id": "Node ID",

[0349] "type": "facts / legal provisions / similar cases / reasoning / conclusion",

[0350] "content": "Node content",

[0351] "confidence": 0.95, # Confidence level

[0352] "source": "Source (e.g., paragraph X of the original text, Article X of the law, similar case X)",

[0353] "supporting_evidence": ["Supporting Evidence 1", "Supporting Evidence 2"]

[0354] }}

[0355] ],

[0356] "edges": [

[0357] {{

[0358] "from": "Starting node ID",

[0359] "to": "Target Node ID",

[0360] "relation": "support / oppose / derive / based on",

[0361] "strength": 0.9, # Confidence level

[0362] "reasoning": a relational reason

[0363] }} ]

[0365] }},

[0366] "summary": {{

[0367] "main_argument": "Main argumentation path",

[0368] "key_turning_points": ["key turning points"],

[0369] "overall_coherence": 0.92 # Confidence level

[0370] }}

[0371] }}

[0372]

Precautions

[0373] 1. Each step of reasoning must have clear evidence.

[0374] 2. Clearly distinguish between the experience references provided by case studies and the normative requirements provided by legal provisions.

[0375] 3. Uncertainty in labeled reasoning

[0376] 4. Maintain logical coherence and consistency.

[0377] Furthermore, after inputting the above prompts into the Large Language Model (LLM), the example content of the target legal logic chain of the target case output by the model can be as follows:

[0378] {

[0379] "logic_chain": {

[0380] "nodes": [

[0381] {

[0382] "id": "N1",

[0383] "type": "fact",

[0384] "content": "On the evening of August 15, 2023, the defendant, Li, broke into the home of the victim, Wang, by prying open the lock."

[0385] "confidence": 0.98,

[0386] "source": "Words 1-42 of the original text",

[0387] "supporting_evidence": ["lock picking method", "entry into the home"]

[0388] },

[0389] {

[0390] "id": "N2",

[0391] "type": "fact",

[0392] "content": "A mobile phone worth 8,000 yuan and 5,000 yuan in cash were stolen, totaling 13,000 yuan",

[0393] "confidence": 0.95,

[0394] "source": "Words 52-74 of the original text",

[0395] "supporting_evidence": ["Mobile phone valued at 8000 yuan", "Cash valued at 5000 yuan"]

[0396] },

[0397] {

[0398] "id": "N3",

[0399] "type": "fact",

[0400] "content": "The motive for the crime was gambling debts",

[0401] "confidence": 0.90,

[0402] "source": "Words 30-35 of the original text",

[0403] "supporting_evidence": ["Debts incurred due to gambling"]

[0404] },

[0405] {

[0406] "id": "N4",

[0407] "type": "law",

[0408] Article 264 of the Criminal Law: Whoever steals public or private property, where the amount is relatively large, shall be sentenced to fixed-term imprisonment of not more than three years... Whoever commits burglary shall be punished more severely.

[0409] "confidence": 0.95,

[0410] "source": "Legal provisions search results",

[0411] "supporting_evidence": ["Article 264 of the Criminal Law"]

[0412] },

[0413] {

[0414] "id": "N5",

[0415] "type": "law",

[0416] "content": "Judicial interpretation: Theft amounting to 1,000-3,000 yuan or more is considered 'relatively large amount', and theft amounting to 30,000-100,000 yuan or more is considered 'huge amount'",

[0417] "confidence": 0.92,

[0418] "source": "Interpretation of Several Issues Concerning the Application of Law in Handling Theft Criminal Cases",

[0419] "supporting_evidence": ["Article 1 of the Judicial Interpretation"]

[0420] },

[0421] {

[0422] "id": "N6",

[0423] "type": "case",

[0424] "content": "Li's theft case (similarity 0.8542): Similar to burglary by picking locks, it was identified as burglary and he was sentenced to 1 year and 6 months in prison."

[0425] "confidence": 0.88,

[0426] "source": "First result of the similar case search",

[0427] "supporting_evidence": ["Similar facts: lock picking, burglary, theft of mobile phones and cash", "Verdict: Burglary"]

[0428] },

[0429] {

[0430] "id": "N7",

[0431] "type": "case",

[0432] "content": "Zhang's burglary case (similarity 0.7321): Burglary using lock picking techniques, also classified as burglary",

[0433] "confidence": 0.85,

[0434] "source": "Second result of the similar case search",

[0435] "supporting_evidence": ["Similar methods: disruptive entry into a residence"]

[0436] },

[0437] {

[0438] "id": "N8",

[0439] "type": "inference",

[0440] "content": "Prying open a lock to enter someone else's residence meets the requirement of 'illegally entering a dwelling used for family living' in the context of 'burglary'",

[0441] "confidence": 0.90,

[0442] "source": "Fact N1 + Legal Provision N4 + Similar Cases N6, N7",

[0443] "supporting evidence": ["Fact: Breaking into a home", "Legal provision: Definition of burglary", "Similar cases: Similar situations are all considered burglary"]

[0444] },

[0445] {

[0446] "id": "N9",

[0447] "type": "inference",

[0448] "content": "The total amount stolen was 13,000 yuan, which meets the standard of 'relatively large amount' but has not yet reached the standard of 'huge amount'",

[0449] "confidence": 0.95,

[0450] "source": "Fact N2 + Legal Provision N5",

[0451] "supporting_evidence": ["Amount: 13,000 yuan", "Judicial interpretation: Amounts of 1,000-3,000 yuan or more are considered substantial"]

[0452] },

[0453] {

[0454] "id": "N10",

[0455] "type": "inference",

[0456] "content": "The motive of incurring gambling debts indicates significant subjective malice, which can be considered an aggravating circumstance."

[0457] "confidence": 0.80,

[0458] "source": "Fact N3 + Case Study Experience",

[0459] "supporting_evidence": ["Motive: Gambling debt", "Judicial practice: Egregious motives are often considered as aggravating factors"]

[0460] },

[0461] {

[0462] "id": "N11",

[0463] "type": "conclusion",

[0464] "content": "Li's actions constitute theft, and there are aggravating circumstances of burglary, and the amount stolen is relatively large."

[0465] "confidence": 0.92,

[0466] "source": "Reasoning N8 + N9",

[0467] "supporting_evidence": ["Burden burglary established", "Substantial amount established"]

[0468] }

[0469] ],

[0470] "edges": [

[0471] {

[0472] "from": "N1",

[0473] "to": "N8",

[0474] "relation": "derived",

[0475] "strength": 0.9,

[0476] "reasoning": "Prying open the lock to enter a home is a key fact in establishing burglary."

[0477] },

[0478] {

[0479] "from": "N4",

[0480] "to": "N8",

[0481] "relation": "based on",

[0482] "strength": 0.95,

[0483] "reasoning": "Article 264 of the Criminal Law stipulates the elements of burglary."

[0484] },

[0485] {

[0486] "from": "N6",

[0487] "to": "N8",

[0488] "relation": "support",

[0489] "strength": 0.88,

[0490] "reasoning": "Similar cases support the determination of burglary."

[0491] },

[0492] {

[0493] "from": "N2",

[0494] "to": "N9",

[0495] "relation": "derived",

[0496] "strength": 0.95,

[0497] "reasoning": "The amount of 13,000 yuan meets the standard for a relatively large amount."

[0498] },

[0499] {

[0500] "from": "N5",

[0501] "to": "N9",

[0502] "relation": "based on",

[0503] "strength": 0.92,

[0504] "reasoning": "The judicial interpretation clarifies the monetary standards."

[0505] },

[0506] {

[0507] "from": "N8",

[0508] "to": "N11",

[0509] "relation": "support",

[0510] "strength": 0.9,

[0511] "reasoning": "Burden is an aggravating circumstance of theft."

[0512] },

[0513] {

[0514] "from": "N9",

[0515] "to": "N11",

[0516] "relation": "support",

[0517] "strength": 0.95,

[0518] "reasoning": "A substantial amount is a fundamental element of the crime of theft."

[0519] },

[0520] {

[0521] "from": "N10",

[0522] "to": "N11",

[0523] "relation": "impact",

[0524] "strength": 0.8,

[0525] "reasoning": "Motive affects sentencing but not the nature of the offense."

[0526] } ]

[0528] },

[0529] "summary": {

[0530] "main_argument": "The theft charge is inferred from the facts of the burglary and the relatively large amount involved."

[0531] "key_turning_points": ["Determination of burglary", "Application of monetary standards"],

[0532] "overall_coherence": 0.91

[0533] }

[0534] }".

[0535] S105: Utilize the target legal logic chain to generate a case characterization instruction, input it into the large language model for case characterization processing, and obtain the case characterization result for the target case.

[0536] In this embodiment, after obtaining the target legal logic chain (containing the associated evidence chain of "facts -> legal provisions -> similar cases -> conclusion") regarding the target case through step S104, further, as... Figure 2 As shown, the content of the target legal logic chain can be integrated into the prompt template to generate a case characterization instruction. This instruction is then input into the large language model, which uses the model to characterize the target case based on the target legal logic chain, resulting in a case characterization outcome. The composition and content of the case characterization outcome are not limited. For example, a case characterization analysis report (represented as qualitative_analysis) can be generated as the case characterization outcome, which may include, but is not limited to, a case description, a summary of illegal facts, mitigating and aggravating circumstances, a summary of criminal facts, and a summary opinion.

[0537] For example: Based on the above examples, the sample content of the generated case characterization instruction can be as follows:

[0538] "You are an experienced prosecutor. Please write a complete case characterization analysis report based on the following legal logic chain."

[0539] [Legal Logic Chain]

[0540] Original elements of the case

[0541]

Task Requirements

[0542] Please write a structured case qualitative analysis report, including the following sections:

[0543] 1. Case Description

[0544] - Basic information such as time, place, and people

[0545] - Main facts of the crime

[0546] - Summary of key evidence

[0547] 2. Summary of illegal facts

[0548] - List the illegal acts one by one

[0549] - Legal nature of illegal acts

[0550] - Correlation between illegal acts

[0551] 3. Analysis of Applicable Law

[0552] - Applicable legal provisions

[0553] - Component matching analysis

[0554] - Legal basis for characterization

[0555] 4. Analysis of mitigating and aggravating circumstances

[0556] - Legally aggravating circumstances (if any)

[0557] - Legally mitigating circumstances (if any)

[0558] - Discretionary plot analysis

[0559] 5. Summary of the facts of the crime

[0560] - Analysis of the four elements constituting a crime

[0561] - Comprehensive judgment of the nature of the crime

[0562] - Social harm assessment of crime

[0563] 6. Summary and Comments

[0564] - Overall evaluation of the case

[0565] - Handling suggestions

[0566] - Issues requiring further investigation

[0567] Output Format

[0568] Please output in the following JSON format:

[0569] {{

[0570] "qualitative_analysis": {{ # Case description

[0571] "case_description": {{

[0572] "basic_info": "Basic Information",

[0573] "key_facts": ["Key Fact 1", "Key Fact 2"],

[0574] "evidence_summary": "Evidence summary"

[0575] }},

[0576] "violation_summary": {{ # Summary of illegal facts

[0577] "violations": [

[0578] {{

[0579] "act": "illegal behavior",

[0580] "nature": "legal nature",

[0581] "legal_basis": "Legal basis"

[0582] }}

[0583] ],

[0584] "interconnections": "Analysis of associations between illegal activities"

[0585] }},

[0586] "legal_application": {{ # Legal application analysis

[0587] "applicable_laws": ["Applicable Law 1", "Applicable Law 2"],

[0588] "element_matching": {{

[0589] "subjective_element": "Subjective requirement fulfillment status",

[0590] "objective_element": "Status of objective requirements met",

[0591] "object_element": "Object requirement satisfaction status",

[0592] "subject_element": "Status of fulfillment of the main requirements"

[0593] }},

[0594] "qualification_basis": Qualitative basis

[0595] }},

[0596] "sentencing_factors": {{ # Analysis based on severity

[0597] "aggravating": [

[0598] {{

[0599] "factor": "aggravating circumstances",

[0600] "type": "statutory / discretionary",

[0601] "strength": "intensity",

[0602] "impact": "effect"

[0603] }}

[0604] ],

[0605] "mitigating": [

[0606] {{

[0607] "factor": "mitigating circumstances",

[0608] "type": "statutory / discretionary",

[0609] "strength": "intensity",

[0610] "impact": "effect"

[0611] }} ]

[0613] }},

[0614] "crime_summary": {{ # Summary of the facts of the crime

[0615] "four_elements_analysis": {{

[0616] "subjective_aspect": "Subjective aspect analysis",

[0617] "objective_aspect": "Objective aspect analysis",

[0618] "object": "Object Analysis",

[0619] "subject": "Subject Analysis"

[0620] }},

[0621] "crime_nature": "criminal nature",

[0622] "social_harm": "Social harm assessment"

[0623] }},

[0624] "overall_assessment": {{ # Overview comments

[0625] "conclusion": Overall conclusion

[0626] "recommendations": ["Suggestions for handling"],

[0627] "further_investigation": ["The issue needs further investigation"]

[0628] }}

[0629] }},

[0630] "confidence_scores": {{ # Confidence score

[0631] "fact_certainty": 0.95,

[0632] "legal_applicability": 0.92,

[0633] "overall_reliability": 0.90

[0634] }}

[0635] }}

[0636]

Precautions

[0637] 1. Analysis must be based on reasoning within a logical chain.

[0638] 2. Clearly indicate which conclusions are supported by strong evidence and which are subject to uncertainty.

[0639] 3. Distinguish between factual findings and legal evaluation.

[0640] 4. Maintain a professional, objective, and rigorous tone.

[0641] Furthermore, after inputting the above case characterization instructions into the Large Language Model (LLM), the example content of the case characterization result of the model output regarding the target case can be as follows:

[0642] {

[0643] "qualitative_analysis": {

[0644] "case_description": {

[0645] "basic_info": "On the evening of August 15, 2023, in a residential community in District B of City A",

[0646] "key_facts": [

[0647] "The defendant, Li, broke into the home of the victim, Wang, by prying open the lock."

[0648] "Stealed a mobile phone worth 8,000 yuan and 5,000 yuan in cash, totaling 13,000 yuan."

[0649] The motive for the crime was gambling debts.

[0650] ],

[0651] "evidence_summary": "The existing evidence includes the case statement and the assessed value of the stolen items, which directly prove the burglary."

[0652] },

[0653] "violation_summary": {

[0654] "violations": [

[0655] {

[0656] "act": "illegally entering another person's residence",

[0657] "nature": "Methods and actions that create conditions for theft",

[0658] "legal_basis": "Article 245 of the Criminal Law (Crime of Illegal Intrusion into a Residence) has been absorbed."

[0659] },

[0660] {

[0661] "act": "secretly stealing other people's property",

[0662] "nature": "purposeful act, infringement of property rights",

[0663] "legal_basis": "Article 264 of the Criminal Law (Theft)"

[0664] }

[0665] ],

[0666] "Interconnections": "Illegal intrusion into a residence is a means of theft; the two are related and should be punished as a single crime of theft, with a heavier penalty."

[0667] },

[0668] "legal_application": {

[0669] "applicable_laws": ["Article 264 of the Criminal Law", "Interpretation on Several Issues Concerning the Application of Law in Handling Theft Criminal Cases"],

[0670] "element_matching": {

[0671] "subjective_element": "with the intent to illegally possess, and with clear subjective intent",

[0672] "objective_element": "committed an act of covert theft of property",

[0673] "object_element": "Infringed upon Wang's property rights",

[0674] "subject_element": "Li has reached the age of criminal responsibility and has the capacity for criminal responsibility."

[0675] },

[0676] "qualification_basis": "Fully meets the elements of theft, and also has the aggravating circumstance of burglary."

[0677] },

[0678] "sentencing_factors": {

[0679] "aggravating": [

[0680] {

[0681] "factor": "burglary",

[0682] "type": "legal",

[0683] "strength": "strong",

[0684] "impact": "Increase the penalty on top of the base sentence"

[0685] },

[0686] {

[0687] "factor": "Premeditated crime (preparation of lock-picking tools)",

[0688] "type": "Discretionary",

[0689] "strength": "Medium",

[0690] "impact": "Reflects relatively large subjective malignancy"

[0691] },

[0692] {

[0693] "factor": "Criminal motive of gambling debts",

[0694] "type": "Discretionary",

[0695] "strength": "Medium",

[0696] "impact": "The motive is abominable and can be given a heavier punishment as appropriate"

[0697] }

[0698] ,

[0699] "mitigating":

[0700] {

[0701] "factor": "No prior convictions (based on available information)",

[0702] "type": "Discretionary",

[0703] "strength": "Medium",

[0704] "impact": "Reflects relatively small personal danger"

[0705] },

[0706] {

[0707] "factor": "The theft amount is 13,000 yuan, which is a relatively large amount rather than a huge amount",

[0708] "type": "Statutory",

[0709] "strength": "Medium",

[0710] "impact": "Sentenced within the range of fixed-term imprisonment of less than three years"

[0711] } ​

[0713] },

[0714] "crime_summary": {

[0715] "four_elements_analysis": {

[0716] "subjective_aspect": "direct intent, with the purpose of illegal possession, motivated by gambling debts",

[0717] "objective_aspect": "The act of breaking and entering a residence and secretly stealing property resulted in a property loss of 13,000 yuan."

[0718] "object": "Primarily infringes on property rights, while also infringing on the right to peaceful enjoyment of one's home."

[0719] "subject": "General subject, the defendant Li meets the subject requirements."

[0720] },

[0721] "crime_nature": "A property crime with aggravating circumstances of burglary",

[0722] "social_harm": "Seriously infringes upon citizens' property safety and residential peace, disrupts social order, and poses a significant threat to society."

[0723] },

[0724] "overall_assessment": {

[0725] Conclusion: "The defendant Li's actions constitute the crime of theft, and the aggravating circumstance of burglary warrants a heavier sentence within the range of imprisonment of up to three years."

[0726] "recommendations": [

[0727] "Prosecuted for theft (burglary)",

[0728] "A sentence of imprisonment between 1 year and 6 months and 2 years and 6 months is recommended."

[0729] "Recommendation and fine"

[0730] ],

[0731] "further_investigation": [

[0732] "Further investigation is needed to determine if there were any other acts of theft."

[0733] "It is necessary to verify whether the defendant has a prior criminal record."

[0734] "It is necessary to confirm whether the stolen goods have been recovered and the situation regarding restitution." ]

[0736] }

[0737] },

[0738] "confidence_scores": {

[0739] "fact_certainty": 0.95,

[0740] "legal_applicability": 0.92,

[0741] "overall_reliability": 0.90

[0742] }

[0743] }".

[0744] Furthermore, after obtaining the case characterization result regarding the target case, one possible implementation method is, as follows: Figure 2 As shown, it can be determined whether the confidence level contained in the case characterization result (such as the case characterization analysis report) is lower than the preset threshold (the specific value is not limited and can be set according to the actual situation and experience, such as 0.85). If so, the problem points in the target legal logic chain are obtained; and the problem points are used to generate element improvement instructions, which are input into the large language model to improve the target seven-way elements, and the improved target seven-way elements are obtained. The calculation of the weight values ​​corresponding to the improved target seven-way elements and subsequent steps (i.e., the above steps S102-S105) are repeated until the confidence level contained in the case characterization result is not lower than the preset threshold, and the final case characterization result (containing interpretable reasoning conclusions) is obtained.

[0745] The confidence level included in the case characterization result (such as the case characterization analysis report) can be the average of its included factual confidence level (fact_certainty), legal applicability, and overall reliability (represented as avg_confidence), calculated using the following formula:

[0746] avg_confidence=avg(fact_certainty+legal_applicability+overall_reliability)

[0747] Here, avg() represents the function to calculate the average.

[0748] Specifically, in this implementation, when the value of avg_confidence is not lower than a preset threshold (e.g., 0.85), the interpretable reasoning decision (case fusion characterization) for the target case ends, and the case characterization result for the target case is obtained. Conversely, when the value of avg_confidence is lower than the preset threshold (e.g., 0.85), the dispute backtracking mechanism is triggered. First, it is necessary to obtain the three nodes and edges with the lowest confidence scores in the target legal logic chain (logic_chain) to form problem points (represented as weak_points, referring to the weakest, most problematic, and most in need of reinforcement areas in the target case), as shown below:

[0749] “weak_points” : {

[0750] “node” : {...},

[0751] “edge” : {...}

[0752] }".

[0753] Then, based on the aforementioned issues, feature improvement instructions can be generated and input into the large language model to utilize LLM to generate the data that needs to be supplemented. An example of a feature improvement instruction can be shown below:

[0754] "You are a senior judge with 20 years of trial experience, and you are now required to examine a low-confidence reasoning link in a legal logic chain. Based on your trial experience, please analyze the deficiencies of this logic chain in terms of the seven Ws (what, why, why), and provide specific supplementary requirements."

[0755] ## Case Reasoning Stage Review

[0756] **[Legal Logic Chain to be Improved]**

[0757] {weak_points}

[0758] ## Requirements for Improving the Seven Elements

[0759] From a judge's perspective, please analyze the shortcomings of each of the following elements in the current logical chain and provide specific supplementary guidance:

[0760] ### 1. When - Supplement to the Time Element

[0761] Please provide the following time information:

[0762] - The **specific date and time** of the incident (year / month / day / hour / minute)

[0763] - Time characteristics of the incident (early morning / daytime / evening / late night)

[0764] - Is it a special date (holiday / anniversary / special period)?

[0765] - Duration (instantaneous / brief / continuous / long-term)

[0766] - Time sequence (first time / again / multiple times / consecutive)

[0767] ### 2. Where - Supplementing Location Element

[0768] Please provide the following location information:

[0769] - The **detailed address where the incident occurred** (province / city / district / street / house number)

[0770] - Location type (residential / commercial / public / special area)

[0771] - Location characteristics (enclosed space / open space / semi-open space)

[0772] - Location environment (pedestrian traffic / surveillance coverage / security status)

[0773] - Location association (crime scene / preparation location / location for disposal of stolen goods)

[0774] ### 3. Who - Supplementing Personnel Element

[0775] Please provide the following personnel information:

[0776] - Relevant personnel **identity information** (name / age / occupation / social relationships)

[0777] - Roles of the individuals involved (defendant / victim / witness / accomplice / accessory)

[0778] - Person's status (whether they are an adult / have a criminal record / have a special status)

[0779] - Interpersonal relationships (acquaintances / family ties / employment relationships / strangers)

[0780] - Number of people (single / two / multiple / group)

[0781] ### 4. What - Supplement to the behavioral elements

[0782] Please provide the following behavioral information:

[0783] - **Specific description of the behavior** (what was done / nature of the behavior / method of the behavior)

[0784] - Behavior type (act / inaction / preparation / implementation / result)

[0785] - Methods of conduct (violence / threats / deception / technical means / others)

[0786] - Target of the action (personal / property / public safety)

[0787] - Result of the action (completed / attempted / interrupted / prepared)

[0788] ### 5. How - Supplementary Plot Elements

[0789] Please provide the following plot information:

[0790] - **Specific process of the behavior** (steps / sequence / methods / tools)

[0791] - Criminal preparation (premeditation / opportunistic crime / spurious act)

[0792] - Details of the crime (method of entry / tools used / specific actions)

[0793] - Post-crime actions (fleeing the scene / destroying evidence / surrendering / compensation)

[0794] - Severity of the incident (minor / moderate / serious / extremely serious)

[0795] ### 6. What (Object) - Supplementing Item Elements

[0796] Please provide the following item information:

[0797] - **Description of the items involved in the case** (name / type / quantity / characteristics)

[0798] - Item value (purchase price / market value / appraised value)

[0799] - Item status (New / Used / Damaged / Destroyed)

[0800] - Whereabouts of the items (seized / recovered / sold as stolen / lost)

[0801] - Relationship between items and the case (tools of the crime / objects of the crime / procedures of the crime)

[0802] ### 7. Why - Supplementing the causal elements

[0803] Please provide the following reason information:

[0804] - **Description of motivation and purpose** (Why do I do this / What result am I pursuing?)

[0805] - Direct cause (debt dispute / emotional entanglement / revenge / financial gain)

[0806] - Indirect causes (financial difficulties / psychological problems / instigation by others)

[0807] - Subjective state (intentional / negligent / knowing / should have known)

[0808] - Special reasons (legitimate self-defense / emergency avoidance / misconception)".

[0809] Furthermore, after inputting the above-mentioned element improvement instructions into the Large Language Model (LLM), the following are examples of the specific deficiencies and supplementary requirements for each element output by the model:

[0810] "Specific deficiencies and supplementary requirements for each element"

[0811] 1. When

[0812] The original link is insufficient: it only provides the date "evening of August 15, 2023". The time period "evening" is too vague to determine the degree of social harm of the behavior (e.g., intrusion when the victim is asleep at night vs. intrusion when the victim may be home alone in the evening).

[0813] Additional requirements:

[0814] Precise time points: Determine the specific time (preferably accurate to the minute) by using the defendant's confession, the victim's statement, surveillance records, communication base station data, etc., to break in, commit the theft, and escape from the scene.

[0815] Time period characteristics: Clearly define whether it is the "first half of the night" (e.g., 8:00 PM - 12:00 AM) or the "second half of the night" (e.g., 12:00 AM - 6:00 AM). The second half of the night usually means that the victim is in a deep resting state, and the potential threat to personal safety from breaking into the residence is greater.

[0816] Duration: Determine the total time the defendant spent from entering to leaving the scene to assess the degree of leisure in their actions and the scope of their search.

[0817] Time correlation: Examine the correlation between the defendant's actions and the victim's daily routine and the activity patterns of the surrounding neighbors to determine whether he intentionally chose a time that was not easily detected.

[0818] 2. Where

[0819] The original link is insufficient: it only describes the residence as "Wang's home." The specific nature of the residence is not clearly defined, which is crucial for determining whether it was a burglary.

[0820] Additional requirements:

[0821] Detailed Address and Attributes: Determine the complete house number. Key points to clarify: Is this residence Wang's regular family living location, a temporary stop, or a vacant property for rent or sale? Evidence (such as property registration, neighbor testimonies, and utility payment records) is required to prove its function as a "family residence."

[0822] Spatial structure: Is it a detached house, an apartment unit, a single room in a shared house, or some other structure? This relates to the assessment of the isolation and privacy of the "household".

[0823] Environment and security: The property security situation of the community or building, the coverage of surveillance cameras (especially entrances and corridors), and the lighting conditions at the time of the crime. These factors help determine the difficulty of the crime, the defendant's counter-investigation awareness, and the objective conditions under which the crime was successfully committed.

[0824] On-site evidence: An investigation was conducted into the specific locations of the "lock picking" (entrance door, balcony door, window), and evidence of damage, tools, and biological samples were collected.

[0825] In this way, after the user supplements the data or uploads file data, the above steps S101-S105 can be re-executed until a case classification result with an avg_confidence value not lower than a preset threshold (e.g., 0.85) is obtained. However, if the avg_confidence is still lower than the preset threshold (e.g., 0.85) after a preset number of consecutive executions (e.g., 5 times), the execution will be terminated to avoid wasting computing resources.

[0826] In summary, the case characterization method provided in this embodiment first obtains the legal documents of the target case to be characterized; then extracts the target seven-way elements related to the target case from the legal documents; next, calculates the weight values ​​corresponding to the target seven-way elements; and uses a preset case attenuation factor to determine the weight matrix corresponding to the target seven-way elements by adjusting the weight values. Then, it filters target similar cases from a case library that match the weight matrix corresponding to the target seven-way elements; and filters target legal provisions from a legal provision library that match the weight matrix corresponding to the target seven-way elements. Furthermore, it uses the target seven-way elements, target similar cases, and target legal provisions to generate prompt instructions, inputs them into a large language model for legal logic chain generation, obtains the target legal logic chain for the target case; and uses the target legal logic chain to generate a case characterization instruction, inputs it into the large language model for case characterization processing, and obtains the case characterization result for the target case.

[0827] As can be seen, when determining the nature of the target case, this application first performs a structured analysis of the legal documents of the target case to obtain the seven "what" elements related to the target case (including when, where, who, what, how, object, and why). Then, based on the weight matrix corresponding to the seven "what" elements, a dual-channel hierarchical search is performed on the case database and the legal provision database to accurately match the target case with the target case. This simultaneously solves the problems of semantic generalization (i.e., compared with existing similar case recommendation methods such as Doc2Vec, this matching method of the synonym combination tree can achieve more accurate semantic matching and expansion) and timeliness filtering (such as filtering out cases older than 5 years and filtering out expired legal provisions). Furthermore, based on this, the target legal logic chain (including the associated evidence chain of "facts -> legal provisions -> similar cases -> conclusions") generated by the large language model based on the target case and the target legal provisions is used to integrate and characterize the target case, thereby obtaining the case characterization result more quickly and accurately.

[0828] In addition, when the confidence level of the obtained case characterization result is lower than the preset threshold (such as 0.85), the problem points in the target legal logic chain can be obtained. Based on the problem points, the problem can be backtracked through the large language model to improve the target seven W's elements. Then, the improved target seven W's elements are used to re-characterize the case, so that the entire case characterization process can meet the requirement of "visualizing the adjudication process" and thus achieve the ideal case characterization effect.

[0829] Furthermore, embodiments of this application also provide a case characterization device, including: a processor, a memory, and a system bus;

[0830] The processor and the memory are connected via the system bus;

[0831] The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the above-described methods for characterizing cases.

[0832] refer to Figure 3 The diagram illustrates a structure suitable for implementing the case characterization device in the embodiments of this application. The case characterization device in the embodiments of this application may include, but is not limited to, terminals equipped with large language models, cloud platforms, servers, and server clusters. Figure 3 The device shown in the case description is merely an example of an electronic device and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0833] like Figure 3 As shown, the case-determining device may include a processor (e.g., a central processing unit, graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. When the case-determining device is powered on, the RAM 303 also stores various programs and data required for device operation. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0834] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, memory cards, hard drives, etc.; and communication devices 309. Communication device 309 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 The case-characterizing device is shown with various means, but it should be understood that it is not required to implement or possess all of the means shown. More or fewer means may be implemented or possessed alternatively.

[0835] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform any of the above-described methods for determining the nature of a case.

[0836] Furthermore, this application also provides a computer program product, which, when run on a terminal device, causes the terminal device to execute any of the above-mentioned methods for determining the nature of a case.

[0837] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0838] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0839] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0840] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method of case triage, characterized by, include: Obtain legal documents for pending target cases; And extract the target seven-question elements related to the target case from the aforementioned legal documents; Calculate the weight values ​​corresponding to the target seven geometric elements; and use a preset case attenuation factor to determine the weight matrix corresponding to the target seven geometric elements by adjusting the weight values ​​corresponding to the target seven geometric elements. Select target cases from the case library that match the weight matrix corresponding to the target geometric elements; Then, target legal provisions that match the weight matrix corresponding to the target geometric elements are selected from the legal provisions library; Using the target seven elements, target similar cases, and target legal provisions, a prompt instruction is generated and input into the large language model for legal logic chain generation to obtain the target legal logic chain for the target case; Using the target legal logic chain, a case characterization instruction is generated, which is then input into a large language model for case characterization processing to obtain the case characterization result for the target case.

2. The method of claim 1, wherein, The extraction of the target seven-question elements related to the target case from the legal documents includes: Using the legal documents of the target case, a seven-question element extraction instruction is generated, which is then input into a large language model for seven-question element extraction processing to obtain the target seven-question elements related to the target case. The seven elements of the objective include when, where, who, what, what situation, what object, and why.

3. The method of claim 1, wherein, The calculation of the weight values ​​corresponding to the target geometric elements includes: Calculate the type importance weight, position weight, and length weight for each element in the target geometric elements; The weighted sum of the type importance weight, position weight, and length weight corresponding to each element is obtained to obtain the comprehensive weight value corresponding to each element in the target geometric elements.

4. The method of claim 3, wherein, The step of determining the weight matrix corresponding to the target geometric elements by adjusting the weight values ​​of the target geometric elements using a preset case attenuation factor includes: The target case type is identified using a large language model; and the product of the preset case attenuation factor corresponding to the target case type and the comprehensive weight value corresponding to each element in the target seven-key elements is calculated as the adjusted comprehensive weight value corresponding to each element in the target seven-key elements. The adjusted comprehensive weight values ​​corresponding to each of the seven target geometric elements are summed to obtain the summed comprehensive weight value corresponding to each element. Calculate the ratio between the adjusted comprehensive weight value for each element and the summed comprehensive weight value, and use this ratio as the final weight value for the corresponding element. For each element, field expansion processing is performed, and the comprehensive weight value, adjusted comprehensive weight value, and final weight value of each element are combined with the expansion results to construct the weight matrix corresponding to the target geometric element.

5. The method of claim 1, wherein, The step of selecting target cases from the case library that match the weight matrix corresponding to the target geometric elements includes: From the weight matrix corresponding to the target seven geometric elements, select the weight matrix corresponding to the case elements; Candidate cases are selected from the case study library based on the top-K cosine similarity of the weight matrix corresponding to the case study elements; where K is a positive integer greater than 0. The candidate cases in the Top-K are sorted from most recent to oldest based on their occurrence time, and candidate cases older than 5 years are filtered out from the sorting results to obtain the filtered target cases.

6. The method of claim 1, wherein, The step of selecting target legal provisions from the legal provisions library that match the weight matrix corresponding to the target geometric elements includes: From the weight matrix corresponding to the seven target elements, select the weight matrix corresponding to the legal provisions elements; The text in the weight matrix corresponding to the legal provisions is segmented to obtain legal provisions keywords; and the legal provisions keywords are expanded based on a pre-built thesaurus of legal related terms to obtain expanded legal provisions keywords. Each legal provision in the legal provision database is segmented into words to obtain candidate legal provision words; and from all candidate legal provision words, the top-N candidate legal provisions with the same similarity to the expanded legal provision keywords are selected; where N is a positive integer greater than 0. Filter out invalid legal provisions from the Top-N candidate legal provisions to obtain the filtered target legal provisions.

7. The method according to any one of claims 1 to 6, characterized in that, After generating a case characterization instruction using the target legal logic chain, inputting it into a large language model for case characterization processing, and obtaining a case characterization result for the target case, the method further includes: When the confidence level of the case characterization result is lower than a preset threshold, the problem points in the target legal logic chain are obtained; and the problem points are used to generate element improvement instructions, which are input into the big language model to improve the target seven-way elements, and the improved target seven-way elements are obtained. Repeat the calculation of the weight values ​​corresponding to the improved target seven geometric elements and subsequent steps until the confidence level of the obtained case characterization result is not lower than the preset threshold.

8. A case characterization device, characterized by, include: Processor, memory, system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method described in any one of claims 1-7.

10. A computer program product, characterised in that, The program product includes a computer program that, when executed by an electronic product, can implement the method described in any one of claims 1-7.