Method, apparatus, device, and medium for implementing an agent-based mock court

Intelligent agents simulate courtroom scenarios by determining process units and generating dialogue, addressing the challenge of assembling all roles for realistic courtroom simulations, enhancing accuracy and reducing logistical barriers.

CN119168059BActive Publication Date: 2025-07-15BEIJING FACE WALL INTELLIGENT TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411189198.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2025-07-15
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

In reality, all roles cannot be gathered together to complete the mock court, resulting in the inability to effectively simulate the trial process.

Method used

By preconfiguring the knowledge base of trial rules, case knowledge base and legal knowledge base, using the agent to define role parameters, determine the current process unit, and generate speech content that meets the speech intention based on the semantic understanding in the above-mentioned court dialogue.

Benefits of technology

It realizes that the agent can accurately play a role in mock courts, reduces the randomness and hallucination problems of large language models, and ensures accurate control of the trial process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168059B_ABST
    Figure CN119168059B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and medium for realizing a simulated court based on an agent, which relates to the field of artificial intelligence technology. The method includes: obtaining a trial rule knowledge base and role simulation parameters; determining the current process unit where the simulated court is located; obtaining current knowledge from a case knowledge base and a legal provision knowledge base according to the current process unit; determining the current speech intention of the current process unit based on the semantic understanding of the previous text of the court dialogue according to the trial rule knowledge base, the role simulation parameters and the current knowledge; and generating 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 previous text of the court dialogue. The present application can accurately follow the trial rules based on the agent and output speech content with clear intention, so as to realize the trial process of the simulated court.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular, to a method, device, equipment and medium for realizing a mock court based on agents. 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 is significant. Therefore, it is very crucial for judges, lawyers, or plaintiffs / defendants to simulate a real court before the formal trial, so that they can familiarize themselves with the trial process and make plans and adjustments in advance.

[0004] However, it is almost impossible to gather all the people required for a trial to simulate the trial process. Summary of the Invention

[0005] This application provides a method, device, equipment and medium for realizing a mock court based on agents, to solve the problem that it is impossible to gather all roles in reality to complete the mock court.

[0006] In a first aspect, this application provides a method for realizing a mock court based on agents, including:

[0007] Obtain a trial rule knowledge base and role simulation parameters;

[0008] Determine the current process unit where the mock court is located;

[0009] According to the current process unit, obtain current knowledge from the case knowledge base and the legal provision knowledge base;

[0010] Based on the semantic understanding of the previous court dialogue, determine the current speech intention of the current process unit according to the trial rule knowledge base, the role simulation parameters, and the current knowledge;

[0011] Generate 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 previous court dialogue.

[0012] In a second aspect, this application provides a device for realizing a mock court based on agents, including:

[0013] A parameter acquisition module, configured to obtain a trial rule knowledge base and role simulation parameters;

[0014] A process unit determination module, configured to determine the current process unit where the mock court is located;

[0015] A knowledge acquisition module, configured to acquire current knowledge from a case knowledge base and a legal provision knowledge base according to the current process unit;

[0016] A speech intention determination module, configured to determine the current speech intention of the current process unit based on the semantic understanding of the previous context of the court dialogue according to the court trial rule knowledge base, the role simulation parameters, and the current knowledge;

[0017] A speech content generation module, configured to generate current speech content that conforms to the current speech intention according to the court trial rule knowledge base, the role simulation parameters, the current knowledge, and the previous context of the court dialogue.

[0018] In a third aspect, the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method for implementing an agent-based simulated court as described in any one of the embodiments of the present application is realized.

[0019] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for implementing an agent-based simulated court as described in any one of the embodiments of the present application is realized.

[0020] In a fifth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the method for implementing an agent-based simulated court as described in any one of the embodiments of the present application is realized.

[0021] The method, device, equipment, and medium for implementing an agent-based simulated court provided by the present application pre-configure a court trial rule knowledge base, a case knowledge base, and a legal provision knowledge base, and define the role parameters played by the agent through role simulation parameters, so that in each round of dialogue of the simulated court, the agent first determines the current process unit where the simulated court is located, then acquires current knowledge from the case knowledge base and the legal provision 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 context of the court dialogue according to the court trial rule knowledge base, the role simulation parameters, and the current knowledge. Finally, according to the court trial rule knowledge base, the role simulation parameters, the current knowledge, and the previous context of the court dialogue, current speech content that conforms to the current speech intention is generated. Thus, the agent's role-playing in the simulated court is realized, and a real person can simulate the court trial process based on one or more agents through interaction with the agents. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0023] Figure 1 Flowchart of a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0024] Figure 2 Overall architecture diagram of a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0025] Figure 3 Flowchart of how to determine the current speaking intention in a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0026] Figure 4 Flowchart of how to determine the current speaking content in a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0027] Figure 5 Flowchart of how to determine the current process unit in a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0028] Figure 6 Workflow diagram of the judge agent in a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0029] Figure 7 Workflow diagram of the defendant agent in a method for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0030] Figure 8 Structure diagram of a device for implementing a simulated court based on an agent provided by an embodiment of the present application;

[0031] Figure 9 Structure diagram of an electronic device provided by an embodiment of the present application.

[0032] Through the above-mentioned accompanying drawings, the clear embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and text descriptions are not intended to limit the scope of the concept 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 implementation manners

[0033] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. Additionally, it should be noted that for the sake of description, only the parts related to the present application rather than all the structures are shown in the accompanying drawings.

[0034] It should be noted that: Similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, terms such as "first", "second", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance. The acquisition, storage, use, processing, etc. of data in the technical solution of the present application all comply with the relevant regulations of national laws and regulations. It should be noted that in the embodiments of the present application, some existing solutions in the industry such as certain software, components, models, etc. may be mentioned. They should be regarded as exemplary, and their purpose is only to illustrate the feasibility in the implementation of the technical solution of the present application, but it does not mean that the applicant has already or necessarily used the relevant content of this solution.

[0035] Figure 1 The figure is a flowchart of a method for implementing a simulated court based on an agent provided for an embodiment of the present application. This method can be executed by a device for implementing a simulated court based on an agent. This device 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, etc. As Figure 1 shown, the method specifically includes:

[0036] S101. Obtain a trial rule knowledge base and role simulation parameters.

[0037] S102. Determine the current process unit where the simulated court is located.

[0038] S103. Obtain the current knowledge from the case knowledge base and the legal provision knowledge base according to the current process unit.

[0039] S104. Determine the current speech intention of the current process unit based on the semantic understanding of the previous context of the court dialogue according to the trial rule knowledge base, the role simulation parameters, and the current knowledge.

[0040] S105. 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 previous context of the court dialogue.

[0041] An AI Agent is an intelligent entity that can perceive the environment, make decisions, and execute actions. In the embodiments of this application, a mock court is implemented based on the AI Agent. The mock court includes at least a judge, a plaintiff, and a defendant, and may also include roles such as lawyers or witnesses for both prosecution and defense. Therefore, in the mock court of the embodiments of this application, at least one role is played by a real person, and the remaining roles can be played by AI Agents. It should be noted that this application does not impose any restrictions on the specific form of the electronic device carrying the AI Agent.

[0042] The trial rules knowledge base, the case knowledge base, and the legal provisions knowledge base can be provided to the AI Agent in advance.

[0043] The trial rules knowledge base includes at least the process description information of the trial, which is used to describe multiple process units in the trial process of the mock court. The trial rules knowledge base may also include the relationships and transfer rules between different process units. The process description information can be pre-generated 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 AI Agent completes the trial process according to the process units described in the process description information and the relationships between the various process units. Taking the example of the AI Agent playing the role of a judge, the first-level process units described in its process description information may include "announcing court discipline", "announcing the opening of the court and verifying the court personnel", "court investigation", "court interrogation", "court debate", and "announcing the closure of the court", etc. Among them, under the first-level process unit "court investigation", second-level process units can also be set, including "plaintiff's statement", "defendant's statement", "plaintiff's evidence presentation", "defendant's cross-examination", "defendant's evidence presentation", and "plaintiff's cross-examination", etc. The process units required for different roles are different and can be configured according to needs, which will not be elaborated here one by one. By dividing the trial process of the mock court into process units at different levels, generating the process description information, and forming the trial rules knowledge base to provide to the AI Agent, it can ensure that the AI Agent correctly controls the trial process, guides the parties to speak, and takes appropriate actions according to the speech content of other roles.

[0044] The case knowledge base includes information related to the case being heard in the current court. The case knowledge base can be extracted by the AI Agent from the original case files and used as the basis for speaking during the subsequent trial process, such as factual materials including indictments, various evidences, and the basic information of both the plaintiff and the defendant. For example, when the AI Agent plays the role of a judge, it can obtain information such as the basic facts of the case, the disputed points between the plaintiff and the defendant, and historical transcripts from the original case files as the case knowledge base to accurately speak and make judgments. The AI Agent can extract corresponding information from the original case files as the case knowledge base according to the role it plays.

[0045] The legal provision knowledge base includes various laws and regulations, and the intelligent agent can obtain relevant knowledge from it according to the case situation 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 intelligent agent. Under the overall rules of the mock court, the intelligent agent makes statements according to the definitions in the role simulation parameters. At the same time, the intelligent agent can also flexibly adjust its emotional state according to the real-time speech situation during the court trial based on the case situation, generate flexible and diverse and more vivid speech content, and truly simulate the speech scenario of real people.

[0047] After obtaining the court trial rule knowledge base and the role simulation parameters, the intelligent agent needs to first determine the current process unit where the mock court is located, and then obtain the current knowledge from the case knowledge base and the legal provision knowledge base according to the current process unit. Among them, the intelligent agent can, based on the semantic understanding of the above text of the court dialogue during the current court trial, infer and decide on the specific information to be queried as the current knowledge, such as specific legal provisions, background information of both parties, and case details, etc. Then, a target query statement can be generated first, and then the query can be obtained from the knowledge base according to the target query statement. For example, the intelligent agent can obtain the query result from the knowledge base through the process of "generating natural language query", "vector embedding", "matching slices", "assembling slices", and "generating answers", where a slice refers to the smallest unit of the content in the knowledge base.

[0048] Next, first determine the current speech intention of the current process unit based on the semantic understanding of the above text of the court dialogue according to the court trial rule knowledge base, the role simulation parameters, and the current knowledge, and then generate the current speech content that conforms to the current speech intention according to the court trial rule knowledge base, the role simulation parameters, the current knowledge, and the above text of the court dialogue. It can be seen that in the embodiment of the present application, the transfer 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. Thus, the inherent randomness and hallucination problems of the large language model in the intelligent agent can be greatly reduced, so as to more accurately control the process of the mock court.

[0049] Specifically, the tasks of different process units in the court are usually different, and the speech content is naturally also different. Therefore, the intelligent agent needs to make statements according to the current process unit in each round of interaction. When the intelligent agent plays the role of a judge, the judge Agent can control the process state of the court, and determine the current process unit based on the process description information in the court trial rule knowledge base 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 above-mentioned court dialogue refers to the speech content of each role in each process unit that has occurred. Based on the semantic understanding of the above-mentioned court dialogue, the intelligent agent, in combination with the court trial rules knowledge base, role simulation parameters, and current knowledge, determines the current speech intention of the current process unit. The speech intentions of the same role in different process units can be different. Then, according to the court trial rules knowledge base, role simulation parameters, current knowledge, and the above-mentioned court dialogue, the current speech content that conforms to the current speech intention can be generated. The semantic understanding of the above-mentioned court dialogue, the determination of the speech intention, and the speech content can all be executed by the large language model.

[0051] When the intelligent agent plays the role of the judge, the speech intentions at least include: informing rights and obligations; allocating the right to speak; clarifying facts; confirming the speech content; intervening in the speech content that deviates from the court trial order; preventing the speech content of other roles from diverging.

[0052] For example, when the intelligent agent plays the role of the judge, in the process unit of "court investigation", the judge asks: "Plaintiff, do you have any additional evidence?" The plaintiff replies: "No." At this time, the semantic understanding result is that "the plaintiff has no additional evidence", but based on the court trial rules knowledge base, it is still necessary to ask the defendant whether there is any additional evidence. Therefore, it is necessary to stay in the current process unit and determine the speech intention as allocating the right to speak and continue to ask the defendant. In this example, if the plaintiff replies: "No. But I would like to raise different opinions on the opinions just stated by the defendant", at this time, according to the semantic understanding result, it is confirmed that the plaintiff's speech may deviate from the task of the current process. Therefore, 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, this is not the debate session. Defendant, do you have any additional evidence?"

[0053] Another example is that in the secondary process unit of "plaintiff's statement" under the primary process unit of "court investigation", if the plaintiff's speech is too repetitive, at this time, it is determined to stay in the current process unit, and the current speech intention is to prevent the plaintiff's speech content from diverging. Then the generated speech content can be: "Plaintiff, this point has been mentioned before. The court will give you another 30S to state your case. If there are no new opinions, the court will proceed to the next stage of the procedure."

[0054] Another example is that if the content stated by the plaintiff or the defendant is unclear, at this time, it is still determined to stay in the current process unit, and the speech intention is to confirm the speech content. Then the generated speech content can be: "Please confirm that your view is..." etc.

[0055] In short, according to the court trial rules, each process unit has corresponding tasks. 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 result of the above-mentioned court dialogue until all the tasks of all process units in the process description information are completed.

[0056] In the technical solution of the embodiment of the present application, a trial rule knowledge base, a case knowledge base, and a legal provision knowledge base are pre-configured, and role simulation parameters are used to define the role parameters played by the intelligent agent, so that in each round of conversation in the mock court, the intelligent agent first determines the current process unit where the mock court is located, then obtains the current knowledge from the case knowledge base and the legal provision knowledge base according to the current process unit, and then based on the semantic understanding of the above text of the court conversation, determines the current speech intention of the current process unit according to the trial rule knowledge base, the role simulation parameters, and the current knowledge. Finally, according to the trial rule knowledge base, the role simulation parameters, the current knowledge, and the above text of the court conversation, generates the current speech content that conforms to the current speech intention. Thereby, the intelligent agent realizes the role-playing in the mock court, and real people can simulate the trial process through the interaction with one or more intelligent agents based on the intelligent agents. The interaction methods include text or voice. At the same time, in the embodiment of the present application, the transfer of the process unit and the generation of the specific speech content are separated, and the speech intention is determined first, and then the specific speech content is generated. Therefore, the inherent randomness and hallucination problems of the large language model in the intelligent agent can be greatly reduced, so as to more accurately control the process of the mock court.

[0057] In one implementation manner, the method of the embodiment of the present application may further include: following the speech content of each role in the mock court, and determining whether it is necessary to display the evidence materials corresponding to the speech content; if so, obtaining and displaying the evidence materials from the case knowledge base and the legal provision knowledge base.

[0058] Specifically, the speech of each role can be captured in real time based on speech technology, the corresponding text information is determined through speech recognition, and then based on semantic understanding technology, it is determined whether the content expressed by the text involves evidence materials. The form of the evidence materials can be text, pictures, audio, or video, etc. If the evidence materials are involved, they are automatically queried and obtained from the case file materials. For example, a screen can be externally connected in advance, and when the case file materials are displayed on the screen, corresponding indicative marks can also be displayed, so that the display of the evidence materials can be prominently displayed in cooperation with the speech information.

[0059] In one implementation manner, 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 according to the trial rule knowledge base, the role simulation parameters, the current knowledge, and the above text of the court conversation, where the current behavior mark is used to record the behavior of the intelligent agent in the current process unit.

[0060] Specifically, behavior tags can be used to record the behaviors made by each process unit agent. For example, several different behavior tags can be pre-configured, such as "judge's speech", "give the right of speech to the plaintiff", and "give the right of speech to the defendant", etc. After determining the speech intention, the agent can determine the behavior tag that matches the current speech intention from multiple behavior tags and annotate it on the current process unit. Taking a scripting language as an example, the various process units of the court trial process and the relationships between different-level process units are described through a script. Then, the agent annotates the behavior tags in the script. At the same time, the finally generated speech content can also be recorded in the script. For example, we get "<process_unit_level1>Court Investigation<process_unit_level2>The plaintiff alleges <speak>Defendant, you have already mentioned this point. The court will give you another 30 seconds to state your case. If there are no new opinions, the court will proceed to the next stage of the process. <call_defendant> That is to say, in the secondary process unit "Plaintiff's Allegation" under the primary process unit "Court Investigation", the judge said, "Defendant, you have already mentioned this point. The court will give you another 30 seconds to state your case. If there are no new opinions, the court will proceed to the next stage of the process." and handed the right of speech to the defendant. Through behavior marking, the decision-making and execution of the intelligent agent in each process unit can be completely recorded, so as to make decisions on the current behavior more accurately based on the information in the previous process.

[0061] In addition, after the mock court ends, the method of the embodiment of the present application can also generate an analysis report according to the process units involved in the mock court and the behavior marks and speech contents of each role in each process unit. Specifically, the performance of all parties during the task completion process during the court session can be recorded, such as reaction time, emotional expression degree, and whether the first statement of the problem hits the reply key points, etc. Finally, an analysis report is generated based on these performances.

[0062] Figure 2 It is the overall architecture diagram of the method for realizing a mock court based on intelligent agents provided by the embodiment of the present application. In this embodiment, the plaintiff is played by a real user, and the judge and the defendant are both played by different Agents. Therefore, the entire court session process is completed through the interaction between the judge Agent, the plaintiff, and the defendant Agent. Among them, the judge Agent is based on the case knowledge base, the rule knowledge base, and the legal provision knowledge base, and under the set simulation parameters of the judge, controls the court process and infers and decides the speech intention and speech content 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 provision knowledge base, and under the set simulation parameters of the defendant, completes each round of speech according to the process control of the judge Agent.

[0063] Figure 3 It is the flowchart of how to determine the current speech intention in the method for realizing a mock court based on intelligent agents provided by the embodiment of the present application. This embodiment makes further optimizations on the basis of the above embodiment. As shown in the figure, the method includes:

[0064] S301: Take the court session rule knowledge base and the role simulation parameters as the first fixed instruction.

[0065] S302: Take the current process unit, the current knowledge, and the previous court dialogue as the first variable instruction.

[0066] S303: Assemble the first fixed instruction and the first variable instruction into the first instruction and input it into the large language model, and use the large language model to output the current speech intention.

[0067] In the embodiments of this application, a large language model is used to determine the 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 an instruction, then inputs the instruction 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 takes the trial rule knowledge base and role simulation parameters as the first fixed instruction, takes the current process unit, current knowledge, and the previous 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 rule knowledge base and role simulation parameters are invariant information during a trial process, that is, as fixed instructions, they need to be input to the large language model every time the speech intention needs to be determined in each round of dialogue. The current process unit, current knowledge, and the previous court dialogue may change in each round of dialogue. To improve the accuracy of the large language model's understanding, they are input to 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 in line with the current round of court dialogue in the current process unit, thereby reducing the inherent randomness and hallucination problems in the large language model in the agent and improving the accuracy of each round of speech.

[0069] Figure 4 FIG. is a flowchart of how to determine the current speech content in the method for implementing a simulated court based on an agent provided by the embodiments of this application. This embodiment makes further optimizations on the basis of the above embodiments. As shown in the figure, the method includes:

[0070] S401. Take the trial rule knowledge base and role simulation parameters as the second fixed instruction.

[0071] S402. Take 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 the 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 speech content, the second instruction is also divided into a second fixed instruction and a second variable instruction. The large language model obtains the information in the trial rule knowledge base and role simulation parameters through the second fixed instruction, obtains the information of the current process unit, current knowledge, the previous 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 This is a flowchart showing how to determine the current process unit in the method for implementing an agent-based mock court provided by an embodiment of this application. This embodiment makes further optimizations based on the above-mentioned embodiment. As shown in the figure, the method includes:

[0075] S501. Obtain target knowledge from the case knowledge base and the legal provision knowledge base according to the previous process unit.

[0076] S502. Determine the current process unit according to the trial rule knowledge base, role simulation parameters, target knowledge, the previous process unit, and the context of the court dialogue.

[0077] When the agent plays the role of a judge, the judge Agent needs to determine the current process unit at the beginning of each round of speech, so as to determine the speech intention and speech content according to the current process unit, that is, the judge Agent controls the trial process.

[0078] Specifically, the agent obtains target knowledge from the case knowledge base and the legal provision knowledge base according to the previous process unit. This target knowledge can be specific information that the agent infers and decides to query from the knowledge base based on the semantic understanding of the context of the court dialogue in the previous process unit. Then, the current process unit is determined according to the trial rule knowledge base, role simulation parameters, target knowledge, the previous process unit, and the context of the court dialogue.

[0079] In one implementation, determining the current process unit according to the trial rule knowledge base, role simulation parameters, target knowledge, the previous process unit, and the context of the court dialogue includes:

[0080] Taking the trial rule knowledge base and role simulation parameters as the third fixed instruction;

[0081] Taking the target knowledge, the previous process unit, and the context of the court dialogue as the third variable instruction;

[0082] Assembling the third fixed instruction and the third variable instruction into a third instruction and inputting it into a large language model, and using the large language model to output the current process unit.

[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 from the trial rule knowledge base and role simulation parameters through the third fixed instruction, obtains target knowledge, the previous process unit, and the context of the court dialogue through the third variable instruction, and then determines whether the task of the previous process unit is completed based on the understanding ability of the large language model, and whether to continue staying in the previous process unit or enter the next process unit currently.

[0084] Furthermore, the residence time and the number of dialogue turns of the previous process unit can also be used as the third variable instruction. When the residence time of the same process unit is too long or the number of dialogue turns is too large, both exceeding the threshold, the process can be switched to a new process unit in a timely manner in combination with the task completion status of the current process unit to ensure the smooth progress of the court trial process.

[0085] Figure 6 This is the flowchart of the work of the judge agent in the method for realizing a virtual court based on agents provided by the embodiments of the present application. This embodiment makes further optimizations on the basis of the above embodiments. In this embodiment, the agent plays the role of the judge. In each speaking turn, the judge Agent has to go through three steps: determining the current process unit, determining the judge's speaking intention, and generating the judge's speaking content and instruction mark. In each step, the judge Agent has to assemble the court dialogue context, various knowledge bases, and set data into an instruction input to the large language model according to the process state, including fixed instructions and variable instructions.

[0086] The figure shows the inference process of the judge Agent in one speaking turn. The first step is to determine the current process unit. Among them, the court trial rule knowledge base and the role simulation parameters are used as fixed instructions, and the previous process unit, the target knowledge in the case knowledge base and the legal provision knowledge base, and the court dialogue context 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 speaking intention. Among them, the court trial rule knowledge base and the 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 provision knowledge base, and the court dialogue context 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 speaking intention. The third step is to determine the judge's speaking content and action mark for this time. Among them, the court trial rule knowledge base and the role simulation parameters are still used as fixed instructions, and the current process unit, the current knowledge, the court dialogue context, and the current speaking 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 speaking content and action mark for this time.

[0087] Figure 7 This is the flowchart of the work of the defendant agent in the method for realizing a virtual court based on agents provided by the embodiments of the present application. This embodiment makes further optimizations on the basis of the above embodiments. In this embodiment, the agent plays the role of the defendant. Different from the judge Agent, the defendant Agent cannot change the court process state, but only determines the speaking intention and speaking content according to the current process unit.

[0088] The figure shows the reasoning process of the defendant Agent in a speaking turn. The first step is to determine the defendant's speaking intention. Among them, the trial rules knowledge base and role simulation parameters are used as fixed instructions, and the current process unit, the current knowledge obtained from the case knowledge base and the legal provisions knowledge base, and the previous context of the 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 speaking intention. The second step is to determine the content of the defendant's current speech. Among them, the trial rules knowledge base and role simulation parameters are still used as fixed instructions, and the current process unit, the current knowledge, the previous context of the court dialogue, and the current speaking intention are used as variable instructions. The two are input into the large language model for processing, and the large language model outputs the content of the defendant's current speech.

[0089] As can be seen from the above, the technical solution of the embodiment of the present application can not only simulate the entire trial process of a mock court through an agent playing roles such as a judge and the interaction between a real user and at least one agent. At the same time, in the embodiment of the present application, the transfer of the process unit and the generation of specific speech content are separated, and the speaking intention is determined first, and then the specific speech content is generated. In the three links of determining the current process unit, speaking intention, and speech content, the agent constructs fixed instructions and corresponding variable instructions and inputs them into the large language model, and the large language model completes the tasks of the corresponding links. Thus, the inherent randomness and hallucination problems of the large language model in the 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, an example is given of the main tasks that an agent needs to complete when playing the role of a judge:

[0091] 1. Promote different task nodes according to the trial process, such as:

[0092] The judge says: Now the court is in session. Check the parties present; or

[0093] The judge says: The court investigation is over. Now the court debate begins.

[0094] 2. Allocate the right of speech according to the speech content. For example, when the judge and a party continue:

[0095] The judge says: Defendant, have you received a copy of the complaint?

[0096] The defendant says: Yes.

[0097] The judge says: Have you submitted a written defense?

[0098] The defendant says: No, we will make an oral defense.

[0099] The judge says: Now the defendant will present an oral defense opinion.

[0100] 3. According to the case situation, summarize the focus of the dispute, and in combination with the built-in trial thinking knowledge base, cross-examine both parties until the preset task of fact-finding script is completed. For example:

[0101] The judge said: Plaintiff, at what rate do you calculate the penalty interest?

[0102] The plaintiff said: The penalty interest is calculated by increasing the rate by 50% on the basis of 9.6%.

[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 a penalty interest at a rate of 50% higher than the loan interest rate applicable at that time according to the actual number of days.

[0105] The judge said: Plaintiff, what is the contractual basis for your claim that the penalty interest on the outstanding principal and overdue interest has been charged 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 the loan under this contract becomes immediately due in full and demand that the defendant repay the outstanding amount.

[0107] 4. When the content of the speech deviates from the trial order, intervene, for example:

[0108] The defendant said: You are not smart.

[0109] The judge said: Defendant, please pay attention to the content of your speech. You are not allowed to use abusive, sarcastic, or derogatory language that is personally offensive or demeans others.

[0110] The defendant said: You are too stupid.

[0111] The judge said: Defendant, please pay attention to the content of your speech. If you continue to make uncivil remarks, this court will adjourn the session to give you time to calm down.

[0112] 5. Summarize the opinions expressed by both parties to prevent the discussion of the plaintiff / defendant from being too divergent, for example:

[0113] (1) The defendant said: balabala~

[0114] The judge said: Defendant, you have already said this point. This court will give you another 30 seconds to state your case. If there are no new opinions, the court will proceed to the next stage of the procedure.

[0115] (2) The judge said: The court investigation is concluded. Based on the court investigation just conducted, the collegiate bench determines that the focus of the dispute in this case is: 1. What is the specific amount of the principal, interest, penalty interest, and compound interest owed by the defendant to the plaintiff? Do both parties have any objections or supplements to the above-mentioned focus of the dispute summarized by this court?

[0116] The plaintiff said: No objections, no supplements.

[0117] The defendant said: No objections, no supplements.

[0118] Figure 8 The following is a schematic structural diagram of an agent-based mock court implementation device provided for the embodiments of this application. As Figure 8 shown, the device 80 includes:

[0119] A parameter acquisition module 801, configured to acquire a trial rule knowledge base and role simulation parameters;

[0120] A process unit determination module 802, configured to determine the current process unit where the mock court is located;

[0121] A knowledge acquisition module 803, configured to acquire current knowledge from a case knowledge base and a legal provision knowledge base according to the current process unit;

[0122] A speech intention determination module 804, configured to determine the current speech intention of the current process unit based on semantic understanding of the previous text of the court dialogue according to the trial rule knowledge base, the role simulation parameters, and the current knowledge;

[0123] A speech content generation module 805, configured to generate 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 previous text of the court dialogue.

[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, configured to use the current process unit, the current knowledge, and the previous text of the court dialogue as a first variable instruction;

[0127] A first instruction assembly unit, configured to assemble the first fixed instruction and the first variable instruction into a first instruction to input into a large language model, and use the large language model to output the current speech intention.

[0128] Exemplarily, the speech content generation 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, configured to use the current process unit, the current knowledge, the previous context of the court dialogue, and the current speech intention as a second variable instruction;

[0131] A second instruction assembly unit, configured 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, configured to, when the intelligent agent plays the role of a judge, obtain target knowledge from the case knowledge base and the legal provision knowledge base according to the previous process unit;

[0134] A current process unit determination unit, configured 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 previous context of the court dialogue.

[0135] Exemplarily, the current process unit determination unit includes:

[0136] A third fixed instruction acquisition subunit, configured to use the trial rule knowledge base and the role simulation parameters as a third fixed instruction;

[0137] A third variable instruction acquisition subunit, configured to use the target knowledge, the previous process unit, and the previous context of the court dialogue as a third variable instruction;

[0138] A third instruction assembly subunit, configured to assemble the third fixed instruction and the third variable instruction into a third instruction and input it into a large language model, and use the large language model to output the current process unit.

[0139] Exemplarily, the device further includes a behavior marker generation module, and the behavior marker generation module is specifically configured to:

[0140] When the intelligent agent plays the role of a judge, generate a current behavior marker that conforms to the current speech intention according to the trial rule knowledge base, the role simulation parameters, the current knowledge, and the previous context of the court dialogue, where the current behavior marker is used to record the behavior of the intelligent 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 configured to:

[0143] Follow the speech content of each role in the mock court and determine whether it is necessary to display the evidence materials corresponding to the speech content;

[0144] If so, obtain and display the evidence materials from the case knowledge base and the legal provision knowledge base.

[0145] Exemplarily, the device further includes an analysis report generation module, and the analysis report generation module is specifically configured to:

[0146] After the mock court ends, generate an analysis report according to the process units involved in the mock court and the behavior marks and speech content of each role in each process unit.

[0147] Exemplarily, when the intelligent agent plays the role of a judge, the speech intents at least include:

[0148] Informing of rights and obligations; allocating the right of speech; clarifying facts; confirming speech content; intervening in speech content deviating from the court session order; preventing the speech content of other roles from diverging.

[0149] The device for implementing a mock court based on an intelligent agent provided by an embodiment of the present application can be used to execute the technical solution of the method for implementing a mock court based on an intelligent agent in the above embodiment. Its implementation principle and technical effect are similar and will not be elaborated here.

[0150] It should be noted that it should be understood that the division of each module of the above device is only a division of logical functions. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by a processing element; they can also all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the speech intent determination module 804 can be a separately established processing element, or can be integrated in a certain 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 certain processing element of the above device to perform the functions of the above speech intent determination module 804. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together or independently implemented. Here, the processing element 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 integrated logic circuit in the processor element or the instruction in the form of software.

[0151] Figure 9 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 9 As shown in the figure, the electronic device may include: a transceiver 121, a processor 122, and a memory 123.

[0152] The processor 122 executes the computer-executable instructions stored in the memory, enabling the processor 122 to execute the solutions in the above embodiments. The processor 122 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may 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 gate or transistor logic devices, discrete hardware components.

[0153] The memory 123 is connected to the processor 122 through a system bus and completes communication with each other. The memory 123 is used to store computer program instructions.

[0154] The transceiver 121 may be used to obtain the task to be run and the configuration information of the task to be run.

[0155] The system bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to implement 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 embodiments of the present application may be the terminal device in the above embodiments.

[0157] The embodiments of the present application further provide a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are run on a computer, the computer is enabled to execute the technical solutions of the method for implementing an agent-based mock court in the above embodiments.

[0158] The embodiments of the present application further provide a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor may read the computer program from the computer-readable storage medium, and when at least one processor executes the computer program, the technical solutions of the method for implementing an agent-based mock court in the above embodiments can be realized.

[0159] In the process of implementing a computer program product, computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a 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, alternatively, can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0160] Note that the above is only a preferred embodiment of this application and the technical principles applied. Those skilled in the art will understand that this application is not limited to the specific embodiments here. Various obvious changes, re-adjustments, and substitutions can be made by those skilled in the art without departing from the protection scope of this application. Therefore, although this application has been described in more detail through the above embodiments, this application is not limited to the above embodiments. Without departing from the concept of this application, more other equivalent embodiments can be included, and the scope of this application is determined by the scope of the appended claims.< / speak>

Claims

1. An implementation method of an agent-based mock court, characterized in that, Including: Obtain the trial rules knowledge base and role simulation parameters; Determine the current process unit where the mock trial is located; According to the current process unit, obtain the current knowledge from the case knowledge base and the legal provisions knowledge base; Take the trial rules knowledge base and the role simulation parameters as the first fixed instruction; Take the current process unit, the current knowledge, and the previous court dialogue as the first variable instruction; Assemble the first fixed instruction and the first variable instruction into the first instruction to input into the large language model, and use the large language model to output the current speech intention; According to the trial rules knowledge base, the role simulation parameters, the current knowledge, and the previous court dialogue, generate the current speech content that conforms to the current speech intention through the large language model; When the intelligent agent plays the role of a judge, the determination of the current process unit where the mock trial is located includes: According to the previous process unit, obtain the target knowledge from the case knowledge base and the legal provisions knowledge base; According to the trial rules knowledge base, the role simulation parameters, the target knowledge, the previous process unit, and the previous court dialogue, determine the current process unit through the large language model.

2. The method according to claim 1, wherein The generation of 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 previous court dialogue includes: Take the trial rules knowledge base and the role simulation parameters as the second fixed instruction; Take the current process unit, the current knowledge, the previous court dialogue, and the current speech intention as the second variable instruction; Assemble the second fixed instruction and the second variable instruction into the second instruction to input into the large language model, and use the large language model to output the current speech content.

3. The method according to claim 1, wherein The determination of the current process unit according to the trial rules knowledge base, the role simulation parameters, the target knowledge, the previous process unit, and the previous court dialogue includes: Take the trial rules knowledge base and the role simulation parameters as the third fixed instruction; Take the target knowledge, the previous process unit, and the previous court dialogue as the third variable instruction; Assemble the third fixed instruction and the third variable instruction into the third instruction to input into the large language model, and use the large language model to output the current process unit.

4. The method according to claim 1, wherein When the intelligent agent plays the role of a judge, the method further includes: According to the trial rules knowledge base, the role simulation parameters, the current knowledge, and the previous court dialogue, generate the current behavior mark that conforms to the current speech intention, where the current behavior mark is used to record the behavior of the intelligent agent in the current process unit.

5. 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, mock trial duration, and debate depth of the role played by the intelligent agent.

6. The method according to claim 1, wherein It also includes: Follow the speech content of each role in the mock trial and judge whether it is necessary to display the evidence materials corresponding to the speech content; If so, obtain and display the evidence materials from the case knowledge base and the legal provisions knowledge base.

7. The method according to claim 4, characterized in that, It also includes: After the mock court session, an analysis report is generated based on the process units involved in the mock court and the behavior tags and speech contents of each role in each process unit.

8. The method according to claim 1, wherein When the intelligent agent plays the role of judge, the speech intentions at least include: Informing about rights and obligations; allocating the right to speak; clarifying facts; confirming the speech content; intervening in speech content that deviates from the court session order; preventing the speech content of other roles from going off-topic.

9. An agent-based simulation court implementation device, characterized in that, Including: A parameter acquisition module for acquiring a court session rule knowledge base and role simulation parameters; A process unit determination module for determining the current process unit in which the mock court is located; A knowledge acquisition module for acquiring current knowledge from a case knowledge base and a legal provision knowledge base according to the current process unit; A speech intention determination module for using the court session rule knowledge base and the role simulation parameters as a first fixed instruction; Using the current process unit, the current knowledge, and the court dialogue context as a first variable instruction; assembling the first fixed instruction and the first variable instruction into a first instruction and inputting it into a large language model, and using the large language model to output the current speech intention; A speech content generation module for generating current speech content that conforms to the current speech intention through a large language model according to the court session rule knowledge base, the role simulation parameters, the current knowledge, and the court dialogue context; The process unit determination module includes: A target knowledge acquisition unit for, when the intelligent agent plays the role of judge, acquiring target knowledge from the case knowledge base and the legal provision knowledge base according to the previous process unit; A current process unit determination unit for determining the current process unit through a large language model according to the court session rule knowledge base, the role simulation parameters, the target knowledge, the previous process unit, and the court dialogue context.

10. An electronic device, characterized in that, Including: A processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method for implementing a mock court based on an intelligent agent as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by a processor, they are used to implement the method for implementing a mock court based on an intelligent agent as described in any one of claims 1-8.

12. A computer program product, characterized in that, Including a computer program, which when executed by a processor implements the method for implementing a mock court based on an intelligent agent as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Court trial method and device, electronic equipment and machine readable storage medium

    CN111797246A

  • Dialogue data generation method, model training method and related device

    CN117407501A