Case retrieval method, device, computer equipment and storage medium

Through the collaborative work of multiple large language models and the user feedback mechanism, the error problem caused by the "illusion" of large models in the legal case retrieval system is solved, the retrieval efficiency and accuracy are improved, and the needs of legal services are met.

CN118467723BActive Publication Date: 2024-09-10SHENZHEN DELI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410937412.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-09-10
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Due to the "illusion" problem in large models, the existing legal case retrieval system leads to erroneous retrieval results and low efficiency, making it difficult to meet the growing demand for legal services.

Method used

By obtaining the search sentences and historical records input by the user, multiple large language models with different architectures are used to make correlation judgments. If the results are inconsistent, the user is proactively requested for feedback and the search keywords are adjusted until consistent correlation judgment results are obtained. Generate Detailed case search reports.

Benefits of technology

It achieves accurate case retrieval, improves retrieval efficiency, can effectively solve the problem of model "illusion", and meets the needs of legal services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467723B
    Figure CN118467723B
Patent Text Reader

Abstract

The embodiment of the present invention relates to the technical field of text processing, and discloses a case retrieval method, device, computer equipment and computer-readable storage medium, the method comprising: obtaining a current search statement and historical records input by a user; inputting the current search statement and historical records into a search model to obtain a current search condition; searching in a legal text database system according to the current search condition to obtain initial legal text case data; inputting each initial legal text case data into a summary model to obtain each target summary text; inputting each target summary text into multiple relevance judgment models to obtain an intermediate result; if the initial relevance judgment results are consistent, outputting the target case; the target case is a related legal text case; inputting the historical records and the target case into a summary model to obtain a target legal text retrieval report. The embodiment of the present invention achieves the technical effect of accurate retrieval by actively requesting user feedback during the retrieval process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of text processing technology, and specifically to a case retrieval method, device, computer equipment and computer-readable storage medium. Background Art

[0002] At present, case retrieval is an important task for lawyers before handling a legal business. Lawyers need to retrieve relevant cases from the legal text library based on the case and perform operations including screening, summarizing, and writing retrieval reports, which requires a lot of energy.

[0003] Existing legal search systems generally provide case search and case summary functions, requiring lawyers to constantly judge the relevance of search results and optimize search keywords to ultimately obtain the required cases, summarize all cases and write search reports. These methods are not only time-consuming and labor-intensive, but also inefficient and can hardly meet the growing demand for legal services.

[0004] Big model technology is an effective tool for processing text tasks. Thanks to the huge number of parameters, the big model can input natural language sentences, understand the requirements in the sentences, and generate the required content more accurately based on the requirements, helping users complete corresponding tasks, such as text translation, text summarization, etc.

[0005] Although the existing technical solutions have game mechanism designs between agents, they lack human feedback. Since large models have the problem of "hallucination", that is, they generate wrong information, the final result will be wrong. Summary of the invention

[0006] In view of the above problems, embodiments of the present invention provide a case retrieval method, apparatus, computer device and computer-readable storage medium to solve the problem of large model "hallucination" existing in the prior art.

[0007] According to one aspect of an embodiment of the present invention, a case retrieval method is provided, the method comprising:

[0008] Obtaining the current search statement and historical records input by the user; the current search statement is a natural language statement related to law; the historical records are historical search conditions, historical search result content summaries, historical relevance judgment information, and historical user feedback information generated in the search process before the current search;

[0009] Input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample;

[0010] Searching in the legal text database system according to the current search conditions to obtain initial legal text case data;

[0011] Input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples;

[0012] Input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and judgment reason are a judgment result and judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples;

[0013] If the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case;

[0014] The historical records and target cases are input into the summary model to obtain a target legal text retrieval report.

[0015] In an optional manner, after inputting the target summary text into a plurality of relevance judgment models to obtain an intermediate result, the method further includes:

[0016] If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record;

[0017] Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information;

[0018] The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0019] In an optional manner, the multiple relevance judgment models are respectively trained based on four large language models with different architectures; before inputting each of the target summary texts into the multiple relevance judgment models and obtaining the intermediate results, the method further includes:

[0020] The relevance judgment samples are input into four different large language models for training to obtain four relevance judgment models; the relevance judgment samples include search sentence samples and corresponding summary text samples marked with relevance.

[0021] In an optional manner, each of the target summary texts is input into a plurality of relevance judgment models to obtain an intermediate result, including:

[0022] Based on the judgment voting mechanism, determine whether the four initial relevance judgment results are consistent.

[0023] In an optional manner, the historical record is a JSON structure; the JSON structure records user input information, model output information, and user feedback information.

[0024] In an optional manner, after inputting the historical records and the target case into the summary model to obtain the target legal text retrieval report, the method further includes:

[0025] Feedback the search report to the user;

[0026] If satisfactory information input by the user is obtained, the search ends;

[0027] If user feedback is obtained, the search report will continue to be stored in the historical record, and the current search statement, the feedback information and the historical record will continue to be input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained to obtain a new target case.

[0028] According to another aspect of an embodiment of the present invention, there is provided a case search device, comprising:

[0029] An acquisition module, used to acquire the current search sentence and historical records input by the user; the current search sentence is a natural language sentence related to law; the historical records are historical search conditions, historical search result content summary, historical relevance judgment information and historical user feedback information generated in the search process before the current search;

[0030] A search condition generation module, used to input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample;

[0031] A search module, used to search in the legal text database system according to the current search conditions to obtain initial legal text case data;

[0032] A summary module is used to input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples;

[0033] A relevance judgment module is used to input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and the judgment reason are the judgment result and the judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples;

[0034] A case determination module, configured to output a target case if the initial relevance judgment results are consistent; the target case is a related legal text case;

[0035] The summary module is used to input the historical records and target cases into the summary model to obtain a target legal text retrieval report.

[0036] In an optional manner, the device further includes a feedback module, which is used to:

[0037] If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record;

[0038] Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information;

[0039] The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0040] According to another aspect of an embodiment of the present invention, there is provided a computer device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0041] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the case retrieval method.

[0042] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, and when the executable instruction is executed on a computer device, the computer device executes the operation of the case retrieval method.

[0043] The embodiment of the present invention obtains the current search statement and historical records input by the user; inputs the current search statement and the historical records into the search model to obtain the current search condition; searches in the legal text database system according to the current search condition to obtain initial legal text case data; inputs each of the initial legal text case data into the summary model to obtain each target summary text; inputs each of the target summary texts into multiple relevance judgment models to obtain an intermediate result; if the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case; the historical records and the target case are input into the summary model to obtain a target legal text search report. The search requirements, i.e., query, are received through the user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for related cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the case. The summarized document is sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate search. After receiving user feedback, the feedback information is put into the history record and input into the search agent to regenerate the search keywords. The adjusted keywords are used for search again to optimize the results. The filtered relevant documents and history records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system will show the optimized case summary and induction results to the lawyer, and automatically generate a detailed case search report. By setting up a feedback mechanism in the middle of the search process, the technical effect of accurate search is achieved, which can effectively solve the technical problem of model "hallucination".

[0044] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0046] Figure 1 A schematic diagram of a process flow of a case search method provided by an embodiment of the present invention is shown;

[0047] Figure 2 A schematic diagram showing the structure of a model in a case retrieval method provided by an embodiment of the present invention is shown;

[0048] Figure 3 A schematic diagram of a system architecture corresponding to the case retrieval method provided by an embodiment of the present invention is shown;

[0049] Figure 4 A schematic diagram showing a flow chart of a case retrieval method provided by another embodiment of the present invention;

[0050] Figure 5 A schematic diagram showing the structure of a case search device provided by an embodiment of the present invention is shown;

[0051] Figure 6 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0052] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0053] Large model technology is an effective tool for processing text tasks. Thanks to the huge number of parameters, large models can input natural language sentences, understand the requirements in the sentences, and generate the required content more accurately according to the requirements, helping users complete corresponding tasks, such as text translation, text summarization, etc. Some researchers and developers have proposed the concept of an agent system based on large models, hoping to improve the intelligence level of the retrieval system by simulating the collaboration of multiple agents through large models. For example, a retrieval system with two agents is designed: the user proposes a retrieval requirement, and an agent responsible for understanding the requirement will convert the user's requirement into a retrieval keyword to search in the database, and then input the retrieval results into the second agent responsible for summarizing. The agent responsible for summarizing is responsible for summarizing the retrieval results and finally returning them to the user. Although the existing technical solution has a game mechanism design between agents, it lacks human feedback. Due to the "hallucination" problem of the large model, that is, the generation of wrong information, it will lead to the error of the final result. For this problem, the present invention designs an active feedback seeking mechanism, that is, the system will show the uncertain intermediary results of the system to the user when necessary, and make improvements based on user feedback to finally obtain the correct results. The purpose of the present invention is to design a retrieval system that actively seeks intermediate result feedback from lawyers. The retrieval system is composed of multiple large model agents that work together to fully automatically retrieve relevant cases and generate retrieval reports for lawyers based on their needs.

[0054] Figure 1 FIG. 1 is a flowchart of a case search method provided by an embodiment of the present invention, and the method is executed by a computer device. Figure 1 As shown, the method comprises the following steps:

[0055] Step 110: Obtain the current search statement and history records input by the user.

[0056] The current search sentence is a natural language sentence related to law. The user inputs the search requirement, that is, the current search sentence, in the search interface to obtain the current search sentence.

[0057] In an embodiment of the present invention, the historical record is the historical search conditions, historical search result content summary, historical relevance judgment information and historical user feedback information generated in the search process before the current search. Among them, the historical record is a temporary file, which records the historical content such as the intermediate results and user feedback information fed back to the user by the user storage system. Specifically, the historical record can be a json structure, which records the data of the intermediate process such as the user input, the model output, and the user feedback in the historical search process. Among them, the historical record can be a historical record related to the current search statement of this search. For example, the current search statement has been searched before, and the data generated during the search process. Among them, the historical records corresponding to the same search statement are placed in a JSON structure.

[0058] Step 120: Input the current search statement and the historical records into the search model to obtain the current search conditions.

[0059] Among them, Figure 2 As shown, the retrieval model is pre-trained based on retrieval condition samples.

[0060] If there is a historical record, the current search statement and the historical record are processed by text segmentation and keyword processing to obtain the current search condition. In the embodiment of the present invention, the search condition sample is obtained by training the basic large model Agent according to the segmentation and keyword labels of the legal text sample.

[0061] Step 130: Search in the legal text database system according to the current search conditions to obtain initial legal text case data.

[0062] The legal text database is the backend storage unit of the system, which is used to store the case data in the legal text library and all the data generated during the retrieval process. According to the current retrieval conditions, at least one initial legal text case data is retrieved through text matching recognition. The initial legal text case data can preferably retrieve the Top-K cases from the database according to the retrieval conditions, and remove the retrieved cases contained in the historical records.

[0063] Step 140: Input each of the initial legal text case data into the summary model to obtain each target summary text.

[0064] The target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data. The summary model is pre-trained based on legal text case samples.

[0065] The composition and input and output of the summary model are as follows Figure 2As shown in the figure, the main body is a large language model, the input is the original case text, and the output is the summary text. Specifically, the legal text case sample includes the legal text sample case data and summary labels. The summary model is obtained by inputting the legal text case sample into the large language model for training. After obtaining the trained summary model, a shorter summary is generated for each case through the summary model, and each case is divided into: case facts, statements of both parties' views, court views, and judgment results.

[0066] Step 150: Input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result.

[0067] Among them, the embodiment of the present invention ultimately needs to output the search results, and before outputting the search results, the relevance judgment of the summary text is first performed through multiple relevance judgment models, and the case results with consistent relevance judgments are output. Therefore, the judgment result of the relevance judgment model is an intermediate result, and the intermediate result includes the initial relevance judgment result and the initial judgment reason output by each relevance judgment model; the relevance judgment result and the judgment reason are the judgment result and judgment reason of whether there is a relevance between the target summary text and the current search statement. Specifically, each relevance judgment model directly generates a formatted document, indicating "relevant", "relatively relevant" and "irrelevant" and giving corresponding judgment reasons.

[0068] In the embodiment of the present invention, Figure 2 As shown, each relevance judgment model is obtained by training models of different architectures using relevance training samples. In the embodiment of the present invention, each relevance judgment model can be based on four different model bases: Qwen2-7B, llama-3-8b, GLM4-9b, and Qwen1.5-MoE-2x7B, and is obtained by training the above bases with relevance judgment samples. Among them, the relevance judgment samples include retrieval sentence samples and corresponding summary text samples marked with relevance. The relevance judgment samples are input into the above four models for training to obtain a relevance judgment model. Through the multi-relevance agent judgment voting mechanism, multiple relevance agents are used to judge the relevance between the case and the user query from different angles, thereby improving the accuracy of the relevance judgment.

[0069] Step 160: If the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case.

[0070] The embodiment of the present invention determines whether the four initial correlation judgment results are consistent based on the judgment voting mechanism. When the correlation judgment results are consistent, the target case is output.

[0071] In an embodiment of the present invention, if the initial relevance judgment result is inconsistent, the search conditions, initial legal text case data, target summary text, initial relevance judgment result and initial judgment reason are stored in the historical record. Feedback questions are sent to the user based on the initial relevance judgment result and the initial judgment reason, so that the user outputs corresponding feedback information. The current search statement, the feedback information and the historical record are input into the search model to obtain the current search conditions, until a target relevance judgment result with a consistent judgment result is obtained, and the target case is output.

[0072] Step 170: Input the historical records and target cases into the summary model to obtain a target legal text retrieval report.

[0073] The target legal text search report includes the summary content of the target legal text, the legal text content, the relevance reasons, the legal text summary content, etc., which is not specifically limited in the embodiment of the present invention.

[0074] Among them, after obtaining the search report, the search report is fed back to the user; if satisfactory information is input by the user, the search ends; if feedback information is obtained from the user, the search report continues to be stored in the historical record, and the current search statement, the feedback information and the historical record continue to be input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained, and a new target case is obtained.

[0075] Among them, Figure 3 As shown in the figure, the system actively asks users questions about the intermediate results in the search process and obtains user feedback to further search, making the search results more accurate. The following is a specific case search process, and its specific implementation process is as follows:

[0076] Round 1:

[0077] { "query":"What are the consequences if a company's external guarantee is not subject to an effective internal resolution?",

[0078] "Search Agent output search conditions": "Company external guarantee AND internal effective resolution AND consequences",

[0079] "Retrieve returned documents":["Document 1:XXX","Document 2:XXX","Document 3:XXX","Document 4:XXX","Document 5:XXX"],

[0080] "Summary Agent Output": ["Document 1 Summary: XXX", "Document 2 Summary: XXX", "Document 3 Summary: XXX", "Document 4 Summary: XXX", "Document 5 Summary: XXX"],

[0081] "Multiple correlation agent output results":

[0082] "Relevance Agent 1 output": ["query is relevant to document 1, reason: XXX", "query is relevant to document 2, reason: XXX", "query is relevant to document 3, reason: XXX", "query is relevant to document 4, reason: XXX", "query is relevant to document 5, reason: XXX"],

[0083] "Relevance Agent2 output": ["query is relevant to document 1, reason: XXX", "query is relevant to document 2, reason: XXX", "query is relevant to document 3, reason: XXX", "query is irrelevant to document 4, reason: XXX", "query is relatively relevant to document 5, reason: XXX"],

[0084] "Relevance Agent3 output": ["query is relevant to document 1, reason: XXX", "query is relevant to document 2, reason: XXX", "query is relevant to document 3, reason: XXX", "query is relevant to document 4, reason: XXX", "query is relevant to document 5, reason: XXX"],

[0085] "Relevance Agent 4 output": ["query is relevant to document 1, reason: XXX", "query is relevant to document 2, reason: XXX", "query is relevant to document 3, reason: XXX", "query is irrelevant to document 4, reason: XXX", "query is irrelevant to document 5, reason: XXX"],

[0086] "Relevance Agent5 output": ["query is relevant to document 1, reason: XXX", "query is relevant to document 2, reason: XXX", "query is relevant to document 3, reason: XXX", "query is relevant to document 4, reason: XXX", "query is not relevant to document 5, reason: XXX"]},

[0087] "Request user feedback content": [{"Feedback content 1":"Are the query related to document 4? query:XXX, document summary:XXX", "User feedback result":"Not related"}, {"Feedback content 2":"Are the query related to document 5? query:XXX, document summary:XXX", "User feedback result":"Relevant"} ],

[0088] "Summary Report":"",

[0089] "User final feedback":""},

[0090] Round 2:

[0091] {"query":"What are the consequences if a company provides external guarantees without an effective internal resolution?","Search Agent Output Search Condition":"Company provides external guarantees AND no AND effective internal resolution AND consequences","Search Return Documents":["Document 6:XXX"],

[0092] "Summary Agent Output": ["Document 6 Summary: XXX"],

[0093] "Output results of multiple correlation agents":{"Output of Correlation Agent 1": ["query is related to document 6, reason is: XXX"], "Output of Correlation Agent 2": ["query is related to document 6, reason is: XXX"], "Output of Correlation Agent 3": ["query is related to document 6, reason is: XXX"],"Output of Correlation Agent 4": ["query is related to document 6, reason is: XXX"],"Output of Correlation Agent 5": ["query is related to document 6, reason is: XXX"]},

[0094] "Request user feedback content":[],

[0095] "Summary Report":"Search report content:XXX",

[0096] "User's final feedback":"The cases retrieved in the report are not comprehensive enough, please add another one"},

[0097] Round 3:

[0098] {"query":"What are the consequences if the company provides external guarantees without an effective internal resolution", "Search Agent outputs search conditions":"Company provides external guarantees AND no AND (effective internal resolution OR internal vote) AND consequences","Documents returned by search":["Document 7:XXX"], "Summary Agent output":["Document 7 summary:XXX" ], "Multiple correlation agent output results":{"Correlation Agent 1 output": ["query is related to Document 7 for the following reason: XXX"],"Correlation Agent 2 output": ["query is related to Document 7 for the following reason: XXX"],"Correlation Agent 3 output": ["query is related to Document 7 for the following reason: XXX" ], "Correlation Agent 4 output": ["query is related to Document 7 for the following reason: XXX" ], "Correlation Agent 5 output": ["query is related to Document 7 for the following reason: XXX" ]},"Content of request for user feedback":[], "Summary report":"Content of search report:XXX", "Final user feedback":"".

[0099] like Figure 4 As shown, the present invention receives search requirements, i.e., queries, through a user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for relevant cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the cases. The summarized documents are sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate searches. After obtaining user feedback, the feedback information is put into the history record and input into the search agent to regenerate the search keywords. The adjusted keywords are used for search again to optimize the results. The filtered relevant documents and history records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system displays the optimized case summary and induction results to the lawyer, and automatically generates a detailed case search report.

[0100] The embodiment of the present invention receives search requirements, i.e., queries, through a user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for relevant cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the cases. The summarized documents are sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate search. After obtaining user feedback, the feedback information is put into the historical record, input into the search agent to regenerate the search keywords, and the adjusted keywords are used for search again to optimize the results. The filtered relevant documents and historical records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system displays the optimized case summary and induction results to the lawyer, and automatically generates a detailed case search report. By setting a feedback mechanism in the middle of the search process, the technical effect of accurate search is achieved, which can effectively solve the technical problem of model "hallucination".

[0101] Figure 5 FIG. 1 is a schematic diagram showing the structure of a case search device provided by an embodiment of the present invention. Figure 5 As shown, the device 300 includes:

[0102] The acquisition module 310 is used to obtain the current search statement and historical records input by the user; the current search statement is a natural language statement related to law; the historical records are historical search conditions, historical search result content summaries, historical relevance judgment information and historical user feedback information generated during the search process before this search.

[0103] The search condition generation module 320 is used to input the current search statement and the historical records into a search model to obtain the current search condition; the search model is pre-trained based on the search condition samples.

[0104] The search module 330 is used to search in the legal text database system according to the current search conditions to obtain initial legal text case data.

[0105] The summary module 340 is used to input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views stated by both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples.

[0106] The relevance judgment module 350 is used to input each of the target summary texts into multiple relevance judgment models to obtain intermediate results; the intermediate results include the initial relevance judgment results and initial judgment reasons output by each relevance judgment model; the relevance judgment results and judgment reasons are the judgment results and judgment reasons of whether there is a correlation between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples.

[0107] The case determination module 360 ​​is used to output a target case if the initial relevance judgment results are consistent; the target case is a related legal text case.

[0108] The summary module 370 is used to input the historical records and target cases into the summary model to obtain a target legal text retrieval report.

[0109] In an optional manner, the device further includes a feedback module, which is used to:

[0110] If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record;

[0111] Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information;

[0112] The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0113] In an optional manner, the multiple relevance judgment models are respectively trained based on four large language models with different architectures; before inputting each of the target summary texts into the multiple relevance judgment models and obtaining the intermediate results, the method further includes:

[0114] The relevance judgment samples are input into four different large language models for training to obtain four relevance judgment models; the relevance judgment samples include summary text samples and relevance labels.

[0115] In an optional manner, each of the target summary texts is input into a plurality of relevance judgment models to obtain an intermediate result, including:

[0116] Based on the judgment voting mechanism, determine whether the four initial relevance judgment results are consistent.

[0117] In an optional manner, the historical record is a JSON structure; the JSON structure records user input information, model output information, and user feedback information.

[0118] In an optional manner, after inputting the historical records and the target case into the summary model to obtain the target legal text retrieval report, the method further includes:

[0119] Feedback the search report to the user;

[0120] If satisfactory information input by the user is obtained, the search ends;

[0121] If user feedback is obtained, the search report is stored in the history record, and the current search statement, the feedback information and the history record are input into the search model to obtain the current search condition, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0122] The specific implementation process of each module in the case retrieval device of the embodiment of the present invention is generally consistent with the specific implementation steps of the above-mentioned method embodiment, and will not be repeated here.

[0123] The embodiment of the present invention receives search requirements, i.e., queries, through a user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for relevant cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the cases. The summarized documents are sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate search. After obtaining user feedback, the feedback information is put into the historical record, input into the search agent to regenerate the search keywords, and the adjusted keywords are used for search again to optimize the results. The filtered relevant documents and historical records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system displays the optimized case summary and induction results to the lawyer, and automatically generates a detailed case search report. By setting a feedback mechanism in the middle of the search process, the technical effect of accurate search is achieved, which can effectively solve the technical problem of model "hallucination".

[0124] Figure 6 The schematic diagram of the structure of the computer device provided by the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.

[0125] like Figure 6As shown, the computer device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0126] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the case retrieval method.

[0127] Specifically, the program 410 may include program code including computer executable instructions.

[0128] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0129] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0130] The program 410 may be specifically called by the processor 402 to enable the computer device to perform the following operations:

[0131] Obtaining the current search statement and historical records input by the user; the current search statement is a natural language statement related to law; the historical records are historical search conditions, historical search result content summaries, historical relevance judgment information, and historical user feedback information generated in the search process before the current search;

[0132] Input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample;

[0133] Searching in the legal text database system according to the current search conditions to obtain initial legal text case data;

[0134] Input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples;

[0135] Input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and judgment reason are a judgment result and judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples;

[0136] If the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case;

[0137] The historical records and target cases are input into the summary model to obtain a target legal text retrieval report.

[0138] In an optional manner, after inputting the target summary text into a plurality of relevance judgment models to obtain an intermediate result, the method further includes:

[0139] If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record;

[0140] Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information;

[0141] The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0142] In an optional manner, the multiple relevance judgment models are respectively trained based on four large language models with different architectures; before inputting each of the target summary texts into the multiple relevance judgment models and obtaining the intermediate results, the method further includes:

[0143] The relevance judgment samples are input into four different large language models for training to obtain four relevance judgment models; the relevance judgment samples include summary text samples and relevance labels.

[0144] In an optional manner, each of the target summary texts is input into a plurality of relevance judgment models to obtain an intermediate result, including:

[0145] Based on the judgment voting mechanism, determine whether the four initial relevance judgment results are consistent.

[0146] In an optional manner, the historical record is a JSON structure; the JSON structure records user input information, model output information, and user feedback information.

[0147] In an optional manner, after inputting the historical records and the target case into the summary model to obtain the target legal text retrieval report, the method further includes:

[0148] Feedback the search report to the user;

[0149] If satisfactory information input by the user is obtained, the search ends;

[0150] If user feedback is obtained, the search report is stored in the history record, and the current search statement, the feedback information and the history record are input into the search model to obtain the current search condition, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0151] The embodiment of the present invention receives search requirements, i.e., queries, through a user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for relevant cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the cases. The summarized documents are sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate search. After obtaining user feedback, the feedback information is put into the historical record, input into the search agent to regenerate the search keywords, and the adjusted keywords are used for search again to optimize the results. The filtered relevant documents and historical records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system displays the optimized case summary and induction results to the lawyer, and automatically generates a detailed case search report. By setting a feedback mechanism in the middle of the search process, the technical effect of accurate search is achieved, which can effectively solve the technical problem of model "hallucination".

[0152] An embodiment of the present invention provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on a computer device, the computer device executes the case retrieval method in any of the above method embodiments.

[0153] The executable instructions can be specifically used to cause the computer device to perform the following operations:

[0154] Obtaining the current search statement and historical records input by the user; the current search statement is a natural language statement related to law; the historical records are historical search conditions, historical search result content summaries, historical relevance judgment information, and historical user feedback information generated in the search process before the current search;

[0155] Input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample;

[0156] Searching in the legal text database system according to the current search conditions to obtain initial legal text case data;

[0157] Input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples;

[0158] Input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and judgment reason are a judgment result and judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples;

[0159] If the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case;

[0160] The historical records and target cases are input into the summary model to obtain a target legal text retrieval report.

[0161] In an optional manner, after inputting the target summary text into a plurality of relevance judgment models to obtain an intermediate result, the method further includes:

[0162] If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record;

[0163] Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information;

[0164] The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0165] In an optional manner, the multiple relevance judgment models are respectively trained based on four large language models with different architectures; before inputting each of the target summary texts into the multiple relevance judgment models and obtaining the intermediate results, the method further includes:

[0166] The relevance judgment samples are input into four different large language models for training to obtain four relevance judgment models; the relevance judgment samples include summary text samples and relevance labels.

[0167] In an optional manner, each of the target summary texts is input into a plurality of relevance judgment models to obtain an intermediate result, including:

[0168] Based on the judgment voting mechanism, determine whether the four initial relevance judgment results are consistent.

[0169] In an optional manner, the historical record is a JSON structure; the JSON structure records user input information, model output information, and user feedback information.

[0170] In an optional manner, after inputting the historical records and the target case into the summary model to obtain the target legal text retrieval report, the method further includes:

[0171] Feedback the search report to the user;

[0172] If satisfactory information input by the user is obtained, the search ends;

[0173] If user feedback is obtained, the search report is stored in the history record, and the current search statement, the feedback information and the history record are input into the search model to obtain the current search condition, until a target relevance judgment result that is consistent with the judgment result is obtained.

[0174] The embodiment of the present invention receives search requirements, i.e., queries, through a user interface, and the search agent then converts these requirements into search keywords. These keywords are used to search for relevant cases in the legal text library, and the search results are then passed to the summary agent, which summarizes the cases. The summarized documents are sent to the multi-agent judgment module for relevance judgment. According to whether multiple relevance agents reach a consensus, the system actively displays the uncertain intermediate results to the lawyer and requests feedback, so as to readjust the search keywords according to the lawyer's feedback and perform more accurate search. After obtaining user feedback, the feedback information is put into the historical record, input into the search agent to regenerate the search keywords, and the adjusted keywords are used for search again to optimize the results. The filtered relevant documents and historical records will be sent to the summary agent to generate a search report, and the user's feedback information will also be obtained to optimize the search. Finally, the system displays the optimized case summary and induction results to the lawyer, and automatically generates a detailed case search report. By setting a feedback mechanism in the middle of the search process, the technical effect of accurate search is achieved, which can effectively solve the technical problem of model "hallucination".

[0175] An embodiment of the present invention provides a case retrieval device for executing the above case retrieval method.

[0176] An embodiment of the present invention provides a computer program, which can be called by a processor to enable a computer device to execute the case retrieval method in any of the above method embodiments.

[0177] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the case retrieval method in any of the above method embodiments.

[0178] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description made to specific languages ​​above is for disclosing the best mode of the present invention.

[0179] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0180] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.

[0181] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and set in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into multiple submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0182] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A case retrieval method, characterized in that: The method comprises: Obtaining the current search statement and historical records input by the user; the current search statement is a natural language statement related to law; the historical records are historical search conditions, historical search result content summaries, historical relevance judgment information, and historical user feedback information generated in the search process before the current search; Input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample; Searching in the legal text database system according to the current search conditions to obtain initial legal text case data; Input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples; Input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and judgment reason are a judgment result and judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples; If the initial relevance judgment results are consistent, the target case is output; the target case is a related legal text case; The historical records and target cases are input into the summary model to obtain a target legal text retrieval report.

2. The method according to claim 1, characterized in that After inputting each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result, the method further includes: If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record; Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information; The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained, thereby obtaining a new target case.

3. The method according to claim 1, characterized in that: The multiple relevance judgment models are respectively trained based on four large language models with different architectures; before inputting each of the target summary texts into the multiple relevance judgment models and obtaining the intermediate results, the method further includes: The relevance judgment samples are input into four different large language models for training to obtain four relevance judgment models; the relevance judgment samples include search sentence samples and corresponding summary text samples marked with relevance.

4. The method according to claim 3, characterized in that Input each of the target summary texts into a plurality of relevance judgment models to obtain intermediate results, including: Based on the judgment voting mechanism, determine whether the four initial relevance judgment results are consistent.

5. The method according to any one of claims 1 to 3, characterized in that: The historical record is a JSON structure; the JSON structure records user input information, model output information, and user feedback information; The obtaining of the current search statement and history records input by the user includes: Call the target JSON structure corresponding to the current search statement; The target user input information, the target model output information, and the target user feedback information are obtained from the target JSON structure.

6. The method according to claim 3, characterized in that After inputting the historical records and target cases into the summary model to obtain the target legal text retrieval report, the method further includes: Feedback the search report to the user; If satisfactory information input by the user is obtained, the search ends; If user feedback information is obtained, the search report will continue to be stored in the historical record, and the current search statement, the feedback information and the historical record will continue to be input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained.

7. A case search device, characterized in that: The device comprises: An acquisition module, used to acquire the current search sentence and historical records input by the user; the current search sentence is a natural language sentence related to law; the historical records are historical search conditions, historical search result content summary, historical relevance judgment information and historical user feedback information generated in the search process before the current search; A search condition generation module, used to input the current search statement and the historical record into a search model to obtain the current search condition; the search model is trained in advance based on the search condition sample; A search module, used to search in the legal text database system according to the current search conditions to obtain initial legal text case data; A summary module is used to input each of the initial legal text case data into a summary model to obtain each target summary text; the target summary text includes the case facts, the views of both parties, the court's views, and the judgment results of the initial legal text case data; the summary model is pre-trained based on legal text case samples; A relevance judgment module is used to input each of the target summary texts into a plurality of relevance judgment models to obtain an intermediate result; the intermediate result includes an initial relevance judgment result and an initial judgment reason output by each relevance judgment model; the relevance judgment result and the judgment reason are the judgment result and the judgment reason of whether there is a relevance between the target summary text and the current search statement; each relevance judgment model is a model with different architectures trained using relevance training samples; A case determination module, configured to output a target case if the initial relevance judgment results are consistent; the target case is a related legal text case; The summary module is used to input the historical records and target cases into the summary model to obtain a target legal text retrieval report.

8. The device according to claim 7, characterized in that The device also includes a feedback module, which is used to: If the initial relevance judgment result is inconsistent, the search condition, the initial legal text case data, the target summary text, the initial relevance judgment result and the initial judgment reason are stored in the historical record; Sending feedback questions to the user according to the initial correlation judgment result and the initial judgment reason, so that the user outputs corresponding feedback information; The current search statement, the feedback information and the historical records are input into the search model to obtain the current search conditions, until a target relevance judgment result that is consistent with the judgment result is obtained, thereby obtaining a new target case.

9. A computer device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the case retrieval method as described in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction, and when the executable instruction is executed on a computer device, the computer device executes the operation of the case retrieval method according to any one of claims 1 to 6.