Query reply method and device, electronic equipment and storage medium

By converting query requests into legal terminology vectors and using a multi-dimensional legal provision and case analysis model, the accuracy and efficiency issues of intelligent query response methods in the legal field are solved, achieving efficient and accurate legal information retrieval.

CN121233698APending Publication Date: 2025-12-30BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410804895.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2025-12-30

AI Technical Summary

Technical Problem

Existing intelligent query response methods in the legal field suffer from problems such as inaccurate queries, inappropriate selection of context learning, and high costs. In particular, large language models are prone to misunderstanding when dealing with conversational queries and require high-quality datasets for supervised fine-tuning.

Method used

By converting informal query requests into formal legal terminology vectors and using a two-stage filtering process to select the best matching legal provisions and cases, and combining multiple legal provision and case analysis models with different training samples and structures, multiple sets of similar legal provisions and cases are recalled, thereby improving accuracy.

Benefits of technology

It significantly improves the accuracy of question answering and reasoning in the legal field, reduces the difficulty of describing query requests, and improves query efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121233698A_ABST
    Figure CN121233698A_ABST
Patent Text Reader

Abstract

The invention provides a query reply method and device, electronic equipment and a storage medium, and relates to the technical field of natural language processing, in particular to the fields of laws, information query and the like. According to the specific implementation scheme, one or more legal term vectors are obtained based on a query request; based on the one or more law term vectors, multiple sets of target similar law articles and multiple sets of target similar cases are obtained, each set of target similar law articles in the multiple sets of target similar law articles comprises one or more target similar law articles, and each set of target similar cases in the multiple sets of target similar cases comprises one or more target similar cases; determining one or more matching law articles from the multiple groups of target similar law articles, and determining one or more matching cases from the multiple groups of target similar cases; and obtaining a reply result corresponding to the query request based on the query request, the one or more matching law articles and the one or more matching cases.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of natural language processing, and particularly relates to the fields of law, information query, etc. BACKGROUND

[0002] With the continuous development of society and the gradual improvement of laws and regulations, the continuous growth and increasing complexity of legal information, an intelligent query and reply method applied to the legal field emerges as the times require. This method not only effectively alleviates the pressure of legal practitioners, but also provides a high-quality and low-cost consulting approach.

[0003] At present, the intelligent query and reply method is usually realized by a large language recognition model method. However, when the large language model is applied to the highly specialized field of law, there may be inaccurate query problems. SUMMARY

[0004] The present disclosure provides a query and reply method, device, electronic equipment and storage medium.

[0005] According to an aspect of the present disclosure, a query and reply method is provided, comprising:

[0006] obtaining one or more legal term vectors based on a query request;

[0007] obtaining a plurality of groups of target similar articles and a plurality of groups of target similar cases based on the one or more legal term vectors, wherein each group of target similar articles in the plurality of groups of target similar articles includes one or more target similar articles, and each group of target similar cases in the plurality of groups of target similar cases includes one or more target similar cases;

[0008] determining one or more matching articles from the plurality of groups of target similar articles and one or more matching cases from the plurality of groups of target similar cases;

[0009] obtaining a reply result corresponding to the query request based on the query request, the one or more matching articles, and the one or more matching cases.

[0010] According to another aspect of the present disclosure, a query and reply device is provided, comprising:

[0011] a vector obtaining module configured to obtain one or more legal term vectors based on a query request;

[0012] a similar article and similar case determining module configured to obtain a plurality of groups of target similar articles and a plurality of groups of target similar cases based on the one or more legal term vectors, wherein each group of target similar articles in the plurality of groups of target similar articles includes one or more target similar articles, and each group of target similar cases in the plurality of groups of target similar cases includes one or more target similar cases;

[0013] The matching law article and matching case determining module is configured to determine one or more matching law articles from the plurality of sets of target similar law articles and determine one or more matching cases from the plurality of sets of target similar cases;

[0014] The answering module is configured to obtain an answering result corresponding to the query request based on the query request, the one or more matching law articles, and the one or more matching cases.

[0015] According to another aspect of the present disclosure, an electronic device is provided, comprising:

[0016] at least one processor; and

[0017] a memory connected to the at least one processor in communication; wherein

[0018] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by any one of the embodiments of the present disclosure.

[0019] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, the computer instructions being used to cause the computer to perform the method provided by any one of the embodiments of the present disclosure.

[0020] According to another aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the method provided by any one of the embodiments of the present disclosure.

[0021] The present disclosure converts an informal query request into a formal legal term vector using a query intention recognition module, and uses a two-stage filtering process to select one or more best matching law articles and one or more best matching cases to obtain potential background information and best reference information, effectively solving the problem of how to select the best similar case and the best similar law article in context learning. In this way, the accuracy of related problem question answering, reasoning, etc. in the legal field is significantly improved.

[0022] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0023] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0024] Figure 1 is an application scenario schematic diagram according to the embodiments of the present disclosure;

[0025] Figure 2is a schematic flow chart of a query answering method according to an embodiment of the present disclosure;

[0026] Figure 3 is a schematic block diagram of a query answering method according to an embodiment of the present disclosure;

[0027] Figure 4 is a schematic structural diagram of a query answering apparatus according to an embodiment of the present disclosure;

[0028] Figure 5 is a schematic structural diagram of a query answering apparatus according to another embodiment of the present disclosure;

[0029] Figure 6 is a schematic block diagram of an electronic device that can be used to implement the present disclosure. DETAILED DESCRIPTION

[0030] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are presented for the purpose of illustration and description. These embodiments are described in detail in order to provide what is believed to be the most useful and readily understood description of the principles and conceptual aspects of the present disclosure. Thus, it will be apparent to one of ordinary skill in the art that various modifications and changes can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, it is also to be understood that the terminology used herein is for the purpose of describing particular embodiments only, and is not intended to limit the scope of the present disclosure. It should also be noted that, in the interest of clarity, not all of the routine features of the implementations described herein are shown or described.

[0031] The term "and / or", as used herein, merely describes association between associated objects, and can indicate three relationships, for example, A and / or B can indicate that A exists alone, A and B exist together, and B exists alone. The term "at least one", as used herein, indicates any one of multiple or any combination of at least two of multiple, for example, at least one of A, B, and C can indicate any one or more elements selected from a set consisting of A, B, and C. The terms "first", "second", as used herein, indicate reference to similar technical terms and distinguish them, and do not mean limitation of order or limitation of only two, for example, the first feature and the second feature refer to two types / two features, and the first feature can be one or more, and the second feature can also be one or more.

[0032] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following detailed description. Those skilled in the art will understand that the present disclosure can be implemented without certain specific details. In some examples, methods, means, elements and circuits that are well known to those skilled in the art are not described in detail in order to highlight the main idea of the present disclosure.

[0033] With the continuous development of society and the gradual improvement of laws and regulations, the quantity of legal information is growing and the complexity is increasing, and the traditional legal problem solving solution becomes more and more time-consuming and difficult. In this era of information explosion, ordinary people and legal practitioners are faced with the problem of how to quickly obtain and understand the vast legal knowledge system.

[0034] Traditional legal consultation and question answering usually involves the interaction between legal service demanders (such as the public or clients) and legal professionals (such as lawyers or legal consultants). It is usually in the form of offline, written or telephone communication, which has the defects of unsmooth communication of information, easy misunderstanding and incomplete coverage of the knowledge of legal practitioners. In this context, the intelligent query and reply method in the legal field emerges as the times require. This method not only can effectively alleviate the pressure of legal practitioners, but also provides a high-quality and low-cost consultation approach.

[0035] At present, the intelligent query and reply method is usually realized by the large language recognition model method. However, when the large language model (LLM) is applied to the highly specialized field of law, there are the following limitations: (1) when the user uses the LLM, the user's inquiry is usually colloquial, which may lead to misunderstanding of the LLM and make wrong predictions and outputs; (2) in the process of processing legal question and answer tasks, the cases and reference information (such as relevant articles and relevant cases) selected by the LLM in the in-context learning (ICL) system may not be the best or the most appropriate, and there is a big gap between the best cases selected based on external strategies; (3) the traditional method usually needs to use high-quality data sets to supervise the fine-tuning or pre-training of the basic model, which will produce huge cost.

[0036] Therefore, in order to avoid the above problems, the present scheme proposes a query and reply method applied to the legal field. Figure 1 is the application scenario diagram of the query and reply method proposed by the embodiments of the present disclosure. Referring to Figure 1 The query and reply method proposed by the embodiments of the present disclosure can be used in a system comprising a server 110 and a terminal 120, and the server 110 and the terminal 120 have a wired communication connection or a wireless communication connection. Optionally, the server 110 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal 120 can be a personal computer (PC), a vehicle-mounted terminal, a tablet computer, a smart phone, a wearable device, a smart robot, etc. with data calculation, processing and storage capabilities.

[0037] In the embodiments of the present disclosure, the terminal 120 in the system can be configured to obtain a query request, such as a legal problem involved in a certain case, and send the query request to the server 110. The server 110 can obtain a reply result corresponding to the query request. Then, the server 110 can send the reply result to the terminal 120.

[0038] The query reply method provided by the embodiments of the present disclosure can be applied to a computer device, which can be Figure 1 The server 110 in the scenario shown in the figure can also be Figure 1 The terminal 110 in the scenario shown in the figure, or can be other devices, which are not limited by the present disclosure.

[0039] The query reply method provided by the embodiments of the present disclosure will be described below in combination with the above technical introduction and application scenarios. For the convenience of description, the embodiments of the present disclosure will be described below in combination with the accompanying drawings.

[0040] Figure 2 is a schematic flowchart of the query reply method provided by the embodiments of the present disclosure, which includes:

[0041] S210, obtaining one or more legal term vectors based on the query request;

[0042] S220, obtaining a plurality of groups of target similar legal provisions and a plurality of groups of target similar cases based on the one or more legal term vectors, wherein each group of target similar legal provisions in the plurality of groups of target similar legal provisions includes one or more target similar legal provisions, and each group of target similar cases in the plurality of groups of target similar cases includes one or more target similar cases;

[0043] S230, determining one or more matching legal provisions from the plurality of groups of target similar legal provisions, and determining one or more matching cases from the plurality of groups of target similar cases;

[0044] S240, obtaining a reply result corresponding to the query request based on the query request, the one or more matching legal provisions, and the one or more matching cases.

[0045] The query request can include any query question in the legal field.

[0046] In some implementations, due to limited legal knowledge, users often cannot accurately express their query needs. Therefore, if the corresponding response is obtained directly from the query request, a large number of responses with low relevance to the query will appear, thus reducing query efficiency. To avoid this problem, this embodiment converts the query request into a vector of more specialized legal terms, enabling users to accurately obtain responses by describing their query request using natural language, without needing to think about the keywords corresponding to the query request, thus reducing the difficulty of describing the query request.

[0047] On the other hand, queries based on more specialized legal terminology vectors yield more accurate results for one or more matching legal provisions and one or more matching cases, significantly reducing the number of relevant legal provisions and cases, thereby improving query efficiency and achieving the goal of accurate querying.

[0048] This disclosure uses a QII (Query Intent Identification) module to convert informal query requests into formal legal terminology vectors. A two-stage filtering process (i.e., "obtaining multiple sets of similar legal provisions and multiple sets of similar cases based on one or more legal terminology vectors" and "determining one or more matching legal provisions from the multiple sets of similar legal provisions and one or more matching cases from the multiple sets of similar cases") is used to select one or more matching legal provisions and one or more matching cases to obtain potential background information and optimal reference information. This effectively solves the challenge of selecting the best similar cases and best similar legal provisions in In-Context Learning (ICL). Thus, it significantly improves the accuracy of question answering and reasoning in the legal field.

[0049] In some possible implementations, obtaining one or more legal term vectors based on the query request specifically includes the following processes:

[0050] The first step is to input the query request into the large language model. The large language model performs semantic parsing on the query request and performs legal reasoning based on its own knowledge and understanding to obtain one or more legal terms corresponding to the query request.

[0051] For example, the legal terms corresponding to this query request can be denoted as txt = [txt(1), txt(2), ..., txt(i), ..., txt(n)].

[0052] In one example, the large language model can determine the legal terms corresponding to the query request based on the legal provision name, legal provision number, legal provision content, legal keywords, as well as the keywords contained in the query request, the purpose, time, people, places, causes, matters, legal categories, and laws and regulations of the query request.

[0053] For example, if the query request is "Help me find out how to divide property in a divorce", the legal term corresponding to the query request could include "property division"; or, if the query request includes "Help me find out how to get more compensation when leaving a job", since the query request describes the purpose of the query in natural language, the legal term corresponding to the query request could include "severance pay" based on the purpose of the query request, namely "get more compensation when leaving a job".

[0054] In some implementations, the query request includes a text query request and / or a voice query request. When the query request includes a voice query request, embodiments of this disclosure may convert the voice query request into text content, and then determine the legal terms corresponding to the voice query request based on the text content.

[0055] The second step is to vectorize the legal terms corresponding to the query request by the intent encoding module to obtain one or more legal term vectors corresponding to the query request.

[0056] In one example, the legal term vector can be denoted as: vec = [vec(1), vec(2), ..., vec(i), ..., vec(n), as shown in the example above, the legal term vectors corresponding to n legal terms are vec(1), vec(2) to vec(n).

[0057] Vector transformation can be achieved using neural network models such as Bidirectional Encoder Representations from Transformers (BERT) and Enhanced Language Representation with Informative Entities (ERNIE).

[0058] Based on one or more legal term vectors, multiple sets of target similar legal provisions and multiple sets of target similar cases are obtained, including: recalling one or more candidate similar legal provisions and one or more candidate similar cases from a legal knowledge base based on one or more legal term vectors; inputting one or more candidate similar legal provisions and query requests into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by multiple legal provision analysis models, wherein different legal provision analysis models are generated from different training samples and / or different legal provision analysis models have different structures; inputting one or more candidate similar cases and query requests into multiple case analysis models to obtain multiple sets of target similar cases output by multiple case analysis models, wherein different case analysis models are generated from different training samples and / or different case analysis models have different structures.

[0059] Generally, models with identical structures but trained on entirely different training samples tend to excel in different domains. For example, models analyzing legal provisions include... 1-1 and model 1-2 For example, if a large number of criminal laws are used as training samples to train the model... 1-1 A large number of civil laws were used as training samples to train the model. 1-2 In the field of criminal law, compared to the model 1-2 model 1-1 The output of similar legal provisions is more accurate; conversely, in the field of civil law, compared to the model... 1-1 model 1-2 The output of similar legal provisions is more accurate. Therefore, if the model structure is exactly the same, but the legal provision analysis model is trained with completely different training samples, it may output one or more different sets of similar legal provisions for the same legal term vector.

[0060] Therefore, in order to improve the accuracy of the response results, embodiments of this disclosure can input one or more candidate similar legal provisions and query requests into multiple legal provision analysis models generated by different training samples to obtain multiple sets of target similar legal provisions determined by the multiple legal provision analysis models.

[0061] Alternatively, multiple models with different structures, even using the exact same training samples, may still produce different outputs. Let's continue with the legal analysis models, including model2-1 and model... 2-2 For example, if model 2-1 and model 2-2 If the structures are different, but the models are trained using the exact same training samples, then the models will differ. 2-1 and model 2-2The output of similar laws are not entirely the same.

[0062] Therefore, in order to improve the accuracy of the response results, this embodiment of the disclosure may input one or more candidate similar legal provisions and query requests into multiple legal provision analysis models with different structures but trained using the same training samples, and obtain multiple sets of target similar legal provisions based on the multiple legal provision analysis models.

[0063] The above method of determining multiple sets of target similar legal provisions can obtain multiple sets of target similar legal provisions in a multi-dimensional and comprehensive manner, avoiding the situation where the accuracy is low or completely unsuitable for the query request caused by target similar legal provisions obtained based on a single dimension, and further improving the efficiency and accuracy of the query response method.

[0064] Similarly, for case study models, if the model structures are exactly the same but trained on completely different training samples, then these models often excel in different domains. For example, consider multiple case study models including model... 3-1 and model 3-2 For example (model) 3-1 and model 3-2 (The structures are exactly the same), if a large number of divorce property divisions are used as training samples to train the model. 3-1 A large number of resignation disputes were used as training samples to train the model. 3-2 So, in the area of ​​divorce property division, compared to models... 3-1 model 3-2 The output of similar target cases is more accurate; conversely, in the field of resignation disputes, compared to the model... 3-2 model 3-1 The output of similar cases is more accurate. Therefore, if the model structure is exactly the same, but the case analysis model is trained with completely different training samples, it may output one or more different sets of similar cases for the same legal term vector.

[0065] Therefore, in order to improve the accuracy of the response results, embodiments of this disclosure can input one or more candidate similar cases and query requests into multiple legal provision analysis models generated by different training samples to obtain multiple sets of target similar cases determined by the multiple case analysis models.

[0066] Alternatively, multiple models with different structures may still produce different outputs even if they are trained using the exact same training samples. Taking the case study models model1 and model2 as an example, if model1 and model2 have different structures but are trained using the exact same training samples, then the target similarity cases output by model1 and model2 will not be exactly the same.

[0067] Therefore, in order to improve the accuracy of the response results, this embodiment of the disclosure may also input one or more candidate similar cases and query requests into multiple case analysis models with different structures but trained using the same training samples, and obtain multiple sets of target similar legal provisions based on the multiple target similar cases.

[0068] The above method of determining multiple sets of target similar cases can obtain multiple sets of target similar cases from multiple dimensions and in a comprehensive manner, avoiding the situation where the accuracy rate is low or the target similar cases obtained based on a single dimension are completely unsuitable for the query request, and further improving the efficiency and accuracy of the query response method.

[0069] Furthermore, the legal knowledge base includes a legal regulations coding database and a case coding database; based on one or more legal term vectors, one or more candidate similar legal provisions and one or more candidate similar cases are recalled in the legal knowledge base, including: based on one or more legal term vectors, one or more candidate similar legal provisions are recalled in the legal regulations coding database; based on one or more legal term vectors, one or more candidate similar cases are recalled in the case coding database.

[0070] The above content briefly explains how to obtain multiple sets of similar legal provisions and multiple sets of similar cases based on one or more legal term vectors.

[0071] The following will explain how to obtain multiple sets of similar legal provisions and multiple sets of similar cases based on one or more legal term vectors. Furthermore, for ease of explanation, the embodiments of this disclosure will sequentially explain how to obtain multiple sets of similar legal provisions and multiple sets of similar cases based on the legal term vectors corresponding to the query request.

[0072] (a) Obtain multiple sets of similar target cases.

[0073] The first step is to establish a legal and regulatory coding database.

[0074] The determination of the legal and regulatory code database includes: splitting each article of each legal and regulatory law in a variety of laws and regulations to obtain a variety of split laws and regulations, wherein each article of each legal and regulatory law in the split variety of laws and regulations is associated with a multi-level category; and encoding each article of each legal and regulatory law in the split variety of laws and regulations to obtain the legal and regulatory code database.

[0075] Taking the Civil Code as an example, the Civil Code can be divided into seven parts, and each article within each part can be further broken down. For instance, if Article 2 of Part 1 of the Civil Code states, "Civil law regulates personal and property relationships between natural persons, legal persons, and unincorporated organizations of equal status," then this embodiment of the disclosure can encode Article 2 of Part 1 of the Civil Code, namely, "Civil law regulates personal and property relationships between natural persons, legal persons, and unincorporated organizations of equal status," to obtain a legal code database.

[0076] As can be seen, each code in the legal and regulatory coding database proposed in this embodiment uniquely corresponds to one legal provision. This legal and regulatory coding database can cover various laws and regulations, and can quickly and conveniently find one or more legal provisions, improving the efficiency of subsequent query requests.

[0077] The second step involves recalling one or more candidate similar legal provisions from the legal regulations coding database based on one or more legal term vectors.

[0078] In one example, this embodiment of the disclosure can directly compare the legal term vector with the code corresponding to each legal provision, and select one or more legal provisions with higher similarity as candidate similar legal provisions.

[0079] This disclosure can compare the legal term vector with the code corresponding to each candidate legal provision to obtain one or more candidate legal provisions with high similarity, thereby quickly finding candidate similar legal provisions with high similarity to the legal term vector and improving the recall rate of the query.

[0080] The third step involves inputting one or more candidate similar legal provisions and query requests into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by the multiple legal provision analysis models.

[0081] Specifically, one or more candidate similar legal provisions and query requests are input into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by the multiple legal provision analysis models. This includes: using one or more candidate similar legal provisions and query requests as first input information; inputting the first input information multiple times into the nth legal provision analysis model to obtain multiple sets of candidate similar legal provisions output by the nth legal provision analysis model, where n is an integer greater than or equal to 1, the nth legal provision analysis model uses different parameters when inputting the first input information in different times, and the nth legal provision analysis model is one of multiple legal provision analysis models; and based on the multiple sets of candidate similar legal provisions output multiple times, obtaining the nth set of target similar legal provisions output by the nth legal provision analysis model.

[0082] The process of inputting the first input information multiple times into the nth legal provision analysis model to obtain multiple sets of candidate similar legal provisions output by the nth legal provision analysis model can be as follows: inputting the first input information i times into the nth legal provision analysis model to obtain the i-th set of candidate similar legal provisions output by the nth legal provision analysis model i times; transforming the parameters of the nth legal provision analysis model, inputting the first input information (i+1) times into the nth legal provision analysis model to obtain the i+1 set of candidate similar legal provisions output by the nth legal provision analysis model (i+1) times, and so on, until the first input information is input I times into the nth legal provision analysis model to obtain multiple sets of candidate similar legal provisions output by the nth legal provision analysis model I times. The number of times the first input information is input into the nth legal provision analysis model (i.e., I times) can be set according to the actual situation, and the parameters of each transformation of the nth legal provision analysis model can be set according to the actual situation.

[0083] In one example, for the nth legal provision analysis model, this embodiment of the present disclosure can sort the multiple sets of candidate similar legal provisions output by the nth legal provision analysis model, and select one or more candidate similar legal provisions with the highest similarity to the first input information (i.e., one or more candidate similar legal provisions, query request) as the nth set of target similar legal provisions output by the nth legal provision analysis model.

[0084] This embodiment of the disclosure obtains multiple candidate similar legal provisions by repeatedly inputting the first input information into the legal provision analysis model and adjusting the parameters of the model with each input of the first input information. This results in multiple candidate similar legal provisions output by the model under different parameters for the second input information. Using this method, a large number of candidate similar legal provisions can be obtained, and the provisions with the highest similarity to the legal term vector can be selected as the nth group of target similar legal provisions. This improves the accuracy of the selected target similar legal provisions and thus enhances the correctness of the response result.

[0085] (ii) Obtain multiple sets of similar target cases.

[0086] The first step is to determine the case coding database.

[0087] The determination of the case coding database includes: extracting keywords from each of the multiple initial cases; and associating the keywords and related information of each initial case to obtain the case coding database.

[0088] For example, this embodiment of the disclosure can assign different codes to each different initial case, such as divorce property division cases and resignation dispute cases. Taking divorce property division as an example, this embodiment of the disclosure can determine "divorce" and "property" as two keywords in the divorce property division, and based on these keywords and relevant information of the case, such as if the relationship between the two parties has not broken down, the party at fault is willing to accept mediation and reconcile, and the innocent party and their children have an attitude of understanding and striving for the party at fault, the court should rule against divorce, and set a corresponding code for the divorce property division case.

[0089] As can be seen, each code in the case coding database proposed in this embodiment uniquely corresponds to one initial case. This case coding database can determine that each code corresponds to one initial case, which facilitates the quick retrieval of one or more initial cases and improves the efficiency of subsequent determination of response results.

[0090] The second step involves recalling one or more candidate similar cases from the case coding database based on one or more legal term vectors.

[0091] In one example, this disclosure embodiment can directly compare the legal term vector with the code corresponding to each initial case, and select one or more initial cases with high similarity as candidate similar cases.

[0092] This disclosure can compare the legal term vector with the code corresponding to each candidate similar case to obtain one or more candidate similar cases with high similarity, which is conducive to more quickly finding candidate similar cases with high similarity to the legal term vector and improving the recall rate of question query.

[0093] The third step involves inputting one or more candidate similar cases and query requests into multiple case analysis models to obtain multiple sets of target similar cases output by the multiple case analysis models.

[0094] Specifically, one or more candidate similar legal provisions and query requests are input into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by the multiple legal provision analysis models. This includes: using one or more candidate similar cases and query requests as second input information; inputting the second input information multiple times into the m-th case analysis model to obtain multiple sets of candidate similar cases output by the m-th case analysis model, where m is an integer greater than or equal to 1, the m-th case analysis model uses different parameters when inputting the second input information in different times, and the m-th case analysis model is one of the multiple case analysis models; and based on the multiple sets of candidate similar cases output multiple times, obtaining the m-th set of target similar cases output by the m-th case analysis model.

[0095] The second input information is input multiple times into the m-th case analysis model to obtain multiple sets of candidate similar cases output by the m-th case analysis model. This can be done as follows: the second input information is input into the m-th case analysis model for the j-th time to obtain the j-th set of candidate similar cases output by the m-th case analysis model for the j-th time; after transforming the parameters of the m-th case analysis model, the second input information is input into the m-th case analysis model for the (j+1)-th time to obtain the (i+1)-th set of candidate similar cases output by the m-th case analysis model for the (i+1)-th time, and so on, until the second input information is input into the m-th case analysis model for J times to obtain multiple sets of candidate similar cases output by the m-th case analysis model for I times. The number of times the second input information is input into the m-th case analysis model (i.e., J times) can be set according to the actual situation, and the parameters of each transformation of the m-th case analysis model can be set according to the actual situation.

[0096] In one example, for the m-th case analysis model, this embodiment of the present disclosure can sort multiple sets of candidate similar cases output by the m-th case analysis model, and select one or more candidate cases with the highest similarity to the second input information as the m-th target similar cases.

[0097] This embodiment of the disclosure obtains multiple similar cases output by the case analysis model under different parameters for the second input information (i.e., one or more candidate similar cases, query requests) by inputting the second input information into the case analysis model multiple times and adjusting the parameters of the legal provision analysis model each time the second input information is input.

[0098] This approach yields a large number of candidate similar cases, from which cases with a high degree of similarity to the legal term vector are selected as the m-th target similar cases. This improves the accuracy of the selected target similar cases and, consequently, the correctness of the response.

[0099] The above content describes how the embodiments of this disclosure determine the target similar legal provisions and target similar cases.

[0100] Furthermore, after obtaining the target similar legal provisions and target similar cases, this disclosure can also determine one or more matching legal provisions most relevant to the query request based on the target similar legal provisions, and determine one or more matching cases from multiple sets of target similar cases.

[0101] Specifically, one or more matching legal provisions are determined from multiple sets of similar legal provisions, and one or more matching cases are determined from multiple sets of similar cases, including:

[0102] In multiple sets of target similarity legal provisions, among the one or more target similarity legal provisions included in each set, determine one or more matching legal provisions that are most relevant to the query request;

[0103] In a set of multiple sets of similar cases, each set of similar cases includes one or more similar cases that are most relevant to the query request.

[0104] For example, embodiments of this disclosure can use a large language model to determine one or more matching legal provisions that are most relevant to the query request among one or more target similar legal provisions included in each group of multiple groups of target similar legal provisions.

[0105] The embodiments of this disclosure can also use a large language model to determine one or more matching cases that are most relevant to the query request among one or more target similar cases included in each group of multiple target similar cases.

[0106] Selecting one or more matching legal provisions from the multiple sets of similar legal provisions, and selecting one or more matching cases from the multiple sets of similar cases, can further reduce the error rate of the selected matching legal provisions and matching cases, thereby further increasing the accuracy of the response content corresponding to the determined query request.

[0107] Furthermore, after determining one or more matching legal provisions and one or more matching cases, this embodiment of the disclosure also needs to obtain the response result corresponding to the query request based on the query request, one or more matching legal provisions, and one or more matching cases.

[0108] Specifically, based on the query request, one or more matching legal provisions, and one or more matching cases, the response result corresponding to the query request is obtained, including:

[0109] Input the query request, one or more matching legal provisions, and one or more matching cases into the response content generation model, and obtain the response content corresponding to the query request output by the response content generation model.

[0110] The response content generation model includes the large language model.

[0111] By comprehensively considering the query request, one or more matching legal provisions, and one or more matching cases to determine the query results, the impact of errors in a single element on the accuracy of the query results can be reduced, thereby further improving the accuracy of the query results.

[0112] Figure 3 This is a schematic diagram illustrating the framework of the query-response method proposed in this disclosure. For example... Figure 3 As shown, the above query response methods include:

[0113] Step 1: Submit the query request (i.e. Figure 3 The input (i.e., the input information) is input into the QII (Query Intent Identification) module to determine one or more legal term vectors corresponding to the query request;

[0114] The query request is input into the LLM in QII. The LLM performs semantic parsing on the query request and performs legal reasoning based on its own knowledge to obtain one or more legal terms corresponding to the query request. The intent encoding module in QII vectorizes the legal terms corresponding to the query request to obtain one or more legal term vectors corresponding to the query request.

[0115] Step 2: Using a legal knowledge base, obtain multiple sets of target similar legal provisions and multiple sets of target similar cases associated with the legal term vectors. Determine one or more matching legal provisions from the multiple sets of target similar legal provisions and one or more matching cases from the multiple sets of target similar cases.

[0116] Specifically, this includes: performing a similarity search in the legal regulations coding database based on the one or more legal term vectors to recall the top-k candidate similar legal provisions; and performing a similarity search in the case coding database based on the one or more legal term vectors to recall the top-k candidate similar cases.

[0117] The one or more candidate similar legal provisions and the query request are input into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by the multiple legal provision analysis models; the one or more candidate similar cases and the query request are input into multiple case analysis models to obtain multiple sets of target similar cases output by the multiple case analysis models;

[0118] One or more matching legal provisions are determined from the multiple sets of target similar legal provisions, and one or more matching cases are determined from the multiple sets of target similar cases.

[0119] The legal and regulatory coding database is generated based on a variety of laws and regulations, and the specific generation method is the same as that in the above embodiments, so it will not be repeated here; the case coding database is generated based on multiple case data (i.e., the initial cases in the above embodiments), and the specific generation method is the same as that in the above embodiments, so it will not be repeated here.

[0120] Step 3: Input the query request, the one or more matching legal provisions, and the one or more matching cases into the response content generation model to obtain the response content (i.e., output) corresponding to the query request output by the response content generation model.

[0121] This QII module includes a large language model and an intent encoding module. For example... Figure 3 As shown, large language models can include LLMs.

[0122] This disclosure also proposes a query response device. Figure 4 This is a schematic diagram of the structure of a query response device 400 according to an embodiment of the present disclosure, including:

[0123] Vector acquisition module 401 is used to obtain one or more legal term vectors based on a query request;

[0124] The module 402 for determining similar legal provisions and similar cases is used to obtain multiple sets of target similar legal provisions and multiple sets of target similar cases based on one or more legal term vectors. Each set of target similar legal provisions includes one or more target similar legal provisions, and each set of target similar cases includes one or more target similar cases.

[0125] The matching legal provision and matching case determination module 403 is used to determine one or more matching legal provisions from multiple sets of target similar legal provisions and to determine one or more matching cases from multiple sets of target similar cases;

[0126] The response module 404 is used to obtain the response result corresponding to the query request based on the query request, one or more matching legal provisions, and one or more matching cases.

[0127] In some implementations, the similar legal provisions and similar cases determination module is used to recall one or more candidate similar legal provisions and one or more candidate similar cases from a legal knowledge base based on one or more legal term vectors; input one or more candidate similar legal provisions and query requests into multiple legal provision analysis models to obtain multiple sets of target similar legal provisions output by multiple legal provision analysis models, wherein different legal provision analysis models are generated from different training samples and / or different legal provision analysis models have different structures; input one or more candidate similar cases and query requests into multiple case analysis models to obtain multiple sets of target similar cases output by multiple case analysis models, wherein different case analysis models are generated from different training samples and / or different case analysis models have different structures.

[0128] In some implementations, the similar legal provisions and similar cases determination module is used to take one or more candidate similar legal provisions and a query request as first input information; input the first input information multiple times into the nth legal provision analysis model to obtain multiple sets of candidate similar legal provisions output by the nth legal provision analysis model, where n is an integer greater than or equal to 1, the nth legal provision analysis model uses different parameters when inputting the first input information at different times, and the nth legal provision analysis model is one of multiple legal provision analysis models; based on the multiple sets of candidate similar legal provisions output multiple times, the nth set of target similar legal provisions output by the nth legal provision analysis model is obtained.

[0129] In some implementations, the similar legal provisions and similar cases determination module is used to take one or more candidate similar cases and query requests as second input information; input the second input information multiple times into the m-th case analysis model to obtain multiple sets of candidate similar cases output by the m-th case analysis model, where m is an integer greater than or equal to 1, the m-th case analysis model uses different parameters when inputting the second input information at different times, and the m-th case analysis model is one of multiple case analysis models; based on the multiple sets of candidate similar cases output multiple times, the m-th set of target similar cases output by the m-th case analysis model is obtained.

[0130] In some implementations, the legal knowledge base includes a legal code database and a case code database; a similar legal provision and similar case determination module is used to recall one or more candidate similar legal provisions in the legal code database based on one or more legal term vectors; and to recall one or more candidate similar cases in the case code database based on one or more legal term vectors.

[0131] In some implementations, the response module is used to input a query request, one or more matching legal provisions, and one or more matching cases into the response content generation model, and obtain the response content corresponding to the query request output by the response content generation model.

[0132] In some implementations, the matching legal provision and matching case determination module is used to determine one or more matching legal provisions that are most relevant to the query request from among one or more target similar legal provisions included in each group of target similar legal provisions in multiple groups of target similar legal provisions; and to determine one or more matching cases that are most relevant to the query request from among one or more target similar cases included in each group of target similar cases in multiple groups of target similar cases.

[0133] Figure 5 This is a schematic diagram of the structure of a query response device 400 according to an embodiment of the present disclosure, as shown below. Figure 5 As shown, in some embodiments, the query response device 400 further includes:

[0134] Legal code 501 is used to break down each article of each legal law into multiple legal laws and regulations, resulting in multiple broken-down legal laws and regulations. Each article of each legal law in the multiple broken-down legal laws and regulations is associated with multi-level categories. Each article of each legal law in the multiple broken-down legal laws and regulations is coded to obtain a legal code database.

[0135] In some embodiments, the query response device 400 further includes:

[0136] The case coding module 502 is used to extract keywords from each of the multiple initial cases; and to associate the keywords and related information of each initial case to obtain the case coding database.

[0137] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0138] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0139] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0140] like Figure 6As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 606 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0141] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0142] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as query-response methods. For example, in some embodiments, the query-response method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the query-response method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform query-response methods by any other suitable means (e.g., by means of firmware).

[0143] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0144] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0145] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0147] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0148] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0149] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.

[0150] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A query answering method, comprising: obtaining one or more legal term vectors based on a query request; obtaining a plurality of groups of target similar legal provisions and a plurality of groups of target similar cases based on the one or more legal term vectors, wherein each group of target similar legal provisions comprises one or more target similar legal provisions, and each group of target similar cases comprises one or more target similar cases; determining one or more matching legal provisions from the plurality of groups of target similar legal provisions and one or more matching cases from the plurality of groups of target similar cases; obtaining an answering result corresponding to the query request based on the query request, the one or more matching legal provisions, and the one or more matching cases.

2. The method of claim 1, wherein, The obtaining of the plurality of groups of target similar legal provisions and the plurality of groups of target similar cases based on the one or more legal term vectors comprises: recalling one or more candidate similar legal provisions and one or more candidate similar cases in a legal related knowledge base based on the one or more legal term vectors; inputting the one or more candidate similar legal provisions and the query request into a plurality of legal provision analysis models to obtain a plurality of groups of target similar legal provisions output by the plurality of legal provision analysis models, wherein different legal provision analysis models in the plurality of legal provision analysis models are generated by different training samples, and / or different legal provision analysis models have different structures; inputting the one or more candidate similar cases and the query request into a plurality of case analysis models to obtain a plurality of groups of target similar cases output by the plurality of case analysis models, wherein different case analysis models in the plurality of case analysis models are generated by different training samples, and / or different case analysis models have different structures.

3. The method of claim 2, wherein, The inputting of the one or more candidate similar legal provisions and the query request into a plurality of legal provision analysis models to obtain a plurality of groups of target similar legal provisions output by the plurality of legal provision analysis models comprises: inputting the one or more candidate similar legal provisions and the query request as first input information; inputting the first input information into an nth legal provision analysis model for multiple times to obtain a plurality of groups of candidate similar legal provisions output by the nth legal provision analysis model for multiple times, wherein n is an integer greater than or equal to 1, parameters used by the nth legal provision analysis model are different when the first input information is input for different times, and the nth legal provision analysis model is one of the plurality of legal provision analysis models; obtaining an nth group of target similar legal provisions output by the nth legal provision analysis model based on the plurality of groups of candidate similar legal provisions output for multiple times.

4. The method of claim 2, wherein, The inputting of the one or more candidate similar cases and the query request into a plurality of different case analysis models to obtain a plurality of groups of target similar cases output by the plurality of different case analysis models comprises: inputting the one or more candidate similar cases and the query request as second input information; inputting the second input information into the mth case analysis model for multiple times to obtain multiple groups of candidate similar cases output by the mth case analysis model for multiple times, wherein m is an integer greater than or equal to 1, parameters used by the mth case analysis model are different when the mth case analysis model inputs the second input information for different times, and the mth case analysis model is one of the multiple case analysis models; obtaining an mth group of target similar cases output by the mth case analysis model based on the multiple groups of candidate similar cases output for multiple times.

5. The method of claim 2, wherein, The legal knowledge base includes a legal regulation code database and a case code database; and the recalling one or more candidate similar legal provisions and one or more candidate similar cases from the legal knowledge base based on the one or more legal term vectors includes: recalling the one or more candidate similar legal provisions from the legal regulation code database based on the one or more legal term vectors; recalling one or more candidate similar cases from the case code database based on the one or more legal term vectors.

6. The method of claim 1, wherein, The obtaining a reply result corresponding to the query request based on the query request, the one or more matched legal provisions and the one or more matched cases includes: inputting the query request, the one or more matched legal provisions and the one or more matched cases into a reply content generation model to obtain reply content corresponding to the query request output by the reply content generation model.

7. The method of claim 1, wherein, The determining one or more matched legal provisions from the multiple groups of target similar legal provisions and one or more matched cases from the multiple groups of target similar cases includes: determining one or more matched legal provisions most relevant to the query request from one or more target similar legal provisions included in each group of target similar legal provisions in the multiple groups of target similar legal provisions; determining one or more matched cases most relevant to the query request from one or more target similar cases included in each group of target similar cases in the multiple groups of target similar cases.

8. The method according to any one of claims 1-7, further comprising: splitting each legal provision of each legal regulation in the multiple legal regulations to obtain split multiple legal regulations, wherein each legal provision of each legal regulation in the split multiple legal regulations is associated with multiple levels of categories; encoding each legal provision of each legal regulation in the split multiple legal regulations to obtain a legal regulation code database.

9. The method according to any one of claims 1-7, further comprising: extracting keywords from each initial case in the multiple initial cases; associating the keywords of each initial case with relevant information of each initial case to obtain a case code database.

10. A query reply apparatus, comprising: a vector acquisition module configured to obtain one or more legal term vectors based on a query request; The similar law article and similar case determination module is configured to obtain, based on the one or more legal term vectors, a plurality of groups of target similar law articles and a plurality of groups of target similar cases, wherein each group of target similar law articles in the plurality of groups of target similar law articles comprises one or more target similar law articles, and each group of target similar cases in the plurality of groups of target similar cases comprises one or more target similar cases; The matching law article and matching case determination module is configured to determine one or more matching law articles from the plurality of groups of target similar law articles and determine one or more matching cases from the plurality of groups of target similar cases; The reply module is configured to obtain a reply result corresponding to the query request based on the query request, the one or more matching law articles, and the one or more matching cases.

11. The apparatus of claim 10, wherein, The similar law article and similar case determination module is configured to recall, based on the one or more legal term vectors, one or more candidate similar law articles and one or more candidate similar cases from a legal-related knowledge base; The one or more candidate similar law articles and the query request are input into a plurality of law article analysis models to obtain a plurality of groups of target similar law articles output by the plurality of law article analysis models, wherein different law article analysis models in the plurality of law article analysis models are generated based on different training samples, and / or the different law article analysis models have different structures; and the one or more candidate similar cases and the query request are input into a plurality of case analysis models to obtain a plurality of groups of target similar cases output by the plurality of case analysis models, wherein different case analysis models in the plurality of case analysis models are generated based on different training samples, and / or the different case analysis models have different structures.

12. The apparatus of claim 11, wherein, The similar law article and similar case determination module is configured to input the one or more candidate similar law articles and the query request as first input information. The first input information is input into an nth law article analysis model for a plurality of times to obtain a plurality of groups of candidate similar law articles output by the nth law article analysis model for the plurality of times, wherein n is an integer greater than or equal to 1, the nth law article analysis model uses different parameters when inputting the first input information for different times, the nth law article analysis model is one of the plurality of law article analysis models, and an nth group of target similar law articles output by the nth law article analysis model is obtained based on the plurality of groups of candidate similar law articles output for the plurality of times.

13. The apparatus of claim 11, wherein, The similar law article and similar case determination module is configured to input the one or more candidate similar cases and the query request as second input information. The second input information is input into an mth case analysis model for a plurality of times to obtain a plurality of groups of candidate similar cases output by the mth case analysis model for the plurality of times, wherein m is an integer greater than or equal to 1, the mth case analysis model uses different parameters when inputting the second input information for different times, the mth case analysis model is one of the plurality of case analysis models, and an mth group of target similar cases output by the mth case analysis model is obtained based on the plurality of groups of candidate similar cases output for the plurality of times.

14. The apparatus of claim 11, wherein, The legal knowledge base comprises a legal regulation code database and a case code database; the similar legal provision and similar case determination module is configured to, based on the one or more legal term vectors, recall the one or more candidate similar legal provisions in the legal regulation code database; based on the one or more legal term vectors, recall one or more candidate similar cases in the case code database.

15. The apparatus of claim 10, wherein, The reply module is configured to input the query request, the one or more matching legal provisions, and the one or more matching cases into a reply content generation model to obtain reply content corresponding to the query request output by the reply content generation model.

16. The apparatus of claim 10, wherein, The matching legal provision and matching case determination module is configured to determine, in one or more target similar legal provisions included in each group of target similar legal provisions, one or more matching legal provisions most relevant to the query request; and determine, in one or more target similar cases included in each group of target similar cases, one or more matching cases most relevant to the query request.

17. The apparatus of any one of claims 10-16, further comprising: a legal regulation code, configured to split each legal provision of each legal regulation in a plurality of legal regulations to obtain a plurality of split legal regulations, wherein each legal provision of each legal regulation in the plurality of split legal regulations is associated with a plurality of categories; and code each legal provision of each legal regulation in the plurality of split legal regulations to obtain a legal regulation code database.

18. The apparatus of any one of claims 10-16, further comprising: a case coding module, configured to extract keywords from each initial case in a plurality of initial cases; associate the keywords of each initial case with relevant information of each initial case to obtain a case code database.

19. An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.

20. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-9.

21. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-9.