A multi-task case feature extraction method based on consistent thought chain reasoning

By constructing a case feature extraction model based on a consistent thinking chain reasoning method, the problems of complex and time-consuming case feature extraction process and low efficiency of high computing resources in existing technologies are solved, and efficient and accurate case feature extraction results are achieved.

CN117609758BActive Publication Date: 2026-11-20中国司法大数据研究院有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311464958.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-06
Publication Date
2026-11-20
Estimated Expiration
2043-11-06

AI Technical Summary

Technical Problem

Existing case feature extraction methods rely on expert experience and a large amount of manually labeled data, resulting in a complicated and time-consuming process. Furthermore, large language models have high computational resource requirements and low memory efficiency in practical applications.

Method used

This paper adopts a consistent thinking chain reasoning method, uses a large language model to build a case feature extraction model, processes judgment documents in segments to construct a case feature thinking chain, and uses an adaptive voting method to automatically acquire training data to build a multi-task case feature extraction model, thereby achieving efficient and accurate case feature extraction.

Benefits of technology

It achieves efficient and accurate case feature extraction, overcomes the problems of high computing resource requirements and low memory efficiency, and improves the efficiency and accuracy of case feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609758B_ABST
    Figure CN117609758B_ABST
Patent Text Reader

Abstract

The application discloses a kind of multi-task case feature extraction methods based on consistent thinking chain reasoning, its steps include: S1: each judicial document in selected public judicial document set is segmented and handled, and fact determination section set A1 is obtained;S2: case feature explanation set E1 is constructed, and thinking chain set E2 is constructed using large language model;S3: using thinking chain set E2 constructs thinking chain containing prompt instruction, calls large language model, and constructs case feature extraction model M1;S4: based on voting self-adaptive method, using model M1 carries out case feature extraction to set A1, and obtains the case feature prediction label set B of fact determination section and corresponding reasoning process R;S5: based on label set B and reasoning process R constructs training set training generative model, and obtains case feature multi-task extraction model;S6: the fact determination section of the judicial document to be processed is input into case feature multi-task extraction model, and case feature is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the research field of case feature extraction in natural language processing and judicial documents, and relates to a multi-task case feature extraction method based on consistent thinking chain reasoning. Background Technology

[0002] In the judicial field, the deep integration of artificial intelligence technology with the judicial system has become a major strategy for resolving numerous existing judicial practice problems. Relevant plans have proposed providing "judicial assistance applications throughout the entire case handling process, including intelligent recommendation of similar cases, intelligent generation of search reports, intelligent sentencing assistance, intelligent analysis of judgment patterns, accurate application of law, unified judgment standards, intelligent document generation assistance, and intelligent document error correction." Case feature extraction is the key core of these judicial assistance applications, and its accuracy significantly impacts the effectiveness of judges' use of these applications.

[0003] However, current mainstream methods for case feature extraction still rely on rule extraction based on expert experience or text classification methods that require large amounts of manually labeled data. These methods make the case feature extraction process complex and time-consuming. In recent years, Large Language Models (LLMs) have achieved significant success in natural language processing tasks. However, due to their low computational resource requirements and memory efficiency, deploying these models in practical applications is challenging. Summary of the Invention

[0004] To address the technical problems existing in the prior art, the purpose of this invention is to provide a case feature extraction method based on consistent thinking chain reasoning. This invention utilizes a consistent thinking chain reasoning method based on a large language model to overcome the problem of difficulty in obtaining labeled data for supervised learning models. At the same time, it uses a data-based multi-task model compression technique to construct an accurate and efficient small model for case feature extraction, thereby achieving efficient and accurate case feature extraction.

[0005] This method first extracts the paragraph structure of the judgment documents, and then constructs a case feature thought chain based on the judicial interpretations of case characteristics. Based on the constructed case feature thought chain, and using a voting-based adaptive method, a case feature extraction model based on a consistent thought chain of a large language model is built. The construction of the case feature extraction model based on the consistent thought chain of the large language model is used to automatically acquire training data for the case feature extraction model. Based on the automatically acquired training data, a multi-task case feature extraction model based on the consistent thought chain is constructed to achieve accurate and efficient identification of case features.

[0006] Based on the above, the present invention provides a multi-task case feature extraction method based on consistent thought chain reasoning, comprising the following steps: S1: Segment each judgment document in the publicly available judgment document collection to obtain the set of fact-finding segments of the judgment documents A1; S2: Construct a case feature interpretation set E1, and based on the case feature interpretation, use a large language model to construct a case feature extraction thought chain set E2; S3: Using the set of thought chains E2 constructed in S2, the large language model is invoked through prompts containing thought chains to construct a case feature extraction model M1 based on the consistent thought chain of the large language model. S4: An adaptive voting-based method uses the case feature extraction model M1 in S3 to extract case features from the fact-finding section set A1 of the judgment documents, and obtains the case feature prediction label set B of the fact-finding section and the corresponding reasoning process R. S5: Based on the combination of B and R in S4, a training set is obtained, and a multi-task case feature extraction model is constructed. The fact-finding section of the judgment document to be processed is input into the multi-task case feature extraction model to realize the case feature extraction of the judgment document.

[0007] Furthermore, in S1, the publicly available collection of court judgments is segmented using segmentation rules, and the fact-finding segment dataset A1 is extracted from it: in Indicates the first The section for fact-finding in each document, where N is the total number of judgments in the collection. The segmentation rules are as follows: Furthermore, step S2 includes the following specific steps: S21: Constructing the judicial interpretation set of case feature set C1 ,in For the i-th case, Let the judicial interpretation of the characteristics of the i-th case be denoted as follows: , represents the case feature set; M is the total number of case features in the case feature set.

[0008] It should be noted that judicial interpretations of case characteristics can be constructed by legal experts or automatically using large language models.

[0009] S22: Based on the case feature interpretation set E1, construct a thought chain generation prompt template to generate each case feature. Case Feature Extraction Thinking Chain , To determine whether a set of characteristics of this case are present. subproblems )composition, For the chain of thought The number of neutron problems is used to fuse and associate the generated case feature extraction thought chains with E1, resulting in a case feature extraction thought chain set E2. ; The mind chain generation prompt template includes a case feature name slot, a judicial interpretation slot, and auxiliary corpus for case feature extraction.

[0010] Optionally, the construction of the case feature thinking chain can also be carried out by legal professionals, forming a case feature extraction thinking chain set E2= .

[0011] Furthermore, the construction of the case feature extraction model M1 based on the consistent thinking chain of the large language model in S3 includes the following specific steps: S31: Extract the thought chain set E2 using the case features obtained in S2. Construct a set of prompt instruction combinations, where each instruction template is formed by a thought chain. The sub-problem slots consist of a total of There are 1 instruction, and the (j+1)th instruction template contains not only the (j+1)th sub-problem, but also the jth sub-problem slot and the corresponding answer slot; S32: Subproblem based on the set of prompt instructions in S31 The corresponding question and answer will be added to the next sub-question. The prompts are used to sequentially invoke the large language model to resolve thought chains. The sub-problems within the case ultimately lead to the reasoning process that yields the case characteristics. Based on this reasoning process, the case characteristics can be predicted. This process is called Case Feature Extraction Model M1 based on Consistent Thinking Chain of Large Language Model.

[0012] That is, firstly, for the i-th thought chain in the thought chain set E2, extract the case features into the thought chain. The j-th subproblem The corresponding questions and answers are added to the case feature extraction mindset. The (j+1)th subproblem From the prompts, the prompt instruction combination corresponding to the i-th thought chain is obtained; then, the prompts in the prompt instruction combination corresponding to the i-th thought chain are used to sequentially call the large language model to solve the case feature extraction thought chain. The sub-problems within the case ultimately yield the case characteristics. The reasoning process is then used as the case feature extraction model M1.

[0013] Furthermore, step S4 includes the following specific steps: S41: Using the case feature extraction model M1 based on the consistent thought chain of the large language model in S3, reasoning is performed by calling M1 k times to obtain the case feature label prediction set B1, B2, ..., B for each fact-finding segment in step S1. k and the corresponding reasoning processes R1, R2, ..., R k , where k is an odd number; Optionally, when making reasoning chains to determine facts, multiple large language models can be used to make an odd number of inferences.

[0014] S42: Case feature label prediction set B1, B2, ..., B based on S41 k and the corresponding reasoning processes R1, R2, ..., R k Based on the big language consistency voting prompt template, by calling the big language model, the reasoning process and label group with the highest reasoning score are output as the optimal case feature prediction label set B and corresponding reasoning process set R for each fact-finding segment; The template for the large language consistency voting is: "As a legal expert, based on the following text content, regarding the label {feature}, determine which of the following {k} reasoning processes scores the highest and output it;\n Text content: {content}\n List of reasoning processes: {r1;...;rk}" where {feature} represents the corresponding case feature name, {k} represents the number of reasoning attempts, {content} represents the content of the fact-finding section, and {r1;...;rk} represents the content of the k groups of reasoning processes.

[0015] Alternatively, when voting on the predicted labels for case features, simple rules can be used for voting instead of using a large model for consensus decision-making.

[0016] Furthermore, step S5 includes the following specific steps: S51: Construct a multi-task model for case feature recognition. The task-specific model needs to complete two tasks: first, a label prediction task, which predicts whether the input fact-finding segment contains a specified case feature label; second, a step-by-step reasoning task, which generates a corresponding case feature reasoning process based on the input fact-finding segment. S52: Design a prompt instruction template for label prediction tasks and a two-step prompt instruction template for step-by-step reasoning tasks; The prompt template for the label prediction task is: "[Label Prediction] Does the following text contain the behavior {feature}?\nOptions: A. Yes\nB. No\n[Text]: {content}" {feature} represents the case feature label, and {content} represents the text in the fact-finding section set. The purpose of this instruction is to let the model determine whether the text contains the case feature. The two-step prompt instruction templates for step-by-step reasoning tasks are as follows: 1. Input section: "

Step-by-step reasoning

Text

[0017] S53: For Task 1, based on the fact-finding segment set A1 and the case feature prediction label set B in S3, and based on the prompt instruction template for the label prediction task in S52, combine the training dataset. Case feature tags and text Substitute the prompt instruction template to generate input. ,text From set A1, by and Substitute the prompt instruction template into the model to judge the text. Does it contain case feature tags? Extract the results from the label set B corresponding to the case features and generate the output. , The value can be either "A. Yes" or "B. No"; S54: For Task 2, based on the reasoning process set R corresponding to the fact-finding segment set A1 and the case feature label set in S3, and based on the two-step prompt instruction template of the step-by-step reasoning task, combine the training dataset. The characteristics of the case The corresponding chain of thought problem and text Substitute the input section of the prompt template to generate input. , to the characteristics of the case Corresponding thought chain problem group Substitute the corresponding answers from the reasoning process into the output section of the prompt template to generate the output. ; S55: Train a multi-task recognition model for case features, and fuse data from AB and AR to obtain sample set T. The total number of samples T is 2MN. The samples T are divided in an 8:2 ratio to generate... training set TR and A test set TE is used, and the training set TR is input into a small generative model for multi-task training. During training, the task labels added to the corresponding input in the training set—[label prediction] and [step-by-step inference]—are used to distinguish between label prediction task samples and inference process task samples, thereby generating the label prediction loss. and the loss generated during the reasoning process By minimizing the weighted loss Simultaneously, accurate labels and inference processes are generated, where w represents the weight of the loss function for the inference process. By adjusting w, the prediction performance of the labels is optimized.

[0018] S56: Based on the case feature multi-task recognition model built in S55, it achieves efficient and accurate case feature extraction.

[0019] The advantages of this invention are as follows: This invention provides a multi-task case feature extraction method based on consistent thought chain reasoning. It utilizes a consistent thought chain reasoning method based on a large language model to overcome the problem of difficulty in obtaining labeled data for supervised learning models. Furthermore, it employs a data-based multi-task model compression technique to construct an accurate and efficient small model for case feature extraction, overcoming the problems of high computational resource requirements and low memory efficiency of large language models, thereby achieving efficient and accurate case feature extraction. Attached Figure Description

[0020] Figure 1 This is a flowchart illustrating the specific implementation process. Detailed Implementation

[0021] To further illustrate the technical solutions of the present invention, the present invention will be described in further detail below with reference to the accompanying drawings. The described embodiments are only some embodiments of this application, and not all embodiments.

[0022] The specific implementation flowchart of this invention is attached. Figure 1 As shown below; the specific implementation method for "feature extraction method for traffic accident crime cases" and appendix are illustrated below. Figure 1This paper details a multi-task case feature extraction method based on consistent thought chain reasoning: S1: Each document in the collection of traffic accident crime documents is segmented using segmentation rules, as follows: Set A1 of Factual Determination Sections for Obtaining Traffic Accident Crime Documents in Indicates the first The factual findings section corresponding to the document, in which ; S2: Construct a set of case feature interpretations and use a large language model to build a case feature extraction thought process, which includes the following steps: (1) Select 20 case characteristics related to the crime of causing a traffic accident, and construct judicial interpretations of them through legal experts to form a set of judicial interpretations of case characteristics. ,in For the i-th case, The judicial interpretation of the characteristics of the i-th case; (2) Based on the case feature interpretation E1, construct a thought chain generation prompt template to generate each case feature. Case feature extraction thinking chain , A set of sub-problems to determine whether the characteristics of this case are present. )composition, For the chain of thought The number of neutron problems is used to fuse and correlate the generated case feature thought chains with E1, resulting in a case feature extraction thought chain set E2. ; The thought chain generation prompt template includes a case feature name slot, a judicial interpretation slot, and auxiliary corpus for case feature extraction. Taking "the defendant is a family member or close relative of the victim" as an example, its thought chain contains five sub-questions: Extract the victim and defendant from the following text: \n{content}; What is the relationship between the defendant and the victim? Are the victim and the defendant relatives? Do the victim and the defendant live together? Based on the above information, determine whether the victim and the defendant are relatives or live together? (The output can only be one of 'yes', 'no', or 'cannot be determined'). Here, {content} represents the content of the fact-finding section.

[0023] S3: Using the thought chain set E2 constructed in S2, and through prompts containing thought chains, the large language model is invoked to construct a case feature extraction model M1 based on the consistent thought chain of the large language model. This specifically includes the following steps: (1) Extract the thought chain set E2 using the case features obtained in S2. Construct a set of prompt instruction combinations, where each instruction template is formed by a thought chain. The sub-problem slots consist of a total of There are 1 instruction, and the (j+1)th instruction template contains not only the (j+1)th sub-problem, but also the jth sub-problem slot and the corresponding answer slot; (2) Based on the set of prompt instructions in (1), sub-problems The corresponding question and answer will be added to the next sub-question. The prompts are used to sequentially invoke the large language model to resolve thought chains. The sub-problems within the case ultimately lead to the reasoning process that yields the case characteristics. Based on this reasoning process, the case characteristics can be predicted. This process is called Case Feature Extraction Model M1 based on Consistent Thinking Chain of Large Language Model; S4: An adaptive voting-based method utilizes the case feature extraction model M1 from S3 to extract case features from the fact-finding section set A1 of the judgment documents, obtaining the case feature prediction label set B for the fact-finding sections and the corresponding reasoning process R. Specifically, it includes the following steps: (1) Using the case feature extraction model M1 based on the consistent thinking chain of the large language model in S3, the case feature label prediction set B1, B2, ..., B5 and the corresponding reasoning process R1, R2, ..., R5 of each fact determination segment in step S1 are obtained by calling M1 five times for reasoning. (2) Based on the case feature label prediction set B1, B2, ..., B5 and the corresponding reasoning process R1, R2, ..., R5 obtained in (1), based on the large language consistency voting prompt template, by calling the large language model, the reasoning process and label group with the highest reasoning score are output as the optimal case feature prediction label set B and the corresponding reasoning process set R for each fact determination segment. The template for the large language consistency voting is as follows: "As a legal expert, based on the following text content, regarding the tag {feature}, determine which of the following five reasoning processes scores the highest and output it.\n Text content: {content}\n List of reasoning processes: {r1;r2;r3;r4;r5}" where {feature} represents the corresponding case feature name, {content} represents the fact-finding section, and {r1;r2;r3;r4;r5} represents the content of the five reasoning processes.

[0024] S5: Based on the B and R combination training set in S4, a multi-task case feature extraction model is constructed. The fact-finding section of the judgment document to be processed is input into the multi-task case feature extraction model to achieve the case feature extraction of the judgment document. Specifically, it includes the following steps: (1) Construct a multi-task model for case feature recognition. The task-specific model needs to complete two tasks: one is the label prediction task, which predicts whether the input fact-finding segment contains the specified case feature label; the other is the step-by-step reasoning task, which generates the corresponding case feature reasoning process based on the input fact-finding segment. (2) Design a prompt instruction template for label prediction tasks and a two-step prompt instruction template for step-by-step reasoning tasks; The prompt template for the tag prediction task is: "[Tag Prediction] Does the following text contain the behavior {feature}?\nOptions: A. Yes\nB. No\n[Text]: {content}" {feature} represents the case feature tag, and {content} represents the text in the fact-finding section set; The two-step prompt instruction templates for step-by-step reasoning tasks are as follows: 1. Input section: "

Step-by-step reasoning

Text

[0025] (6) Based on the case feature multi-task recognition model built in S55, efficient and accurate case feature extraction is achieved.

[0026] Although specific embodiments of the invention have been disclosed for illustrative purposes to aid in understanding and implementing the invention, those skilled in the art will understand that various substitutions, variations, and modifications are possible without departing from the spirit and scope of the invention and the appended claims. Therefore, the invention should not be limited to the content disclosed in the preferred embodiments, and the scope of protection claimed by the invention is defined by the claims.

Claims

1. A multi-task case feature extraction method based on consistent thought chain reasoning, comprising the following steps: S1: Segment each judgment document in the selected set of publicly available judgment documents, and form a set of fact-finding segments A1 from the fact-finding segments of each judgment document; S2: Construct a case feature interpretation set E1, and based on the case feature interpretation, use a large language model to construct a thought chain set E2 for case feature extraction; S3: Construct prompt instructions containing the thought chain using the thought chain set E2, call the large language model, and construct a case feature extraction model M1 based on the consistent thought chain of the large language model; S4: An adaptive method based on voting is used to extract case features from the fact-finding segment set A1 using the case feature extraction model M1, so as to obtain the case feature prediction label set B and the corresponding reasoning process R for the fact-finding segment. S5: Construct a training set based on the case feature prediction label set B and the corresponding reasoning process R, and train a generative model using the training set to obtain a case feature multi-task extraction model; wherein, the method for obtaining the case feature multi-task extraction model is as follows: S51: Set up the multi-task model for case feature recognition: 1) Label prediction task: predict whether the input fact-finding segment contains the specified case feature label; 2) Step-by-step reasoning task: generate the corresponding case feature reasoning process based on the input fact-finding segment. S52: Design prompt instruction templates for label prediction tasks and two-step prompt instruction templates for step-by-step reasoning tasks; S53: For the label prediction task, generate a training dataset based on the fact-finding segment set A1, the case feature prediction label set B, and the prompt instruction template based on the label prediction task. Among them, the characteristics of the case and the j-th text in the fact-finding segment set A1 Substitute prompt instruction template to generate Extract case features from case feature prediction label set B. Corresponding tag generation ; S54: For step-by-step reasoning tasks, based on the fact-ascertaining segment set A1 and the reasoning process set R, and based on the aforementioned two-step prompt instruction template, combine the training dataset. Among them, the characteristics of the case The corresponding chain of thought neutron problem and text Substitute the input portion of the two-step prompt instruction template to generate , to the characteristics of the case Corresponding thought chain problem group The corresponding answers during the reasoning process are substituted into the output of the two-step prompt instruction template to generate... ; S55: The training datasets AB and AR are fused to obtain a sample set T. The sample set T is then divided into a training set and a test set. A generative model is trained using the training set, and the trained and tested generative model is used as the multi-task recognition model for the case features. During training, the weighted loss is minimized. Optimize generative models; This represents the label prediction loss; This indicates the loss generated during the reasoning process; S6: Input the factual findings section of the judgment document to be processed into the case feature multi-task extraction model to obtain the case features of the judgment document to be processed.

2. The method according to claim 1, characterized in that, The method for constructing the thought chain set E2 is as follows: S21: Construct the case feature interpretation set based on the case feature set C1. ;in, For the i-th case feature in the case feature set C1, Let M be the judicial interpretation of the i-th case feature, and M be the total number of case features in the case feature set C1; S22: Based on the case feature interpretation set E1, construct a thought chain generation prompt template to generate each case feature. Case feature extraction thinking chain , To determine whether a set of characteristics of a case are present. subproblems )composition, For the chain of thought Number of neutron problems; The generated case feature extraction thought chains are fused and correlated with the case feature interpretation set E1 to obtain a thought chain set E2 for case feature extraction. .

3. The method according to claim 2, characterized in that, The thought chain generation prompt template includes a case feature name slot, a judicial interpretation slot, and auxiliary corpus for case feature extraction.

4. The method according to claim 1, 2, or 3, characterized in that, The method for constructing the case feature extraction model M1 is as follows: First, for the i-th thought chain in the thought chain set E2, extract the case features from the thought chain. The j-th subproblem The corresponding questions and answers are added to the case feature extraction mindset. The (j+1)th subproblem From the prompts, the prompt instruction combination corresponding to the i-th thought chain is obtained; then, the prompts in the prompt instruction combination corresponding to the i-th thought chain are used to sequentially call the large language model to solve the case feature extraction thought chain. The sub-problems within the case ultimately yield the case characteristics. The reasoning process is then used as the case feature extraction model M1.

5. The method according to claim 1, 2, or 3, characterized in that, The method for obtaining the case feature prediction label set B and the corresponding reasoning process R is as follows: S41) Using the case feature extraction model M1, perform k reasoning operations on each fact-finding segment, and each reasoning operation yields a case feature prediction label and reasoning process for the corresponding fact-finding segment, where k is an odd number; S42) Based on the k reasoning operations for each fact-finding segment, obtain the case feature prediction labels B1, B2, ..., B k and the corresponding reasoning processes R1, R2, ..., R k Based on the large language consistency voting prompt template, the large language model is invoked to output the optimal case feature prediction label set B and the corresponding reasoning process set R for the corresponding fact-finding segment.

6. The method according to claim 5, characterized in that, The large language consistency voting prompt template is: "As a legal expert, based on the following text content, regarding the tag {feature}, judge which of the following {k} groups of reasoning processes scores the highest and output it;\n Text content: {content}\n List of reasoning processes: {r1;...;rk}"; where {feature} represents the case feature name, {k} represents the number of reasoning attempts, {content} represents the content of the fact-finding section, and {r1;...;rk} represents the content of k groups of reasoning processes.

7. The method according to claim 1, characterized in that, The prompt instruction template for the tag prediction task is "[Tag Prediction] Does the following text contain the behavior {feature}?\nOptions: A. Yes\nB. No\n[Text]: {content}"; where {feature} represents the case feature tag, and {content} represents the text in the fact-finding section set; the two-step prompt instruction template for the step-by-step reasoning task includes an input part and an output part, the input part being "[Step-by-Step Reasoning] Based on the following text, answer the following questions step by step:\n{Question 1:\n{question_1}\n, Question 2:\n{question_2}\n, ..., Question q: {que stion_q}}\n【Text】:{content}”, where {question_i} represents the i-th sub-question in the thought chain corresponding to the case features, and {content} represents the text in the fact-finding segment set; the output part is "Question 1:\n{question_1}\nAnswer 1:{answer_1}\nQuestion 2:{question_2}\nAnswer 2:{answer_2}, ..., Question q:\n{question_q}\nAnswer q:{answer_q}", where {answer_i} represents the answer corresponding to {question_i} in the reasoning process.

8. A server, characterized in that, The method includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing each step of the method of any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Mobile application platform and method specific to enterprise industrial chain analysis

    CN107342976A

  • Loopback detection method based on deep learning model

    CN114972953A