Simulation court implementation method and device based on intelligent agent, equipment and medium
Through the method of agile mocking court, using pre-configured knowledge base and role parameters, the agent determines the process unit in the mocking court and generates speech content, solving the problem of not being able to gather all roles for mocking courts, and achieving efficient simulation Court environment.
Patent Information
- Application Number
- CN202411189198.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-28
AI Technical Summary
In reality, it is impossible to gather all the roles to complete the mock court trial process, resulting in the inability to effectively simulate the real court environment.
Through the method of implementing the court simulation of the agent, the court rules knowledge base, case knowledge base and legal knowledge base are preconfigured. Combined with the role simulation parameters, the agent determines the current process unit in the mock court and generates the conformity based on the semantic understanding of the above dialogue. The speech content of the speech intention realizes the role of the agent in the simulated court.
It is realized that in the absence of real roles, the agent can realistically simulate the court process, reduce the randomness and hallucination problems of the large language model, and improve the accuracy and controllability of the mock court.
Smart Images

Figure CN119168059A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for realizing a simulated court based on an intelligent agent. Background Art
[0002] With the rise of artificial intelligence, artificial intelligence products have gradually entered people's lives and brought great convenience to people.
[0003] The court is an extremely serious place. Once an irreversible mistake occurs in court, the impact will be significant. Therefore, whether it is the judge, lawyer or plaintiff / defendant, it is very important for them to simulate the real court before the formal trial so that they can be familiar with the trial process and make plans and adjustments in advance.
[0004] However, it is almost impossible to gather all the people needed for a trial to simulate the trial process. Summary of the invention
[0005] The present application provides an agent-based moot court implementation method, apparatus, device and medium to solve the problem that it is impossible to gather all the roles to complete a moot court in reality.
[0006] In a first aspect, the present application provides an agent-based moot court implementation method, comprising:
[0007] Obtain the trial rules knowledge base and role simulation parameters;
[0008] Identify the current process unit in which the moot court is located;
[0009] According to the current process unit, current knowledge is acquired from a case knowledge base and a legal article knowledge base;
[0010] According to the trial rule knowledge base, the role simulation parameters and the current knowledge, based on the semantic understanding of the courtroom dialogue context, determining the current speech intention of the current process unit;
[0011] According to the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context, the current speech content that conforms to the current speech intention is generated.
[0012] In a second aspect, the present application provides an agent-based moot court implementation device, comprising:
[0013] A parameter acquisition module is used to obtain the trial rule knowledge base and role simulation parameters;
[0014] A process unit determination module is used to determine the current process unit in which the moot court is located;
[0015] A knowledge acquisition module, used to acquire current knowledge from a case knowledge base and a legal article knowledge base according to the current process unit;
[0016] A speech intention determination module, used to determine the current speech intention of the current process unit based on the semantic understanding of the courtroom dialogue context according to the trial rule knowledge base, the role simulation parameters and the current knowledge;
[0017] The speech content generation module is used to generate the current speech content that conforms to the current speech intention according to the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context.
[0018] In a third aspect, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the agent-based mock court implementation method as described in any one of the embodiments of the present application.
[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the agent-based mock court implementation method as described in any of the embodiments of the present application.
[0020] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the agent-based moot court implementation method as described in any of the embodiments of the present application.
[0021] The agent-based moot court implementation method, device, equipment and medium provided in the present application pre-configures the trial rules knowledge base, case knowledge base and legal knowledge base, and defines the role parameters played by the agent through role simulation parameters, so that the agent first determines the current process unit of the moot court in each round of dialogue in the moot court, and then obtains the current knowledge from the case knowledge base and legal knowledge base according to the current process unit, and then determines the current speech intention of the current process unit based on the semantic understanding of the previous court dialogue according to the trial rules knowledge base, role simulation parameters and current knowledge, and finally generates the current speech content that conforms to the current speech intention based on the trial rules knowledge base, role simulation parameters, current knowledge and the previous court dialogue. In this way, the agent plays the role in the moot court, and real people can simulate the trial process based on one or more agents through interaction with the agents. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A flowchart of an agent-based moot court implementation method provided in an embodiment of the present application;
[0024] Figure 2 The overall architecture diagram of the agent-based moot court implementation method provided in the embodiment of the present application;
[0025] Figure 3 A flowchart of how to determine the current speech intention in the agent-based moot court implementation method provided in an embodiment of the present application;
[0026] Figure 4 A flowchart of how to determine the current speech content in the agent-based moot court implementation method provided in an embodiment of the present application;
[0027] Figure 5 A flowchart of how to determine the current process unit in the agent-based moot court implementation method provided in an embodiment of the present application;
[0028] Figure 6 A workflow diagram of the judge agent in the agent-based moot court implementation method provided in an embodiment of the present application;
[0029] Figure 7 A workflow diagram of the defendant agent in the agent-based moot court implementation method provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of an agent-based moot court implementation device provided in an embodiment of the present application;
[0031] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0032] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0033] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.
[0034] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. The purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or must use the relevant content of the solution.
[0035] Figure 1 The flowchart of a method for implementing a moot court based on an agent is provided in an embodiment of the present application. The method can be executed by a moot court implementation device based on an agent, which can be implemented in software and / or hardware, preferably configured in an electronic device equipped with an agent, such as a smart terminal, a computer device or a server. Figure 1 As shown, the method specifically includes:
[0036] S101. Obtaining a trial rule knowledge base and role simulation parameters.
[0037] S102. Determine the current process unit in which the moot court is located.
[0038] S103. According to the current process unit, current knowledge is obtained from the case knowledge base and the legal provisions knowledge base.
[0039] S104. According to the trial rules knowledge base, role simulation parameters and current knowledge, based on the semantic understanding of the previous court dialogue, determine the current speech intention of the current process unit.
[0040] S105. Generate current speech content that meets the current speech intention based on the trial rule knowledge base, role simulation parameters, current knowledge and the court dialogue context.
[0041] An AI agent is an intelligent entity that can perceive the environment, make decisions, and perform actions. The embodiment of the present application implements a moot court based on an AI agent. A moot court includes at least a judge, a plaintiff, and a defendant, and may also include roles such as lawyers or witnesses for both parties. Therefore, in the moot court of the embodiment of the present application, at least one role is played by a real person, while the remaining roles can be played by an AI agent. It should be noted that the present application does not impose any restrictions on the specific form of the electronic device equipped with an AI agent.
[0042] The trial rules knowledge base, case knowledge base and legal provisions knowledge base can be provided to the intelligent agent in advance.
[0043] The trial rules knowledge base at least includes the trial process description information, which is used to describe multiple process units in the trial process of the moot court. The trial rules knowledge base can also include the relationship and flow rules between different process units. The process description information can be generated in advance or adjusted manually. For example, the trial process can be divided into multiple first-level process units and multiple second-level process units under them. The agent completes the trial process according to the process units described in the process description information and the relationship between each process unit. Taking the agent playing the role of a judge as an example, the first-level process units described in its process description information may include "announcement of court discipline", "announcement of the opening of the court and verification of the opening personnel", "court investigation", "court inquiry", "court debate" and "announcement of closing the court", etc. Among them, the first-level process unit "court investigation" can also be set with second-level process units, including "plaintiff's claim", "defendant's argument", "plaintiff's evidence", "defendant's cross-examination", "defendant's evidence" and "plaintiff's cross-examination". Different roles require different process units, which can be configured according to needs, and will not be repeated here. By dividing the trial process of the mock court into process units of different levels, generating process description information, and forming a trial rules knowledge base to provide to the intelligent agent, it can ensure that the intelligent agent correctly controls the trial process, guides the speeches of all parties, and takes appropriate actions based on the speeches of other roles.
[0044] The case knowledge base includes information related to the current court case. The case knowledge base can be extracted by the agent from the original case files and used as the basis for subsequent speeches during the trial, such as factual information including the indictment, various evidences, and basic information of the plaintiff / defendant. For example, when the agent plays the role of a judge, it can obtain basic case facts, the focus of the plaintiff / defendant's dispute, and historical records from the original case files as the case knowledge base, so as to make accurate speeches and judgments. The agent can extract corresponding information from the original case files as the case knowledge base according to the role it plays.
[0045] The legal knowledge base includes various laws and regulations, and the intelligent agent can acquire relevant knowledge from it based on the case and the role it plays.
[0046] The role simulation parameters are used to define the legal knowledge level, language style, emotional stability, court simulation duration, and debate depth of the role played by the agent. The agent speaks according to the definition in the role simulation parameters under the overall rules of the simulated court. At the same time, the agent can also flexibly adjust its emotional state according to the real-time speech situation in the trial and the case, generating flexible, diverse and more vivid speech content, and truly simulating the speech scene of a real person.
[0047] After obtaining the trial rules knowledge base and role simulation parameters, the agent needs to first determine the current process unit of the simulated court, and then obtain the current knowledge from the case knowledge base and the legal provisions knowledge base based on the current process unit. Among them, the agent can make a decision based on the semantic understanding of the court dialogue in the current trial process, and determine the specific information that needs to be queried as the current knowledge, such as specific legal provisions, background information of both parties, and case details. Then, the target query statement can be generated first, and then obtained from the knowledge base based on the target query statement. For example, the agent can obtain the query results from the knowledge base through the process of "generating natural language query", "vector embedding", "matching slices", "assembling slices" and "generating answers", where slices refer to the smallest unit of content in the knowledge base.
[0048] Next, based on the trial rules knowledge base, role simulation parameters and current knowledge, and based on the semantic understanding of the court dialogue context, the current speech intention of the current process unit is determined, and then the current speech content that conforms to the current speech intention is generated based on the trial rules knowledge base, role simulation parameters, current knowledge and the court dialogue context. It can be seen that in the embodiment of the present application, the flow of the process unit and the generation of specific speech content are separated, and the speech intention is determined first, and then the specific speech content is generated. As a result, the randomness and hallucination problems inherent in the large language model in the intelligent agent can be greatly reduced, so as to more accurately control the process of the simulated court.
[0049] Specifically, the tasks of different process units in the court are usually different, and the content of the speech is naturally different. Therefore, the agent needs to speak according to the current process unit in each round of interaction. When the agent plays the role of a judge, the judge agent can control the process state of the court, based on the process description information in the trial rules knowledge base, and determine the current process unit according to the previous process unit and the historical speech content of each role, so that the interaction process of each role follows the court rules.
[0050] The context of court conversation refers to the speech content of each role in each process unit that has already occurred. Based on the semantic understanding of the context of court conversation, the intelligent agent determines the current speech intention of the current process unit in combination with the trial rule knowledge base, role simulation parameters and current knowledge. The speech intention of the same role in different process units can be different. Then, based on the trial rule knowledge base, role simulation parameters, current knowledge and the context of court conversation, the current speech content that conforms to the current speech intention can be generated. The semantic understanding of the context of court conversation, the determination of speech intention and speech content can all be performed by the large language model.
[0051] When the intelligent agent plays the role of a judge, its speech intentions include at least: informing rights and obligations; allocating speaking rights; clarifying facts; confirming speech content; intervening in speech content that deviates from the trial order; and preventing other roles' speech content from diverging.
[0052] For example, when the agent plays the role of a judge, in the "court investigation" process unit, the judge asks: "Plaintiff, do you have any additional evidence?" The plaintiff answers: "No." The semantic understanding result at this time is "The plaintiff has no evidence to add", but based on the trial rule knowledge base, it is necessary to ask the defendant whether he has any additional evidence, so it is necessary to continue to stay in the current process unit, and determine that the speech intention is to allocate the right to speak, and continue to ask the defendant. In this example, if the plaintiff answers: "No. But I want to express a different opinion from the defendant's opinion just now", at this time, according to the semantic understanding result, it is confirmed that the plaintiff's speech may be out of the task of the current process, so it can be confirmed that the current speech intention is to take back the plaintiff's right to speak and continue to allocate the right to speak to the defendant, then the generated speech content can be: "Plaintiff, now is not the debate session. Defendant, do you have any additional evidence?"
[0053] For another example, in the second-level process unit "Plaintiff's Claim" under the first-level process unit "Court Investigation", if the plaintiff's speech is too repetitive, it is determined to stay in the current process unit. At the same time, the current speech intention is to prevent the plaintiff's speech from diverging. The generated speech content can be: "Plaintiff, this point has been made. This court will give you another 30 seconds to make your statement. If there is no new opinion, the court will proceed to the next stage of the procedure."
[0054] For another example, if the content of the plaintiff or defendant's statement is unclear, it is still determined to stay in the current process unit, and the intention of the speech is to confirm the content of the speech, then the generated speech content can be: "Please confirm that your opinion is..." etc.
[0055] In short, according to the trial rules, each process unit has a corresponding task. The intelligent agent needs to determine the speech intention for the current process unit based on the knowledge base, role simulation parameters and the semantic understanding results of the previous court dialogue until the tasks of all process units in the process description information are completed.
[0056] The technical solution of the embodiment of the present application pre-configures the trial rules knowledge base, the case knowledge base and the legal knowledge base, and defines the role parameters played by the agent through the role simulation parameters, so that the agent first determines the current process unit of the mock court in each round of dialogue in the mock court, and then obtains the current knowledge from the case knowledge base and the legal knowledge base according to the current process unit, and then determines the current speech intention of the current process unit based on the semantic understanding of the court dialogue context according to the trial rules knowledge base, the role simulation parameters and the current knowledge, and finally generates the current speech content that conforms to the current speech intention according to the trial rules knowledge base, the role simulation parameters, the current knowledge and the court dialogue context. Thus, the role-playing of the agent in the mock court is realized, and the real person can simulate the trial process based on one or more agents through interaction with the agent, and the interaction method includes text or voice. At the same time, in the embodiment of the present application, the flow of the process unit and the generation of specific speech content are separated, and the speech intention is determined first, and then the specific speech content is generated, thereby greatly reducing the randomness and hallucination problems inherent in the large language model in the agent, so as to more accurately control the process of the mock court.
[0057] In one embodiment, the method of the embodiment of the present application may also include: following the speech content of each role in the mock court, determining whether it is necessary to display evidence materials corresponding to the speech content; if so, obtaining and displaying the evidence materials from the case knowledge base and the legal provisions knowledge base.
[0058] Specifically, the speech of each character can be captured in real time based on voice technology, and the corresponding text information can be determined through voice recognition, and then the semantic understanding technology can be used to determine whether the content expressed in the text involves evidence information, which can be in the form of text, pictures, audio or video. If evidence information is involved, it is automatically retrieved from the case file. For example, a screen can be pre-connected, and when the case file is displayed on the screen, a corresponding indicative mark can also be displayed, so that the display of the evidence information can be prominently displayed in conjunction with the speech information.
[0059] In one embodiment, when the intelligent agent plays the role of a judge, the method further includes: generating a current behavior mark that conforms to the current speech intention based on a trial rules knowledge base, role simulation parameters, current knowledge, and the context of the court dialogue, wherein the current behavior mark is used to record the behavior of the intelligent agent in the current process unit.
[0060] Specifically, behavior markers can be used to record the behavior of the agent in each process unit. For example, several different behavior markers can be pre-configured, such as "the judge speaks", "the plaintiff has the right to speak", and "the defendant has the right to speak". After determining the speech intention, the agent can determine the behavior marker that matches the current speech intention from a variety of behavior markers and mark it in the current process unit. Taking the scripting language as an example, the script is used to describe the various process units of the trial process and the relationship between process units at different levels. Then, the agent marks the behavior markers in the script. At the same time, the final generated speech content can also be recorded in the script, for example, "<process_unit_level1> Court investigation<process_unit_level2> Plaintiff's claim <speak>Defendant, you have already made this point. The court will give you another 30 seconds to make your statement. If you have no new opinions, the court will proceed to the next stage of the procedure.<call_defendant> ", which means that in the second-level process unit "Plaintiff's Claim" under the first-level process unit "Court Investigation", the judge said "Defendant, you have already said this point. This court will give you another 30 seconds to make your statement. If there is no new opinion, the court will proceed to the next stage of the procedure", and gave the right to speak to the defendant. Through behavior marking, the decision-making and execution of the agent in each process unit can be fully recorded, so as to make more accurate decisions on the current behavior based on the information in the previous process.
[0061] In addition, the method of the embodiment of the present application can also generate an analysis report after the moot court is over, based on the process units involved in the moot court and the behavior marks and speech content of each role in each process unit. Specifically, the performance of each party during the task completion process can be recorded during the trial, such as reaction time, emotional expression, and whether the first statement of the question hits the key points of the response. Finally, an analysis report is generated based on these performances.
[0062] Figure 2 The overall architecture diagram of the agent-based moot court implementation method provided for the embodiment of the present application. In this embodiment, the plaintiff is played by a real user, and the judge and the defendant are played by different agents. Therefore, the entire trial process is completed through the interaction between the judge agent, the plaintiff agent and the defendant agent. Among them, the judge agent is based on the case knowledge base, the rule knowledge base and the legal knowledge base. At the same time, under the set simulation parameters of the judge, the court process and the reasoning, decision-making speech intentions and speech content are controlled according to the court dialogue content of other roles. The defendant agent is based on the case knowledge base, the rule knowledge base and the legal knowledge base. Under the set simulation parameters of the defendant, each round of speech is completed according to the process control of the judge agent.
[0063] Figure 3 The flowchart of how to determine the current speech intention in the agent-based moot court implementation method provided in the embodiment of the present application is a further optimization based on the above embodiment. As shown in the figure, the method includes:
[0064] S301. Use the trial rule knowledge base and role simulation parameters as the first fixed instruction.
[0065] S302, taking the current process unit, current knowledge and the court dialogue context as the first variable instruction.
[0066] S303: Assemble the first fixed instruction and the first variable instruction into a first instruction and input the first instruction into a large language model, and use the large language model to output the current speech intention.
[0067] The embodiment of the present application uses a large language model to determine speech intention. A large language model refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. The agent first generates instructions, then inputs the instructions into the large language model, and uses the understanding ability of the large language model to output the speech intention.
[0068] The instructions include fixed instructions and variable instructions. Specifically, the agent uses the trial rules knowledge base and role simulation parameters as the first fixed instruction, the current process unit, the current knowledge and the court dialogue as the first variable instruction, assembles the first fixed instruction and the first variable instruction into the first instruction and inputs it into the large language model, and uses the large language model to output the current speech intention. Among them, the trial rules knowledge base and the role simulation parameters belong to invariant information during a trial, that is, as fixed instructions, they need to be input to the large language model when the speech intention needs to be determined in each round of dialogue. The current process unit, the current knowledge and the court dialogue may change in each round of dialogue. In order to improve the accuracy of the large language model's understanding, they are input into the large language model as variable instructions. In this way, in each round of dialogue, the large language model can output the current speech intention according to the first fixed instruction and the first variable instruction, which makes the generated current speech intention more consistent with the current round of court dialogue in the current process unit, thereby reducing the randomness and hallucination problems inherent in the large language model in the agent and improving the accuracy of each round of speech.
[0069] Figure 4 The flowchart of how to determine the current speech content in the agent-based moot court implementation method provided in the embodiment of the present application is a further optimization based on the above embodiment. As shown in the figure, the method includes:
[0070] S401. Use the trial rule knowledge base and role simulation parameters as the second fixed instruction.
[0071] S402, taking the current process unit, current knowledge, the previous court dialogue and the current speech intention as the second variable instruction.
[0072] S403: Assemble the second fixed instruction and the second variable instruction into a second instruction and input it into the large language model, and use the large language model to output the current speech content.
[0073] Similarly, when determining the content of the speech, the second instruction is also divided into a second fixed instruction and a second variable instruction. The large language model obtains information from the trial rules knowledge base and role simulation parameters through the second fixed instruction, and obtains information about the current process unit, current knowledge, the context of the court dialogue and the current speech intention through the second variable instruction, and then outputs the current speech content based on the understanding ability of the large language model.
[0074] Figure 5 The flowchart of how to determine the current process unit in the agent-based moot court implementation method provided in the embodiment of the present application is a further optimization based on the above embodiment. As shown in the figure, the method includes:
[0075] S501. According to the previous process unit, target knowledge is obtained from the case knowledge base and the legal provisions knowledge base.
[0076] S502, determining the current process unit according to the trial rule knowledge base, role simulation parameters, target knowledge, the previous process unit and the court dialogue context.
[0077] When the intelligent agent plays the role of a judge, the judge agent needs to determine the current process unit in each round of speaking, so as to determine the intention and content of the speech according to the current process unit, that is, the judge agent controls the trial process.
[0078] Specifically, the intelligent agent obtains target knowledge from the case knowledge base and the legal provisions knowledge base based on the previous process unit. The target knowledge can be the specific information that needs to be queried from the knowledge base based on the intelligent agent's semantic understanding of the context of the court dialogue in the previous process unit, and then determines the current process unit based on the trial rules knowledge base, role simulation parameters, target knowledge, the previous process unit and the context of the court dialogue.
[0079] In one embodiment, determining the current process unit according to the court trial rule knowledge base, role simulation parameters, target knowledge, the previous process unit and the court dialogue context includes:
[0080] The trial rules knowledge base and role simulation parameters are used as the third fixed instruction;
[0081] The target knowledge, the previous process unit and the court dialogue above are used as the third variable instruction;
[0082] The third fixed instruction and the third variable instruction are assembled into a third instruction and input into the large language model, and the current process unit is output using the large language model.
[0083] That is, when determining the current process unit, the third instruction is also divided into a third fixed instruction and a third variable instruction. The large language model obtains information in the trial rules knowledge base and role simulation parameters through the third fixed instruction, and obtains target knowledge, the previous process unit and the context of the court dialogue through the third variable instruction. Then, based on the understanding ability of the large language model, it is determined whether the task of the previous process unit is completed, and whether the current process unit should continue to stay in the previous process unit or enter the next process unit.
[0084] Furthermore, the stay time and the number of dialogue rounds of the previous process unit can also be used as the third variable instruction. When the stay time of the same process unit is too long, or the number of dialogue rounds is too many, both exceeding the threshold, it can be timely switched to a new process unit based on the task completion status of the current process unit to ensure the smooth progress of the trial process.
[0085] Figure 6 The workflow diagram of the judge agent in the agent-based moot court implementation method provided in the embodiment of the present application is a further optimization based on the above embodiment. In this embodiment, the agent plays the role of the judge. In each speech round, the judge agent must go through three steps: determining the current process unit, determining the judge's speech intention, and generating the judge's speech content and instruction mark. At each step, the judge agent must assemble the court dialogue context, various knowledge bases and setting data into instructions for input to the large language model according to the process status, including fixed instructions and variable instructions.
[0086] The figure shows the reasoning process of a judge agent in a speech round. The first step is to determine the current process unit. Among them, the trial rule knowledge base and role simulation parameters are used as fixed instructions, and the process unit in the previous step, the target knowledge in the case knowledge base and the legal knowledge base, and the court dialogue text are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the current process unit. The second step is to determine the judge's speech intention. Among them, the trial rule knowledge base and role simulation parameters are still used as fixed instructions, and the current process unit, the current knowledge obtained from the case knowledge base and the legal knowledge base, and the court dialogue text are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the judge's speech intention. The third step is to determine the judge's speech content and behavior mark. Among them, the trial rule knowledge base and role simulation parameters are still used as fixed instructions, and the current process unit, current knowledge, court dialogue text, and current speech intention are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the judge's speech content and behavior mark.
[0087] Figure 7 The workflow diagram of the defendant agent in the agent-based moot court implementation method provided in the embodiment of the present application is a further optimization based on the above embodiment. In this embodiment, the agent plays the role of the defendant. Unlike the judge agent, the defendant agent cannot change the court process state, but only determines the speech intention and speech content according to the current process unit.
[0088] The figure shows the reasoning process of the defendant Agent in a speaking round. The first step is to determine the defendant's speech intention. Among them, the trial rules knowledge base and role simulation parameters are used as fixed instructions, the current process unit, the current knowledge obtained from the case knowledge base and the legal knowledge base, and the previous court dialogue are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the defendant's speech intention. The second step is to determine the content of the defendant's speech. Among them, the trial rules knowledge base and role simulation parameters are still used as fixed instructions, and the current process unit, current knowledge, the previous court dialogue, and the current speech intention are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the defendant's speech content.
[0089] From the above, it can be seen that the technical solution of the embodiment of the present application can not only play the role of judge through the intelligent agent, but also realize the entire trial process of the mock court through the interaction between real users and at least one intelligent agent. At the same time, in the embodiment of the present application, the flow of process units and the generation of specific speech content are separated, and the speech intention is determined first, and then the specific speech content is generated. In the three links of determining the current process unit, speech intention and speech content, the intelligent agent constructs fixed instructions and corresponding variable instructions to input into the large language model, and the large language model completes the tasks of the corresponding links. In this way, the randomness and hallucination problems inherent in the large language model in the intelligent agent can be greatly reduced, so as to more accurately control the process of the mock court and generate more accurate speech content.
[0090] Next, we give examples of the main tasks that the agent needs to complete to play the role of judge:
[0091] 1. Promote different task nodes according to the trial process, such as:
[0092] The judge says: The court is now in session. Check the parties present; or
[0093] The judge said: The court investigation is over, and now the court debate will begin.
[0094] 2. Allocate speaking rights based on the content of the speech. If the judge and one party continue to:
[0095] The judge said: Defendant, have you received a copy of the indictment?
[0096] The defendant said: Got it.
[0097] The judge said: Have you submitted a written reply?
[0098] The defendant said: No, I will make an oral defense.
[0099] The judge said: The defendant will now make an oral response.
[0100] 3. According to the case, summarize the focus of the dispute, and combine the built-in trial idea knowledge base to question both parties until the preset fact-finding script task is completed, such as:
[0101] The judge said: Plaintiff, how much do you use to calculate the penalty interest?
[0102] The plaintiff said: The penalty interest is calculated by increasing the 9.6% by 50%.
[0103] The judge said: Is there a clear contractual agreement?
[0104] The plaintiff said: Article XX of the loan contract stipulates that if the defendant fails to repay the principal as agreed in the contract, the plaintiff has the right to charge penalty interest based on the actual number of days and the loan interest rate applicable to this contract at that time plus 50%.
[0105] The judge said: Plaintiff, what is the contractual basis for your claim that penalty interest and unpaid interest should be charged on the entire principal starting from XX date?
[0106] The plaintiff said: According to Article XX of the contract, if the defendant breaches the contract, the plaintiff has the right to declare that all loans under this contract are due immediately and require the defendant to repay the debt.
[0107] 4. Intervene when the content of the speech deviates from the order of the trial, such as:
[0108] The defendant said: You are not smart.
[0109] The judge said: Defendant, please be careful about the content of your speech and do not use obscene, sarcastic, mocking or other personally offensive or derogatory language.
[0110] The defendant said: You are so stupid.
[0111] The judge said: Defendant, please pay attention to the content of your speech. If you continue to speak in an uncivilized manner, this court will adjourn and give you time to cool down.
[0112] 5. A summary of the opinions expressed by both parties to prevent the plaintiff / defendant's discussion from being too divergent, such as:
[0113] (1) The defendant said: balabala~
[0114] The judge said: Defendant, you have already made this point. The court will give you another 30 seconds to make your statement. If you have no new opinions, the court will proceed to the next stage of the procedure.
[0115] (2) The judge said: The court investigation is over. Based on the court investigation just conducted, the collegial panel determined that the focus of the dispute in this case is: 1. What is the specific amount of principal, interest, penalty interest, and compound interest owed by the plaintiff that the defendant should repay? Do the parties have any objections or additions to the above-mentioned focus of the dispute summarized by this court?
[0116] The plaintiff said: No objection, no addition.
[0117] The defendant said: No objection, no addition.
[0118] Figure 8 The following is a schematic diagram of a structure of a simulated court implementation device based on an intelligent agent provided in an embodiment of the present application. Figure 8 As shown, the device 80 includes:
[0119] Parameter acquisition module 801, used to acquire the trial rule knowledge base and role simulation parameters;
[0120] A process unit determination module 802 is used to determine the current process unit in which the moot court is located;
[0121] The knowledge acquisition module 803 is used to acquire current knowledge from the case knowledge base and the legal provisions knowledge base according to the current process unit;
[0122] A speech intention determination module 804 is used to determine the current speech intention of the current process unit based on the semantic understanding of the courtroom dialogue context according to the trial rule knowledge base, the role simulation parameters and the current knowledge;
[0123] The speech content generation module 805 is used to generate the current speech content that meets the current speech intention based on the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context.
[0124] Exemplarily, the speech intention determination module 804 includes:
[0125] A first fixed instruction acquisition unit, configured to use the trial rule knowledge base and the role simulation parameters as a first fixed instruction;
[0126] A first variable instruction acquisition unit, used for taking the current process unit, the current knowledge and the court dialogue context as a first variable instruction;
[0127] The first instruction assembling unit is used to assemble the first fixed instruction and the first variable instruction into a first instruction and input it into a large language model, and use the large language model to output the current speech intention.
[0128] Exemplarily, the speech content generating module 805 includes:
[0129] A second fixed instruction acquisition unit, configured to use the trial rule knowledge base and the role simulation parameters as a second fixed instruction;
[0130] A second variable instruction acquisition unit, used for taking the current process unit, the current knowledge, the court dialogue context and the current speech intention as a second variable instruction;
[0131] The second instruction assembling unit is used to assemble the second fixed instruction and the second variable instruction into a second instruction and input it into a large language model, and use the large language model to output the current speech content.
[0132] Exemplarily, the process unit determination module 802 includes:
[0133] A target knowledge acquisition unit, used for acquiring target knowledge from the case knowledge base and the legal provisions knowledge base according to the previous process unit when the intelligent agent plays the role of a judge;
[0134] The current process unit determination unit is used to determine the current process unit according to the trial rule knowledge base, the role simulation parameters, the target knowledge, the previous process unit and the above text of the court dialogue.
[0135] Exemplarily, the current process unit determination unit includes:
[0136] A third fixed instruction acquisition subunit, used to use the trial rule knowledge base and the role simulation parameters as a third fixed instruction;
[0137] A third variable instruction acquisition subunit is used to take the target knowledge, the previous process unit and the court dialogue text as a third variable instruction;
[0138] The third instruction assembling subunit is used to assemble the third fixed instruction and the third variable instruction into a third instruction and input it into the large language model, and use the large language model to output the current process unit.
[0139] Exemplarily, the device further includes a behavior mark generation module, and the behavior mark generation module is specifically used to:
[0140] When the agent plays the role of a judge, a current behavior mark that conforms to the current speech intention is generated according to the trial rule knowledge base, the role simulation parameters, the current knowledge and the context of the court dialogue, wherein the current behavior mark is used to record the behavior of the agent in the current process unit.
[0141] Exemplarily, the role simulation parameters are used to define the legal knowledge level, language style, emotional stability, court simulation duration and debate depth of the role played by the intelligent agent.
[0142] Exemplarily, the device further includes an evidence material display module, and the evidence material display module is specifically used to:
[0143] Following the speeches of the characters in the mock court, determine whether it is necessary to present evidence materials corresponding to the speeches;
[0144] If so, the evidence information is obtained and displayed from the case knowledge base and the law knowledge base.
[0145] Exemplarily, it is characterized in that the device further comprises an analysis report generating module, and the analysis report generating module is specifically used for:
[0146] After the moot court is over, an analysis report is generated based on the process units involved in the moot court and the behavior marks and speech content of each role in each process unit.
[0147] Exemplarily, when the agent plays the role of a judge, the speech intention includes at least:
[0148] Inform rights and obligations; allocate speaking rights; clarify facts; confirm speech content; intervene in speeches that deviate from the trial order; prevent other roles’ speeches from diverging.
[0149] The agent-based moot court implementation device provided in the embodiment of the present application can be used to execute the technical solution of the agent-based moot court implementation method in the above-mentioned embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0150] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the speech intention determination module 804 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above speech intention determination module 804. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the hardware integrated logic circuit in the processor element or the instructions in the form of software.
[0151] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .
[0152] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0153] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.
[0154] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.
[0155] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0156] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0157] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the above-mentioned embodiment's method for implementing a mock court based on an intelligent agent.
[0158] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the agent-based mock court implementation method in the above embodiment.
[0159] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present application, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0160] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.< / speak>
Claims
1. A method for implementing a moot court based on an agent, characterized in that: include: Obtain the trial rules knowledge base and role simulation parameters; Identify the current process unit in which the moot court is located; According to the current process unit, current knowledge is acquired from a case knowledge base and a legal article knowledge base; According to the trial rule knowledge base, the role simulation parameters and the current knowledge, based on the semantic understanding of the courtroom dialogue context, determining the current speech intention of the current process unit; According to the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context, the current speech content that conforms to the current speech intention is generated.
2. The method according to claim 1, characterized in that The determining of the current speech intention of the current process unit based on the semantic understanding of the courtroom dialogue context according to the courtroom rule knowledge base, the role simulation parameters and the current knowledge includes: Using the trial rule knowledge base and the role simulation parameters as the first fixed instruction; Taking the current process unit, the current knowledge and the court dialogue context as the first variable instruction; The first fixed instruction and the first variable instruction are assembled into a first instruction and input into a large language model, and the current speech intention is output using the large language model.
3. The method according to claim 1, characterized in that The generating of the current speech content that meets the current speech intention according to the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context includes: Using the trial rule knowledge base and the role simulation parameters as a second fixed instruction; Taking the current process unit, the current knowledge, the court dialogue context and the current speech intention as the second variable instruction; The second fixed instruction and the second variable instruction are assembled into a second instruction and input into a large language model, and the current speech content is output using the large language model.
4. The method according to claim 1, characterized in that: When the agent plays the role of a judge, the current process unit of determining the moot court includes: According to the previous process unit, target knowledge is acquired from the case knowledge base and the legal provisions knowledge base; The current process unit is determined according to the trial rule knowledge base, the role simulation parameters, the target knowledge, the previous process unit and the above text of the court dialogue.
5. The method according to claim 4, characterized in that The determining of the current process unit according to the trial rule knowledge base, the role simulation parameters, the target knowledge, the previous process unit and the court dialogue context includes: Using the trial rule knowledge base and the role simulation parameters as a third fixed instruction; The target knowledge, the previous process unit and the previous text of the court dialogue are used as the third variable instruction; The third fixed instruction and the third variable instruction are assembled into a third instruction and input into a large language model, and the current process unit is output using the large language model.
6. The method according to claim 1, characterized in that When the agent plays the role of a judge, the method further includes: According to the trial rule knowledge base, the role simulation parameters, the current knowledge and the context of the court dialogue, a current behavior mark that conforms to the current speech intention is generated, wherein the current behavior mark is used to record the behavior of the intelligent agent in the current process unit.
7. The method according to claim 1, characterized in that The role simulation parameters are used to define the legal knowledge level, language style, emotional stability, court simulation duration and debate depth of the role played by the intelligent agent.
8. The method according to claim 1, characterized in that Also includes: Following the speeches of the characters in the mock court, determine whether it is necessary to present evidence materials corresponding to the speeches; If so, the evidence information is obtained and displayed from the case knowledge base and the law knowledge base.
9. The method according to claim 6, characterized in that Also includes: After the moot court is over, an analysis report is generated based on the process units involved in the moot court and the behavior marks and speech content of each role in each process unit.
10. The method according to claim 1, characterized in that When the agent plays the role of a judge, the speaking intention includes at least: Inform rights and obligations; allocate speaking rights; clarify facts; confirm speech content; intervene in speeches that deviate from the trial order; prevent other roles’ speeches from diverging.
11. A moot court implementation device based on an intelligent agent, characterized in that: include: A parameter acquisition module is used to obtain the trial rule knowledge base and role simulation parameters; A process unit determination module is used to determine the current process unit in which the moot court is located; A knowledge acquisition module, used to acquire current knowledge from a case knowledge base and a legal article knowledge base according to the current process unit; A speech intention determination module, used to determine the current speech intention of the current process unit based on the semantic understanding of the courtroom dialogue context according to the trial rule knowledge base, the role simulation parameters and the current knowledge; The speech content generation module is used to generate the current speech content that conforms to the current speech intention according to the trial rule knowledge base, the role simulation parameters, the current knowledge and the court dialogue context.
12. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the agent-based moot court implementation method as described in any one of claims 1-10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the agent-based moot court implementation method as described in any one of claims 1-10.
14. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the agent-based moot court implementation method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Court trial method and device, electronic equipment and machine readable storage medium
CN111797246A
Speech generation method and device based on AI model, equipment and storage medium
CN117194626A
Dialogue data generation method, model training method and related device
CN117407501A
Instruction data optimization method and device based on multi-agent debate, electronic equipment and storage medium
CN117932331A
Simulated confrontation device, method, device and system based on large language model
CN118194971A
Cited By
Simulated court dialectical care scene prediction method and system
CN121353030A
A simulation method and system for predicting a courtroom defense scenario
CN121353030B
System and method for visualization and analysis of human interaction dynamics using artificial intelligence
US12718433B2
System and Method for Visualization and Analysis of Human Interaction Dynamics Using Artificial Intelligence
US20260220839A1
