Legal consultation system construction method based on multi-model collaborative reasoning
By adopting multi-model collaborative reasoning and retrieval enhancement generation technology in the legal consulting system, a dynamically updated legal knowledge base and integrated external tools are solved, and a high-quality legal dialogue generation and professional response are achieved.
Patent Information
- Application Number
- CN202510231387.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-28
AI Technical Summary
There are hallucinations in the application of existing large language models in the legal field, insufficient logical reasoning ability, lagging legal knowledge updates, and insufficient multi-task collaboration ability, which cannot meet the rigor and credibility requirements of the legal field.
A legal consulting system construction method based on multi-model collaborative reasoning is adopted to build a dynamically updated legal knowledge base through search enhancement generation (RAG) technology, combine external tools to integrate professional capabilities such as date calculation, and generate a structured execution plan through a multi-model collaborative reasoning mechanism to ensure the professionalism and accuracy of the dialogue content.
It significantly reduces the model illusion phenomenon, enhances the system's logical reasoning ability and legal professionalism, ensures the timeliness and accuracy of knowledge, and can accurately deal with legal issues involving time dimensions.
Smart Images

Figure CN120030130A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large language model dialogue systems, and in particular to a legal consulting system construction technology, specifically a legal consulting system construction method based on multi-model collaborative reasoning. Background Art
[0002] In recent years, with the rapid development of deep learning technology, large language models (LLMs) have made breakthrough progress in the field of natural language processing (NLP). Through large-scale pre-training and fine-tuning, these models have demonstrated strong language understanding and generation capabilities and have been successfully applied to multiple vertical fields such as education, medical care, and finance. However, in the legal field, due to the characteristics of legal texts being highly specialized, logically rigorous, and highly standardized, existing large language models face significant technical challenges. The answer to legal issues requires not only the accuracy of language expression, but also the compliance of the legal reasoning process and the legitimacy of the conclusion, which places strict requirements on the reasoning ability and knowledge accuracy of large language models. Existing large models are obviously insufficient in terms of the accuracy and credibility of specialized knowledge. Therefore, how to overcome the inherent hallucination problems and inaccurate answers of large models through the system design of multi-agent technology has become a direction that researchers are actively exploring.
[0003] In order to improve the applicability of large language models in the legal field, researchers have proposed a variety of model optimization methods. Fine-Tuning technology significantly improves the model's legal semantic understanding ability by retraining with specific legal corpus based on the pre-trained model. P-Tuning V2 introduces a set of trainable prompt words at each layer of the model to achieve more effective parameter updates and enhance the model's reasoning ability in complex legal issues. Low-Rank Adaptation (LoRA) technology achieves efficient fine-tuning by adjusting the low-rank matrix of the model, while reducing computing and storage costs, while ensuring the model's efficiency in acquiring legal knowledge.
[0004] The following problems and deficiencies generally exist in existing legal consultation dialogues: 1) Unable to meet the credibility requirements in the legal field: The large language model that the existing legal consulting system relies on often has the problem of "hallucination" when generating content. It may fabricate legal clauses or misinterpret the meaning of existing clauses, resulting in the lack of a clear chain of evidence and authoritative legal basis for the solutions provided, which makes it impossible for legal practitioners to believe and adopt them.
[0005] 2) Lack of ability to construct logical steps to answer complex legal issues: Complex legal issues often involve the interweaving of multiple legal relationships, the application of multiple legal provisions, and complex reasoning processes. Existing systems are unable to accurately parse complex legal issues involving the association of multiple legal provisions, legal analysis, and logical reasoning, resulting in the lack of a clear reasoning path in the generated answers, and the inability to construct complete logical steps in an orderly manner.
[0006] 3) Lack of legal time calculation capabilities: When dealing with legal issues involving date calculations such as contract performance periods and statutes of limitations, the existing system is unable to accurately handle complex time rules such as working days and statutory holidays, which seriously affects the accuracy of legal affairs processing.
[0007] 4) Delayed updating of legal knowledge: Existing systems generally use static legal knowledge bases, which make it difficult to respond in a timely manner to dynamic changes such as revisions, repeals, and promulgation of new laws. As a result, the system may produce incorrect answers when faced with questions related to new laws.
[0008] 5) Insufficient multi-task collaboration capabilities: A single model is difficult to simultaneously meet diverse needs such as legal knowledge retrieval, logical reasoning, and text generation, resulting in limitations in the system's capabilities when dealing with complex legal issues. Summary of the invention
[0009] In order to solve the above technical problems, the purpose of the present invention is to provide a method for constructing a legal consulting system based on multi-model collaborative reasoning, the core principle of which is: in view of the special requirements of legal dialogue scenarios for rigor and logic, through innovative multi-model collaborative architecture and knowledge enhancement mechanism, high-quality legal field consulting dialogue generation is achieved. The technical solution of the present invention mainly includes the following two aspects: first, the retrieval-augmented generation (RAG) technology is used to build a dynamically updated legal knowledge base, effectively alleviate the hallucination problem of the large language model, and ensure that the generated content has a reliable legal basis; second, through the effective integration of the large language model with external tools, the system is endowed with professional capabilities such as accurate date calculation and real-time information query. In view of the reasoning limitations of a single model when dealing with complex legal issues, the present invention proposes an innovative solution of multi-model collaborative reasoning: first, the task analysis dedicated model is based on the problem characteristics and relevant laws, combined with its tool set to conduct in-depth analysis and generate a structured problem-solving execution plan; the large language model in the legal professional field performs multi-step reasoning based on the execution plan to ensure the professionalism and accuracy of the dialogue content.
[0010] To achieve the above object, the present invention adopts the following technical solutions: A method for constructing a legal consulting system based on multi-model collaborative reasoning, by constructing a dynamically updated legal knowledge base and external tool technology, and combining a multi-model collaborative reasoning mechanism, generates dialogue content that meets the legal rigor requirements according to the process of problem analysis, plan formulation and step-by-step reasoning, specifically including the following steps: S1: Collect the latest legal codes from public legal databases, perform standardized data cleaning, and annotate metadata information to obtain a structured data set suitable for legal text retrieval; S2: Use the encoder model to convert the legal provisions processed in S1 into low-dimensional dense vectors, establish a vector indexing mechanism, build a legal provision vector retrieval knowledge base, and achieve fast and accurate legal provision retrieval; S3: Build an automatic update tool for legal provisions, use crawler technology to regularly track legislative revisions, and automatically complete the update and replacement of the legal provisions knowledge base in S2, always ensuring the timeliness and accuracy of the legal provisions in the knowledge base; S4: Design a date calculation tool library for legal scenarios, access the calendar to query holiday information; function types include basic mathematical calculations, date difference calculations, working day calculations and time calculations, and accurately define the functional boundaries and calling specifications of each function in the tool library; S5: Combine the tool function library information defined in S4 with the collected legal question-answering data to construct a fine-tuning dataset containing real legal question-answering examples and manually annotated execution plans. Use a supervised fine-tuning method to fine-tune the base large language model to obtain a task analysis-specific model that can generate structured execution plans. S6: Obtain the consulting question input by the user, use the Retrieval-Augmented Generation (RAG) technology to retrieve the top-k legal provisions with the highest similarity from the legal provision knowledge base updated in S3, and concatenate them with the user's question; S7: The user question concatenated in S6 and the retrieved legal provisions with the highest similarity are used as input to enter the first stage of the two-stage reasoning mechanism; the task analysis dedicated model conducts an in-depth analysis of the user question based on the retrieved relevant legal provisions and the available external tool library, and generates a structured execution plan including reasoning steps and tool calling solutions; S8: using the Zero-Shot Chain-of-Thought technology to analyze the structured execution plan obtained in S7, integrating the original question, the corresponding legal provisions and the execution plan into a structured final prompt word; S9: Enter the second stage of the two-stage reasoning mechanism; use the base large language model as the content generation large language model, input the final prompt word obtained in S8 into the content generation large language model, and guide the model to conduct multiple rounds of dialogue reasoning; the model understands the sequence of steps in the execution plan, uses the intelligent agent technology to autonomously call the corresponding external tools, and integrates the relevant legal content and the calculation results of the external tools to generate professional answers that meet the requirements of legal rigor.
[0011] Further, the step S5 specifically includes: Firstly, the defined tool library information is combined with the collected legal question-and-answer data to construct a fine-tuning dataset containing real legal question-and-answer examples and manually annotated execution plans. During fine-tuning, user questions, corresponding laws and tool library descriptions are used as input information, and the base large language model is fine-tuned in a supervised manner by combining prompt word engineering with low-rank adaptation (LoRA) fine-tuning. Prompt word engineering aims to guide the model to conduct a step-by-step analysis on how to answer current legal issues based on the callable tool library resources. LoRA fine-tuning technology inserts an adapter module into the basic model and only adjusts a small number of parameters of the adapter module, thereby achieving model fine-tuning while keeping the original parameters of the model unchanged. Finally, after the fine-tuning is completed, a task analysis-specific model is obtained that can generate structured execution plans based on corresponding laws and callable tool library.
[0012] Furthermore, the construction includes a fine-tuning dataset containing real legal question and answer examples and manually annotated execution plans, specifically including: In view of specific application scenarios in the legal field, the fine-tuning dataset covers two types of data: first, a large number of general legal question-and-answer dialogues are refined and converted into question-and-answer (QA) data in JSON format, aiming to enable the large language model to effectively understand the general answer methods for common legal issues; second, legal issues and corresponding legal knowledge in a specific task scenario are collected, and legal experts manually label each question based on the defined tool function library information to generate the best execution plan label for solving the problem, which is used as the label data for fine-tuning.
[0013] Furthermore, step S7 generates a structured execution plan including reasoning steps and tool calling schemes, specifically including: (1) Ordered sequence of steps: indicates the order in which specific steps need to be executed or which tool function libraries need to be called; (2) Required parameters of the step: indicates the parameter name required to execute the step and the actual data of the corresponding parameters; (3) Reason for executing a step: Indicates the logical reason and significance of executing the step in the process of solving the problem.
[0014] Furthermore, step S8 uses the zero-sample thinking chain technology to parse the obtained structured execution plan, specifically including: first, based on the reasoning steps and tool calling schemes in the execution plan, decomposing the complex legal problem into a sub-task sequence with a logical progressive relationship; then, the original problem description, the retrieved relevant legal information and the decomposed sub-task sequence are semantically fused in multiple dimensions.
[0015] The beneficial effects of the present invention are as follows: 1) Guarantee of knowledge reliability: The legal knowledge base constructed by the present invention through RAG technology significantly reduces the model hallucination phenomenon, and builds a legal article update tool to automatically complete the update and replacement of the legal article knowledge base, ensuring the timeliness and accuracy of the legal articles in the knowledge base, and providing reliable knowledge support for the generation of legal dialogues.
[0016] 2) Ability to construct logical steps for complex legal issues: The present invention uses a fine-tuned task analysis model to conduct in-depth analysis of complex legal issues and generate a structured execution plan containing reasoning steps and tool calling schemes, thereby further guiding the system to perform clear and logical reasoning.
[0017] 3) Multi-model collaborative reasoning: The present invention makes up for the limitations of a single model in logical reasoning through multi-model collaboration guided by an execution plan. It adopts a step-by-step reasoning mechanism to break down complex legal scenario problems step by step and solve them one by one, significantly enhancing the system's logical reasoning ability and legal professionalism.
[0018] 4) Functional scalability: The present invention integrates professional external tools such as date calculation, and incorporates the calculation results into the dialogue generation and legal analysis process through external tool function technology, so that the system can accurately handle legal issues involving the time dimension, and effectively support the application needs of key legal scenarios such as contract performance and statute of limitations. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of the present invention; Figure 2 Generate a flow chart for the present invention dialogue; Figure 3 This is a system architecture diagram of the present invention. DETAILED DESCRIPTION
[0020] The present invention is described in detail below with reference to the accompanying drawings and embodiments. Example
[0021] See also Figure 1 In the legal dialogue in the field of market supervision law, the overall steps of this embodiment are as follows: S101: Obtain the latest legal codes in the field of market supervision from the public legal database, and clean the data of each code. Segment the text based on legal provisions; add metadata to each legal provision, including the name of the law, provision number, chapter number, whether it is invalid, and legal category. The processed legal provisions will be used as the original data for the subsequent construction of the legal knowledge base.
[0022] S102: Input the legal texts processed in S101 into the Chinese embedding model bge-large-zh-v1.5, and use L2 normalization to maintain the consistency of distance measurement, map it to a low-dimensional vector space of 1024, and obtain the vector representation of the legal texts, so that each legal text can reflect its semantic features and logical relationships in the vector space. Use the milvus vector database to store the original information and vector arrays of legal texts, and build a hierarchical navigable small world (HNSW) index, which accelerates the search process by building a multi-layer graph structure, significantly reducing the search time while maintaining a high recall rate, and finding the most relevant legal texts from the knowledge base through methods such as vector similarity calculation.
[0023] S103: Given that the legal system is in a state of continuous dynamic evolution, new laws are frequently issued and old laws are revised and repealed from time to time, a tool for automatically updating laws is built. The latest laws issued or revised recently are obtained through web page access tracking, and keywords are searched in the milvus database through the legal article metadata. The revised legal articles are checked one by one to determine whether they already exist in the knowledge base. If they do exist, the old legal articles are deleted and replaced with the revised ones; if they do not exist, the new legal articles are directly inserted. The system automatically updates and replaces the legal article knowledge base within the system, always ensuring the timeliness and accuracy of the legal articles in the knowledge base, and avoiding legal reasoning deviations caused by delayed legal articles.
[0024] S104: In the legal field, the calculation and processing of dates often involve many key elements such as the statute of limitations and deadlines stipulated by law, so it is necessary to customize a special date calculation function. By counting legal dialogue instances that require date calculation, it will be divided into calculating the difference in days between two dates, calculating the end date based on the start date and the number of days between, and reversing the start date based on the end date and the number of days between. Each type of calculation needs to involve the distinction between "natural days" and "working days", and accurately describe the function's function, the meaning of function parameters, parameter types, etc. in natural language, so that when the model deals with legal issues related to dates, it can call this function for accurate date calculation, and reasonably integrate the calculation results into the dialogue generation and legal analysis process, enhancing the model's ability to handle the time dimension when dealing with legal affairs.
[0025] S105: Fine-tune the task analysis-specific model for generating structured execution plans. First, accurately define and describe the tool library that the large language model can call in the legal scenario and its capability boundaries, and provide key information for the content of the execution plan. At the same time, for specific application scenarios in the legal field, taking the legal scenario in the field of market supervision as an example, the fine-tuning data set mainly includes two types of data: first, the legal question-and-answer dialogue is refined and converted into a standard question-and-answer (QA) format, with a total of 90,000 dialogue data; second, 1,500 market supervision-related questions, based on the relevant laws and descriptions of the available tool library, manually annotate the best execution plan label to answer the question, and use this as the final fine-tuning label data. This embodiment uses the Low-Rank Adaptation (LoRA) method to supervise the fine-tuning of the Tsinghua glm-4-9b-chat base model, and the key parameters are set as: epochs=5, learning_rate=5e-4, rank=0.1, lora_alpha=32, lora_dropout=0.1. The fine-tuning process was completed on two A6000 GPUs, which significantly reduced the computing cost while ensuring the model performance. Finally, a task analysis-specific model was obtained that can generate structured execution plans based on relevant laws and tool libraries.
[0026] S106: When the legal dialogue system receives a legal question input by the user, it first uses the Chinese embedding model bge-large-zh-v1.5 to encode the question's embedding, calculates the cosine similarity between the user's question and the vector embedding in the S102 legal knowledge base, and accurately selects the top-k (k=1) legal provisions that are most relevant to the current question from the knowledge base.
[0027] S107: The legal provisions retrieved in S106 and the user questions are inputted into the task analysis-specific model fine-tuned in S105. The task analysis-specific model performs an in-depth analysis on the user questions and generates a structured execution plan including reasoning steps and tool calling solutions.
[0028] S108: Use the Zero-Shot Chain-of-Thought technology to gradually parse the labels of the execution plan, and combine it with the original question to decompose the complex task into multiple simple steps that progress layer by layer, and finally form a thought chain prompt word to solve the problem, laying the foundation for generating accurate, rigorous and legally logical dialogue answers.
[0029] S109: Tsinghua glm-4-9b-chat base large language model is used as the content generation large language model. The final question prompt words containing the execution plan in S108 are input into the content generation large language model. The model can understand the reasoning process of the thinking chain in the prompt words, and endow the large language model with automatic tool calling capabilities through agent technology. The return results of the tool function will be input into the large language model again for multiple rounds of dialogue, which are used to supplement and improve the model's answers. Each round of dialogue focuses on a specific task or sub-problem in the execution plan, and finally generates high-quality dialogue content that meets the legal rigor and accuracy requirements.
[0030] See also Figure 2 , assuming that the entire multi-model collaborative reasoning legal consulting system has been built according to the above process, take the user input "A certain administrative license of a company expires on November 30, 2020. On which day at the latest can the company apply for renewal to the department that made the administrative license decision?" as an example. The dialogue generation process of the legal consulting system is as follows: S201: Obtaining consultation questions input by the user.
[0031] S202: First, the question is input into the bge-large-zh-v1.5 encoding model to obtain a vector representation of the question.
[0032] S203: milvus knowledge base performs familiarity search and matches the top-K legal provisions. The example retrieves "Article 27 of the Interim Provisions on Administrative Licensing Procedures for Market Supervision and Administration" through knowledge base similarity, and splices it into the following format of prompt words: "Known legal provision information: [retrieved legal provision]; Available external tool library: [external tool library description]; Current question: [user question]; You are a professional legal consulting practitioner, and your task is to think of a detailed implementation plan that can answer the above questions based on the legal provision information and available external tools."
[0033] S204: The prompt words after splicing in S203 are input into the task analysis dedicated model. The model deeply analyzes the problem based on relevant laws and available external tool libraries, and generates a structured execution plan containing reasoning steps and tool calling schemes. The execution plan generated by the example is [Step 1: Combine the laws, simplify the problem, and calculate which day is thirty natural days before November 30, 2020; Step 2: Call the tool function that reverses the start date based on the end date and the number of days; Step 3: Combine the function results and relevant laws to answer the question;] S205: Combine the original question with the labels of the execution plan that are parsed step by step, break down the complex task into multiple simple steps that progress layer by layer, and piece them together into prompts in the following format: "Current question: [user question]; Known legal information: [retrieved legal information]; Execution plan: [S204's execution plan], you are a professional legal consultant, in order to answer the above questions, please refer to the execution plan and think about it in multiple steps, reasoning step by step to solve the problem."
[0034] S206: The prompt words after S205 are concatenated are input to the content to generate a large language model, and multiple rounds of dialogue are started. The legal dialogue model is based on the intelligent agent technology and analyzes whether the current step needs to call an external tool function. If it needs to be called, go to S207, otherwise go to S209.
[0035] S207: The large language model gives the name of the external tool function, extracts the input parameters of the corresponding function, and calls the external tool function based on the agent technology. The calculate_start_date (reverse the start date based on the end date and number of days) function in the external tool library called in the example extracts the function input parameters (end date: November 30, 2020, duration: 30) to get the function running result.
[0036] S208: The content generation large language model combines the legal provisions of S203 and the function results of S207 to generate a dialogue answer for the current round.
[0037] S209: The content generation large language model combines the legal provisions of S203 to directly generate the answer to the current round of dialogue.
[0038] S210: Determine whether the multi-round dialogue in the execution plan is finished. If not, proceed to S211; if yes, proceed to S212.
[0039] S211: Take the answer of S208 or S209 as the historical dialogue, conduct multiple rounds of dialogue, and enter S206; S212: Integrate the elements of the complete dialogue process, including user questions, retrieved legal details, tool function call status, and the final generated consultation dialogue content. Finally, print out the entire dialogue content and end the dialogue process. See also Figure 3 , the overall architecture of the legal consulting system with multi-model collaborative reasoning constructed by the present invention is described as follows: System input: The original consultation question entered by the user.
[0040] Execution plan stage: The task analysis model conducts in-depth analysis of user questions based on the retrieved relevant laws and available external tool libraries, and generates a structured execution plan that includes reasoning steps and tool calling solutions. Prompt word engineering: Use zero-sample thinking chain technology to analyze the structured execution plan, integrate the original problem, corresponding laws and regulations, and the execution plan into a structured final prompt word.
[0041] In the round-by-round dialogue stage: the final prompt word is input into the content to generate a large language model, and the model is guided to conduct multi-round dialogue reasoning; the model understands the sequence of steps in the execution plan, uses the intelligent agent technology to autonomously call the corresponding external tools, and integrates the relevant legal content and the calculation results of the external tools to generate professional answers that meet the requirements of legal rigor.
[0042] System output: the final consultation answer content of the round-robin dialogue.
[0043] The above description is only a preferred embodiment of the present invention, which is only illustrative and not restrictive of the present invention. Those skilled in the art understand that many changes and modifications can be made within the spirit and scope defined by the claims, but they will all fall within the scope of protection of the present invention.
Claims
1. A method for constructing a legal consulting system based on multi-model collaborative reasoning, characterized in that: include: S1: Collect the latest legal codes from public legal databases, perform standardized data cleaning, and annotate metadata information to obtain a structured data set suitable for legal text retrieval; S2: Use the encoder model to convert the legal provisions processed in S1 into low-dimensional dense vectors, establish a vector indexing mechanism, build a legal provision vector retrieval knowledge base, and achieve fast and accurate legal provision retrieval; S3: Build an automatic update tool for legal provisions, use crawler technology to regularly track legislative revisions, and automatically complete the update and replacement of the legal provisions knowledge base in S2, always ensuring the timeliness and accuracy of the legal provisions in the knowledge base; S4: Design a date calculation tool library for legal scenarios, access the calendar to query holiday information; function types include basic mathematical calculations, date difference calculations, working day calculations and time calculations, and accurately define the functional boundaries and calling specifications of each function in the tool library; S5: Combine the tool function library information defined in S4 with the collected legal question-answering data to construct a fine-tuning dataset containing real legal question-answering examples and manually annotated execution plans. Use a combination of prompt word engineering and supervised fine-tuning to fine-tune the base large language model to obtain a task analysis-specific model that can generate structured execution plans. S6: Obtain the consulting question input by the user, use the search enhancement generation technology to retrieve the top-k legal provisions with the highest similarity from the legal provision knowledge base updated in S3, and splice them with the user's question; S7: The user question concatenated in S6 and the retrieved legal provisions with the highest similarity are used as input to enter the first stage of the two-stage reasoning mechanism; the task analysis dedicated model conducts an in-depth analysis of the user question based on the retrieved relevant legal provisions and the available external tool library, and generates a structured execution plan including reasoning steps and tool calling solutions; S8: using the zero-sample thinking chain technology to analyze the structured execution plan obtained in S7, integrating the original question, the corresponding legal provisions and the execution plan into a structured final prompt word; S9: Enter the second stage of the two-stage reasoning mechanism; use the base large language model as the content generation large language model, input the final prompt word obtained in S8 into the content generation large language model, and guide the model to perform multi-round dialogue reasoning; The model understands the sequence of steps in the execution plan, uses intelligent agent technology to autonomously call the corresponding external tools, and integrates the relevant legal content and the calculation results of external tools to generate professional answers that meet the requirements of legal rigor.
2. The method for constructing a legal consulting system according to claim 1, characterized in that: The step S5 specifically includes: Firstly, the defined tool library information is combined with the collected legal question and answer data to construct a fine-tuning dataset containing real legal question and answer examples and manually annotated execution plans. During fine-tuning, user questions, corresponding laws and tool library descriptions are used as input information, and the base large language model is fine-tuned in a supervised manner by combining prompt word engineering with low-rank adaptive LoRA fine-tuning. Prompt word engineering aims to guide the model to conduct a step-by-step analysis on how to answer current legal issues based on the callable tool library resources. LoRA fine-tuning technology inserts an adapter module into the base large language model and only adjusts a small number of parameters of the adapter module, thereby achieving model fine-tuning while keeping the original parameters of the model unchanged. Finally, after the fine-tuning is completed, a task analysis-specific model is obtained that can generate structured execution plans based on corresponding laws and callable tool library.
3. The method for constructing a legal consulting system according to claim 1 or 2, characterized in that: The construction includes a fine-tuning dataset containing real legal question and answer examples and manually annotated execution plans, specifically including: In view of specific application scenarios in the legal field, the fine-tuning dataset covers two types of data: first, a large number of general legal question-and-answer dialogues are refined and converted into question-and-answer (QA) data in JSON format, aiming to enable the large language model to effectively understand the general answer methods for common legal issues; second, legal issues and corresponding legal knowledge in a specific task scenario are collected, and legal experts manually label each question based on the defined tool function library information to generate the best execution plan label for solving the problem, which is used as the label data for fine-tuning.
4. The method for constructing a legal consulting system according to claim 1 is characterized in that the step S7 of generating a structured execution plan including reasoning steps and tool calling schemes specifically includes: (1) Ordered sequence of steps: indicates the order in which specific steps need to be executed or which tool function libraries need to be called; (2) Required parameters of the step: indicates the parameter name required to execute the step and the actual data of the corresponding parameters; (3) Reason for executing a step: Indicates the logical reason and significance of executing the step in the process of solving the problem.
5. The method for constructing a legal consulting system according to claim 1, characterized in that: Step S8 uses zero-sample thinking chain technology to analyze the structured execution plan obtained, specifically including: first, based on the reasoning steps and tool calling schemes in the execution plan, decomposing complex legal issues into sub-task sequences with logical progressive relationships; then, multi-dimensional semantic fusion of the original problem description, the retrieved relevant legal information and the decomposed sub-task sequence.
Citation Information
Patent Citations
Book knowledge question-answering method based on knowledge graph enhanced large language model
CN117891930A
Training method for improving accuracy of large language model in answering legal compliance questions
CN118152628A
Large language model reliable legal question and answer generation method based on knowledge fine tuning
CN118210891A
Multi-modal product service application method, system, equipment and medium
CN119169430A
Task scale scheduling method and device based on large model
CN119201392A
Cited By
Intelligent question answering method and device based on domain knowledge lightweight fine tuning and cross-domain dynamic knowledge base and readable storage medium thereof
CN120296110A
Knowledge base question and answer method and system based on large language model agent
CN120492598A
A knowledge base question answering method and system based on large language model intelligent agent
CN120492598B
Law and regulation question answering system and method based on industry large model
CN120633839A
Education system based on generative artificial intelligence and knowledge tracking
CN120875223A