Historical case retrieval method for interactive legal questions and answers
By introducing text intention identification and crime prediction models into the legal search model and using big model filtering and screening, the problem of unnecessary search and poor retrieval in interactive legal Q&A is solved, and the accuracy and reliability of historical case search is improved .
Patent Information
- Application Number
- CN202411280929.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-11-29
AI Technical Summary
The existing legal search model lacks the intention of the text content in interactive legal Q&A, resulting in the increase of unnecessary search processes and poor search results, especially in the absence of key information in short texts, which cannot effectively retrieve matches. Historical cases.
By introducing text intention identification models, determine whether historical case search is needed, and combine similarity calculations and crime prediction models, use large models for filtering and screening to ensure the accuracy and reliability of the search results.
It reduces unnecessary search processes, improves the accuracy and reliability of historical case search of interactive legal questions and answers, and makes up for the limitations of incomplete coverage of crime prediction models and the unsupervised method of similarity calculation.
Smart Images

Figure CN119046439A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of network retrieval models, and in particular to a historical case retrieval method for interactive legal question and answer. Background Art
[0002] Early historical case searches were mostly done manually, which was time-consuming and labor-intensive, resulting in slow progress of cases. With the widespread application of natural language processing technology in the legal field, the emergence of sequence-to-sequence frameworks has made a qualitative leap in time consumption compared to traditional manual methods. With the emergence of retrieval models, retrieval effects have been further improved.
[0003] As an important part of the information retrieval field, the development history of retrieval models and the research on related technologies have always received widespread attention from the academic community. With the rise of deep learning technology, retrieval models based on neural networks have gradually become a research hotspot. These models can automatically learn the semantic representation of documents and queries, and perform complex nonlinear transformations through deep neural networks, thereby more accurately capturing the relationship between user intent and document content.
[0004] For example, retrieval models based on convolutional neural networks (CNN) and recurrent neural networks (RNN) can process local and global features of text sequences and improve retrieval effects. In addition, with the diversification and personalization of user needs, retrieval models are gradually developing in the direction of personalization. Personalized retrieval models can provide users with more accurate retrieval results based on their historical behaviors, preferences, and contextual information.
[0005] These models usually combine user profiling, recommendation algorithms and other technologies to achieve effective filtering and recommendation of personalized information; despite this, retrieval tasks in specialized fields remain one of the main challenges facing retrieval models; for example, historical case retrieval in interactive legal Q&A refers to the process of analyzing the content of legal Q&A and ultimately searching for historical cases similar to the current legal Q&A content during the legal Q&A process; research has found that by using artificial intelligence models to automatically analyze Q&A content and match similar historical cases, it can effectively assist judges in their grasp of the intensity of the trial during the trial; it can reduce the workload of legal workers in searching for historical cases; and it can increase legal education for the public.
[0006] The application of retrieval models in historical case searches is gradually showing its unique advantages and value. Through deep learning and natural language processing technology, retrieval models can analyze massive cases, extract key information, and form a rich legal knowledge system. At the same time, retrieval models can not only identify key elements in cases, but also deeply analyze the text content of cases and extract deep semantic information. This intelligent retrieval method not only improves the accuracy and efficiency of historical case retrieval, but also reduces errors and biases caused by human factors. In addition, retrieval models also have the ability to self-learn and optimize. With the continuous emergence of new cases, retrieval models can continuously update their model capabilities to adapt to changes and developments in the legal field. This enables retrieval to maintain a high degree of adaptability and flexibility in historical case searches, providing more comprehensive and in-depth support for legal practice.
[0007] In the prior art, the practical applications of retrieval models in legal case retrieval mostly include the following categories:
[0008] ① The invention patent with patent publication number: CN202310961074 is a representative one, which discloses a litigation case retrieval report generation system, including: case information extraction, case retrieval, legal information extraction, legal retrieval, information analysis, information screening and report generation. By extracting and comparing case information in blocks, the cases with the highest similarity are screened out;
[0009] ② The invention with patent publication number CN202311429817 discloses a people's mediation case retrieval system based on a big model and its retrieval method. By introducing big model technology, constructing specific prompt words, and combining semantic-based knowledge base vector retrieval and keyword-based retrieval technology for the field of people's mediation case retrieval, the problem of poor retrieval effect of a single method is avoided.
[0010] Although the above invention proposes a case retrieval method based on a large model, the interactive legal question-and-answer content has the following two problems:
[0011] ① The non-necessity of historical cases in question-and-answer content, that is, not all question-and-answer content requires case retrieval. The retrieval models of the above two technologies lack the judgment of the intention of the text content;
[0012] ② The content of interactive legal Q&A is short text, which may not contain key information such as laws and crimes. The existing legal retrieval model cannot effectively retrieve matching historical cases based on short text. That is, the Q&A content may lack key information, resulting in insufficient input features. As a result, the existing legal retrieval model is not effective in retrieving historical cases and cannot meet the requirements of actual scenario applications, resulting in poor retrieval results. Summary of the invention
[0013] In order to solve the above technical problems, the present invention provides a historical case retrieval method for interactive legal question and answer. By introducing intent recognition into the interactive legal question and answer content for intent discrimination, unnecessary retrieval processes are greatly reduced, and the accuracy of subsequent retrieval tasks presented to users is improved. At the same time, a historical case retrieval method for similarity calculation and crime prediction is integrated, and a large model is used for filtering and screening to obtain the final result, which makes up for the problem of incomplete coverage of crime categories in the crime prediction model, ensures the reliability and accuracy of historical case retrieval in the absence of key information in short texts, and is suitable for promotion.
[0014] A historical case retrieval method for interactive legal question answering, comprising:
[0015] Step 1: Text intent recognition;
[0016] Based on the legal question and answer text, the text intent recognition model is used to identify whether historical case retrieval is needed;
[0017] As an example, the legal question and answer text T is preprocessed to obtain the processed text T c =f preprocess (T), where: f preprocess It is a data preprocessing function; it converts the processed text into a numerical vector F=f extraction (T c ), which facilitates the text intent recognition model to understand the legal question and answer text, where: f extraction is a function for converting numeric vectors.
[0018] As an example, let the numerical vector F = f extraction (T c ) Input the text intent recognition model f model , to determine whether its intention requires historical case retrieval, the process can be described as: R I =f model (F), where: R I Indicates whether historical case retrieval results are required.
[0019] As an example, the historical cases are provided in a case library.
[0020] Step 2: Historical case retrieval is required;
[0021] Using text similarity function f sim Calculate the similarity between the legal question and answer text and the historical cases, and output the top N historical cases with the highest text similarity;
[0022] As an example, if the intention recognition result is: historical case retrieval is required, the legal question and answer text T = {t1, t2..., t n} and Case Library KB case ={C1,C2...,C m} Calculate the text similarity function and output the top N historical cases R with the highest text similarity s =f sim (T,KB case ,N);
[0023] Where: C m represents the mth case in the case library, t n Indicates the nth character in the legal question and answer text.
[0024] Step 3: Use the crime prediction model to predict the crime of the legal question and answer article, and use the crime to search for historical cases in the case library, and output the top N historical cases with the highest text similarity;
[0025] As an example, if the intention recognition result needs to be retrieved from historical cases, the legal question and answer T = {t1, t2..., t n} Input crime prediction model f crime , predict the crime R c =f crime (T).
[0026] As an example, we use the crime name to search the case database and output the top N historical cases with the highest text similarity. The process can be described as
[0027] R r =f retrieval (T,KB case ,N), where: f retrieval Represented as a retrieval function;
[0028] Step 4: Based on the top N historical cases with the highest text similarity, construct prompt words, and use the large model as a discriminator to filter the most appropriate historical cases.
[0029] As an example, R s =f sim (T,KB case ,N),R r =f retrieval (T,KB case ,N), combined to get R = f connect (R s ,R r), construct the prompt word P, use the large model as the discriminator ψ, set the threshold δ to filter out the most appropriate historical cases, and the process can be described as R′←ψ(T,P,R,δ).
[0030] Beneficial effects of the present invention:
[0031] ① Reduce unnecessary retrieval processes during the question-answering process;
[0032] During the interactive Q&A process, not all Q&A content requires historical case retrieval. This is based on research on similar products and the usage habits of professionals, that is, historical case retrieval is necessary only in the legal consulting Q&A process. By introducing intent recognition into the interactive legal Q&A content for intent identification, unnecessary retrieval processes can be greatly reduced and the accuracy of subsequent retrieval tasks presented to users can be improved.
[0033] ② Improve the accuracy of historical case retrieval in short text content of legal questions and answers;
[0034] The historical case retrieval method integrates similarity calculation and crime prediction, and uses a large model to filter and screen to obtain the final result, which makes up for the problem of incomplete coverage of crime categories in the crime prediction model, and at the same time makes up for the limitations of the unsupervised method such as similarity calculation. Through this integrated method, the reliability and accuracy of historical case retrieval can be ensured when short text lacks key information. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Schematic diagram of the overall structure of a historical case retrieval method for interactive legal question and answering according to the present invention.
[0036] Figure 2 A schematic diagram of historical case retrieval of a historical case retrieval method for interactive legal question and answering according to the present invention.
[0037] Figure 3 This is a case analysis chart of a historical case retrieval method for interactive legal question and answering according to the present invention. DETAILED DESCRIPTION
[0038] Below, reference Figures 1 to 3 As shown, a historical case retrieval method for interactive legal question answering includes:
[0039] Step 1: Text intent recognition;
[0040] Based on the legal question and answer text, the text intent recognition model is used to identify whether historical case retrieval is needed;
[0041] As an example, the legal question and answer text T is preprocessed to obtain the processed text T c=f preprocess (T), where: f preprocess It is a data preprocessing function; it converts the processed text into a numerical vector F=f extraction (T c ), which facilitates the text intent recognition model to understand the legal question and answer text, where: f extraction is a function for converting numeric vectors.
[0042] As an example, let the numerical vector F = f extraction (T c ) Input the text intent recognition model f model , to determine whether its intention requires historical case retrieval, the process can be described as: R I =f model (F), where: R I Indicates whether historical case retrieval results are required.
[0043] As an example, the historical cases are provided in a case library.
[0044] Step 2: Historical case retrieval is required;
[0045] Using text similarity function f sim Calculate the similarity between the legal question and answer text and the historical cases, and output the top N historical cases with the highest text similarity;
[0046] As an example, if the intention recognition result is: historical case retrieval is required, the legal question and answer text T = {t1, t2..., t n} and Case Library KB case ={C1,C2...,C m} Perform the text similarity function calculation and output the top N historical cases with the highest text similarity: R s =f sim (T,KB case ,N);
[0047] Where: C m represents the mth case in the case library, t n Indicates the nth character in the legal question and answer text.
[0048] Step 3: Use the crime prediction model to predict the crime of the legal question and answer article, and use the crime to search for historical cases in the case library, and output the top N historical cases with the highest text similarity;
[0049] As an example, if the intention recognition result needs to be retrieved from historical cases, the legal question and answer T = {t1, t2..., tn} Input crime prediction model f crime , predict the crime R c =f crime (T).
[0050] As an example, we use the crime name to search the case database and output the top N historical cases with the highest text similarity. The process can be described as
[0051] R r =f retrieval (T,KB case ,N), where: f retrieval Represented as a retrieval function;
[0052] Step 4: Based on the top N historical cases with the highest text similarity, construct prompt words, and use the large model as a discriminator to filter the most appropriate historical cases.
[0053] As an example, R s =f sim (T,KB case ,N),R r =f retrieval (T,KB case ,N), combined to get R = f connect (R s ,R r ), construct the prompt word P, use the large model as the discriminator ψ, set the threshold δ to filter out the most appropriate historical cases, and the process can be described as R′←ψ(T,P,R,δ).
[0054] In order to better illustrate the design principle of this party, a specific embodiment is now introduced as follows:
[0055] Embodiment 1:
[0056] Step 1: Use the intent recognition model to identify the intent of the legal question and answer content, obtain the recognition results and determine whether historical case retrieval is needed.
[0057] Step 2: If necessary, calculate the similarity between the obtained question and answer content and the case library, and output the top N historical cases with similarity.
[0058] Step three is also based on step two. It predicts the crime of the input question and answer content, matches the predicted crime with the case library, and outputs the top N historical cases.
[0059] Step 4: Based on Step 2 and Step 3, integrate the search results, construct prompt words, and use the big model to filter and select the most similar historical cases. The following algorithm chart is the process of the historical case retrieval method of the entire interactive legal question-and-answer method.
[0060] The present invention provides a method for identifying text intent, including: identifying the intent of whether the acquired legal question and answer text should retrieve historical cases. According to the second aspect, the present invention provides a method for historical case retrieval based on text similarity, including: calculating the similarity between the legal question and answer text that needs to be retrieved for historical cases and the case library, and outputting the top N historical cases. According to the third aspect, the present invention provides a method for historical case retrieval based on crime prediction, including: predicting the most similar crime for the legal question and answer text that needs to be retrieved for historical cases; searching the case library using the predicted crime, and outputting the top N historical cases. According to the fourth aspect, the present invention provides a method for historical case retrieval combined with a large model discriminator, including: for the legal question and answer text that needs to be retrieved for historical cases, obtaining the retrieval results obtained by the above two models; obtaining a preset prompt word, inputting the retrieval results obtained by the above two aspects, the prompt word, and the legal question and answer content into the large model for consistency judgment, and outputting the final result. Because it combines intent recognition, historical case retrieval methods based on similarity and crime prediction and uses large models for filtering and screening, it can fully compensate for the non-necessity of irrelevant content retrieval, lack of key information and the limitations of the above two methods, thereby improving the accuracy of historical case retrieval for interactive legal question and answering.
[0061] As an example, Figure 3 The retrieval effects of different question and answer contents were compared in this paper. The experimental results show that different question and answer contents can effectively identify the intention and determine whether to conduct case retrieval. And according to the different question and answer contents, similarity retrieval and crime prediction retrieval have their own advantages and disadvantages. By using a large model for filtering and screening, the advantages and disadvantages of the two methods can be effectively complemented to obtain more accurate results.
[0062] The above are only preferred embodiments of the present invention. It should be understood that the description of the above embodiments is only used to help understand the method and core ideas of the present invention, and is not used to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, etc. made within the ideas and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A historical case retrieval method for interactive legal question-answering, characterized in that: include: Step 1: Text intent recognition; Based on the legal question and answer text, the text intent recognition model is used to identify whether historical case retrieval is needed; Step 2: Historical case retrieval is required; Using a text similarity function to calculate the similarity between the legal question and answer text and the historical cases, and outputting the top N historical cases with the highest text similarity; Step 3: Use the crime prediction model to predict the crime of the legal question and answer article, and use the crime to search for historical cases in the case library, and output the top N historical cases with the highest text similarity; Step 4: Based on the top N historical cases with the highest text similarity, construct prompt words, and use the large model as a discriminator to filter the most appropriate historical cases.
2. The historical case retrieval method for interactive legal question-answering according to claim 1, characterized in that: Perform data preprocessing on the legal question and answer text T to obtain the processed text T c =f preprocess (T) Where: f preprocess It is a data preprocessing function; it converts the processed text into a numerical vector F=f extraction (T c ), which facilitates the text intent recognition model to understand the legal question and answer text, where: extraction is a function for converting numeric vectors.
3. The historical case retrieval method for interactive legal question-answering according to claim 2 is characterized in that: The numerical vector F=f extraction (T c ) Input the text intention recognition model to determine whether its intention requires historical case retrieval. The process can be described as: I =f model (F), where: R I Indicates whether historical case retrieval results are required.
4. The method for historical case retrieval of interactive legal question and answer according to claim 1, characterized in that: The historical cases are arranged in a case library.
5. The historical case retrieval method for interactive legal question-answering according to claim 1 is characterized in that: If the intention recognition result is: historical case retrieval is required, then the legal question and answer text T = {t1, t2..., t n } and Case Library KB case ={C1,C2...,C m } Perform the text similarity function calculation and output the top N historical cases with the highest text similarity: R s =f sim (T,KB case ,N); Where: C m represents the mth case in the case library, t n Indicates the nth character in the legal question and answer text.
6. The historical case retrieval method for interactive legal question-answering according to claim 1, characterized in that: If the intention recognition result needs to be retrieved from historical cases, the legal question and answer text T = {t1, t2..., t n } Input crime prediction model f crime , predict the crime R c =f crime (T).
7. The historical case retrieval method for interactive legal question-answering according to claim 1 is characterized in that: Use the crime to search the case database and output the top N historical cases with the highest text similarity. The process can be described as R r =f retrieval (T,KB case ,N).
8. The historical case retrieval method for interactive legal question-answering according to claim 1, characterized in that: R s =f sim (T,KB case ,N),R r =f retrieval (T,KB case ,N), combined to get R = f connect (R s ,R r ), construct the prompt word P, use the large model as the discriminator ψ, set the threshold δ to filter out the most appropriate historical cases, and the process can be described as R′←ψ(T,P,R,δ).
Citation Information
Patent Citations
Litigation case retrieval report generation system
CN117033616A
Large model-based people mediation case retrieval system and retrieval method thereof
CN117493382A
Cited By
Case recommendation method and device, electronic equipment, storage medium and program product
CN120429428A
