Question and answer method and device, equipment, medium and program product

By predicting the cause of action and extracting key elements from professional domain question answering, and performing multi-path retrieval from case, regulation and cause of action knowledge bases to generate answer text, the problem of large language models being unable to obtain the latest information is solved, and professional domain knowledge question answering with high accuracy and high reliability is achieved.

CN121456083APending Publication Date: 2026-02-03ANHUI IFLYTEK INTELLIGENT SYST
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511323144.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing large-scale language models cannot obtain the latest information in professional domain question answering, and the generated answers may not be consistent with the facts, making it difficult to meet the requirements of factual accuracy and logical rigor.

Method used

By predicting the cause of action and extracting key elements based on query text, and using a multi-path parallel retrieval system of case, law and cause of action knowledge base, answer text is generated. This is then combined with a large language model for fusion and sorting, achieving a deep understanding and high-precision knowledge retrieval of complex professional issues.

Benefits of technology

It significantly improves the accuracy and reliability of professional knowledge Q&A scenarios, achieves generalized recall of case facts and applicable laws and precise anchoring of expert knowledge, and overcomes the problems of inaccurate intent recognition and low matching degree between search results and needs caused by single vector retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121456083A_ABST
    Figure CN121456083A_ABST
Patent Text Reader

Abstract

The invention provides a question and answer method and device, equipment, a medium and a program product, and the method comprises the steps: predicting the cause of a to-be-queried case and extracting key elements related to the to-be-queried case based on a query text, the query text being a natural language text containing the description of the to-be-queried case; based on the key elements, performing retrieval in a case knowledge base to obtain candidate cases related to the to-be-queried case; based on the key elements, retrieving in a law and regulation knowledge base to obtain candidate law articles related to the to-be-queried case; based on the cause of action, performing retrieval in a cause of action knowledge base to obtain candidate expert knowledge related to the cause of action; and generating an answer text of the query text based on the candidate case, the candidate law article and the candidate expert knowledge. According to the method, multi-path retrieval is performed from the case knowledge base, the law and regulation knowledge base and the cause knowledge base in parallel, so that the accuracy and the reliability in a knowledge question and answer scene in a professional field are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a question-and-answer method, apparatus, device, medium, and program product. Background Technology

[0002] Large Language Models (LLMs) are widely used to build intelligent question-answering systems. However, their knowledge comes from static "parameterized memory" formed during training, which prevents the model from acquiring the latest information and may produce "illusionary" content that is inconsistent with the facts when answering questions.

[0003] To address these issues, the Retrieval Augmentation (RAG) method is commonly used. This method vectorizes the user query before generating a response and performs semantic retrieval from an external knowledge base to find relevant information fragments to enhance and anchor the model's answer. However, in certain specialized fields with extremely high requirements for factual accuracy (such as the legal field), this approach struggles to guarantee a precise match between search results and user needs, failing to meet the high accuracy requirements of professional knowledge-based question-answering scenarios. Summary of the Invention

[0004] This invention provides a question-and-answer method, apparatus, device, medium, and program product to address the deficiencies in the prior art.

[0005] This invention provides a question-and-answer method, comprising the following steps: Based on the query text, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted. The query text is natural language text containing a description of the case to be queried. Based on the aforementioned key elements, a search is conducted in the case knowledge base to obtain candidate cases related to the case to be queried; Based on the aforementioned key elements, a search is conducted in the legal knowledge base to obtain candidate legal provisions related to the case to be queried; Based on the stated cause of action, a search is conducted in the cause of action knowledge base to obtain candidate expert knowledge related to the stated cause of action; Based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge, the answer text for the query text is generated.

[0006] According to a question-answering method provided by the present invention, the step of predicting the cause of action of a case to be queried based on the query text and extracting key elements related to the case to be queried includes: Extract the case description text from the query text; Based on the case description text, predict the cause of action for the case to be queried; Based on the stated cause of action, the key elements are extracted from the case description text.

[0007] According to a question-answering method provided by the present invention, the step of retrieving candidate cases related to the query case from a case knowledge base based on the key elements includes: Determine the vector similarity between the key elements and the key elements pre-stored in each historical case in the case knowledge base; Historical cases in the case knowledge base with a vector similarity greater than a first threshold are selected as candidate cases.

[0008] According to a question-and-answer method provided by the present invention, the step of retrieving candidate legal provisions related to the case to be queried from a legal knowledge base based on the key elements includes: Using the stated cause of action as a search tag, and combining it with the stated key elements, semantic search and / or keyword search are performed in the legal knowledge base to determine the candidate legal provisions.

[0009] According to a question-answering method provided by the present invention, the step of retrieving candidate expert knowledge related to the cause of action from a cause-of-action knowledge base includes: Determine the vector similarity between the stated cause of action and each cause of action in the cause of action knowledge base; The expert knowledge corresponding to the case types in the case type knowledge base whose vector similarity is greater than the second threshold is used as the candidate expert knowledge.

[0010] According to a question-answering method provided by the present invention, generating answer text for the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge includes: By integrating the candidate cases, the candidate legal provisions, the candidate expert knowledge, and the query text, a fused text is obtained. Using a large language model, the fused text is applied to perform a correlation analysis on the candidate cases and the candidate legal provisions, and the candidate cases and the candidate legal provisions are ranked based on the correlation analysis results; Based on the sorting results, related cases and related legal provisions are obtained by filtering from the candidate cases and the candidate legal provisions; The answer text is generated based on the related cases, the related legal provisions, and the knowledge of the candidate experts.

[0011] According to a question-answering method provided by the present invention, the steps of predicting the cause of action of the case to be queried based on the query text and extracting key elements related to the case to be queried further include: The query text is identified by question type, and the existence of the question-answer pair corresponding to the query text in the distillation database is determined based on the identified type. If the question-answer pair corresponding to the query text exists in the distillation database, the answer text is obtained by searching the distillation database based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identification type is legal provision retrieval, the answer text is obtained by searching the legal provision database based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the type of identification is detailed case analysis, the query text is analyzed using a large language model to obtain the answer text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is a brief case analysis, the cause of action of the case to be queried is predicted based on the query text, and key elements related to the case to be queried are extracted.

[0012] The present invention also provides a question-and-answer device, comprising the following modules: The prediction unit is used to predict the cause of action of a case to be queried and extract key elements related to the case to be queried based on the query text, wherein the query text is natural language text containing a description of the case to be queried. The first retrieval unit is used to retrieve candidate cases related to the case to be queried from the case knowledge base based on the key elements. The second retrieval unit is used to retrieve candidate legal provisions related to the case to be queried from the legal knowledge base based on the key elements. The third retrieval unit is used to retrieve candidate expert knowledge related to the cause of action from the cause of action knowledge base based on the cause of action. The generation unit is used to generate the answer text of the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the question-and-answer methods described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the question-and-answer method as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the question-and-answer method as described above.

[0016] The question-answering method, apparatus, device, medium, and program product provided by this invention predicts the cause of action and extracts key elements based on query text, and performs multi-path retrieval in parallel from case knowledge base, legal knowledge base, and cause of action knowledge base. Finally, the results of the multi-path retrieval are integrated to generate answer text, achieving deep understanding and high-precision knowledge retrieval for complex professional domain issues. This invention achieves generalized retrieval of case facts and applicable laws by introducing case retrieval and legal retrieval, and accurately anchors the core legal points and adjudication rules of the case by introducing a precise retrieval path based on cause of action prediction. This forms a retrieval architecture that synergizes "generalization ability" and "expert precision," thereby effectively overcoming the problems of inaccurate intent recognition and low matching degree between retrieval results and needs caused by relying solely on single-vector retrieval in traditional methods, significantly improving the accuracy and reliability in professional domain knowledge question-answering scenarios. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the question-and-answer method provided by the present invention.

[0019] Figure 2 This is a flowchart illustrating another question-and-answer method provided by the present invention.

[0020] Figure 3 This is a schematic diagram of the question-and-answer device provided by the present invention.

[0021] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0023] Current retrieval enhancement methods vectorize user queries before generating answers and perform semantic searches from external knowledge bases to find relevant information fragments to enhance and anchor the model's response. However, in professional fields such as public security, where the accuracy of facts is extremely important, this approach has significant drawbacks: First, for uncertain user input, simply vectorizing the query content is insufficient to accurately capture the user's true intent; second, faced with massive amounts of legal regulations and case data, relying solely on vector similarity retrieval results in insufficient accuracy, making it difficult to guarantee a precise match between search results and user needs, and failing to meet the high accuracy requirements of professional knowledge question-answering scenarios.

[0024] To address this issue, the present invention provides a question-answering method that significantly improves the accuracy and reliability of answers through multi-dimensional knowledge retrieval and fusion. This method can be applied to intelligent question-answering systems based on large-scale language models, such as those applicable to professional fields like the judiciary where high accuracy and logical rigor are required, as well as medical diagnosis and assisted treatment scenarios, and financial supervision and audit compliance scenarios. For ease of explanation, the following embodiments are all illustrated using a judiciary-related question-answering application as an example.

[0025] in, Figure 1 This is a flowchart illustrating the question-and-answer method provided by the present invention, as shown below. Figure 1 As shown, the method includes steps 110, 120, 130, 140 and 150.

[0026] Step 110: Based on the query text, predict the cause of action of the case to be queried and extract key elements related to the case to be queried. The query text is natural language text containing a description of the case to be queried.

[0027] In this embodiment, query text refers to natural language text input by the user through a business system (such as a knowledge assistant, case-handling assistance system, etc.) to ask questions. It can be a specific case fact described by the user, aiming to obtain information such as qualitative analysis, similar cases, or applicable legal provisions. Query text is used to represent the user's query intent. For example, a user can input the query text: "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount on the grounds that the goods had minor defects. Is Company B's behavior legal, and how should Company A protect its rights?"

[0028] As an alternative embodiment, the query text entered by the user can be received through a human-computer interaction interface (e.g., a text input box).

[0029] Since user query text is typically unstructured natural language, direct retrieval is unlikely to guarantee accuracy. Therefore, deep semantic understanding of the query text can be performed to determine its core intent. In this embodiment, the cause of action can be understood as a legal classification of the nature of the case, such as "sales contract dispute" or "private lending dispute." Key elements refer to the core factual information necessary to constitute a specific cause of action, or specific details that have a significant impact on the handling of the case. For example, for "sales contract dispute," key elements may include contract type, contract amount, party information, points of contention, and performance status.

[0030] In this step, a pre-trained language model (e.g., a large language model LLM) can be used to analyze the query text. After receiving the query text, the model performs two parallel tasks: first, based on its understanding of the case description, it predicts one or more most likely causes of action; second, based on the predicted causes of action, it extracts the key elements corresponding to that type of case from the query text.

[0031] For example, given the query text "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount due to minor defects in the goods...", this step can predict the cause of action as "sales contract dispute" and extract the key elements, such as: {Contract type: goods sales contract}, {Contract amount: 500,000 yuan}, {Dispute focus: goods defects, refusal to pay}, {Parties: Company A, Company B}, etc.

[0032] Step 120: Based on key elements, search the case knowledge base to obtain candidate cases related to the case to be queried.

[0033] In this embodiment, the case knowledge base can be a structured database storing a large amount of historical case information. For example, in the judicial field, this knowledge base can be a case-like knowledge base containing a large number of historical cases. These cases can be pre-segmented according to dimensions such as the investigation findings, the judgment opinions, and the relevant legal provisions, and core elements are extracted and labeled for different causes of action. Candidate cases refer to one or more historical cases retrieved from the case knowledge base that have a certain degree of similarity to the current case to be queried.

[0034] In this step, the key elements extracted in step 110 are used to search the case knowledge base. The search method can be, but is not limited to, vector similarity matching, keyword exact / fuzzy matching, or rule-based matching. By comparing the key elements of the case to be queried with the key elements pre-stored in various historical cases in the knowledge base, the historical cases with the most similar facts can be found as candidate cases.

[0035] For example, by comparing the extracted key elements {points of contention: defective goods, refusal to pay} and {contract type: sales contract for goods} with cases in the case knowledge base (similar case knowledge base), several sales contract cases that also involve "defective goods" leading to "payment disputes" can be retrieved and returned as candidate cases.

[0036] Step 130: Based on key elements, search the legal knowledge base to obtain candidate legal provisions related to the case to be queried.

[0037] In this embodiment, the legal knowledge base is a database storing various laws, administrative regulations, judicial interpretations, and other texts. To facilitate retrieval, the legal texts in the database can be pre-structured, for example, segmented according to hierarchical levels such as "chapter / section / article / clause / item," and pre-tagged with dimensions such as cause of action and applicable subject / object characteristics based on their content. Candidate legal provisions refer to one or more legal provisions retrieved from the legal knowledge base that may be applicable to the currently queried case.

[0038] In this step, the key elements extracted in step 110 (e.g., the focus of the case, behavioral characteristics, etc.) are used to perform a search in the legal knowledge base. The search can employ semantic search, keyword search, or a combination of both. This method allows for the retrieval of potentially relevant legal grounds from a vast amount of legal provisions.

[0039] For example, if the extracted key elements include "goods sales contract" and "goods defects", relevant clauses on sales contracts, quality inspection of the subject matter, and liability for breach of contract can be retrieved from the legal knowledge base as candidate legal provisions.

[0040] Step 140: Based on the cause of action, search the cause of action knowledge base to obtain candidate expert knowledge related to the cause of action.

[0041] In this embodiment, the cause-of-case knowledge base can be understood as a high-quality knowledge collection constructed by domain experts (e.g., legal experts) and indexed by cause of case. This knowledge base stores refined and summarized expert knowledge, including core regulations, key judicial interpretations, legal elements, and case filing standards for each specific cause of case. Candidate expert knowledge refers to authoritative knowledge content precisely matched and extracted from this knowledge base for a specific cause of case.

[0042] In this step, the cause of action predicted in step 110 is directly and accurately searched or matched in the cause of action knowledge base.

[0043] For example, when the predicted cause of action is "sales contract dispute", all pre-set expert knowledge related to "sales contract dispute" can be directly extracted from the cause of action knowledge base, such as the distinction between "fundamental breach" and "non-fundamental breach", the rights and obligations of the buyer, and remedies, as candidate expert knowledge.

[0044] Step 150: Based on candidate cases, candidate legal provisions, and candidate expert knowledge, generate the answer text for the query text.

[0045] In this embodiment, the answer text refers to the final generated natural language text that is comprehensive and logically clear, used to respond to the user's query text.

[0046] After acquiring candidate cases, candidate legal provisions, and candidate expert knowledge through the three parallel paths (steps 120, 130, and 140), this step aggregates and integrates these three pieces of information. Optionally, the original query text and all information fragments returned by the three retrieval paths can be combined into a rich and comprehensive context. This enhanced context is then input into a generative model (e.g., a large language model LLM), which performs in-depth thinking, reasoning, and content organization to ultimately generate a structurally complete, logically coherent, and accurate answer text.

[0047] For example, after receiving the original question about a "contract dispute between Company A and Company B," similar cases (candidate cases), relevant clauses (candidate legal provisions), and key legal points of the sales contract (candidate expert knowledge), the generative model synthesizes this information and generates the following answer text: "Based on the circumstances you described, Company B's refusal to pay the full amount due to 'minor defects' may constitute a breach of contract. According to relevant regulations,... We have retrieved the following similar cases for your reference: [Case 1], [Case 2]... We suggest that Company A negotiate with Company B or assert its rights through legal channels..."

[0048] The question-answering method provided in this embodiment predicts the cause of action and extracts key elements from the query text. Based on this, it performs multi-path searches in parallel from the case knowledge base, the legal knowledge base, and the cause of action knowledge base. Finally, it merges the multi-path search results to generate the answer text, achieving a deep understanding and high-precision knowledge retrieval for complex professional domain issues. This embodiment achieves generalized retrieval of case facts and applicable laws by introducing case retrieval and legal retrieval. It also achieves precise anchoring of core legal points and adjudication rules by introducing a precise expert knowledge retrieval path based on cause of action prediction. This forms a retrieval architecture that synergizes "generalization ability" and "expert precision," effectively overcoming the problems of inaccurate intent recognition and low matching degree between search results and needs caused by relying solely on single-vector retrieval in traditional methods. This significantly improves the accuracy and reliability in professional domain knowledge question-answering scenarios.

[0049] Based on the above embodiments, based on the query text, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted, including: Extract case description text from query text; Based on the case description text, predict the cause of action for the case to be queried; Based on the cause of action, key elements are extracted from the case description text.

[0050] In this embodiment, the user's query text is typically natural language text that mixes factual statements and subjective questions. For example, the query text might be: "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount, citing minor defects in the goods. Is Company B's behavior legal, and how should Company A protect its rights?" This text contains both a description of the facts of the case and questions such as "whether it is legal" and "how to protect rights." To ensure that subsequent case prediction and element extraction focus on objective facts, the factual portion needs to be separated from the complete query text.

[0051] The case description text can be understood as the descriptive text that objectively reflects the course of the case after non-factual content such as questions and claims has been stripped from the query text. For example, the extracted case description text for the above query text would be: "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount due to minor defects in the goods." Optionally, the case description text can be separated from interrogative or imperative sentences using techniques such as intent recognition and text segmentation in Natural Language Processing (NLP).

[0052] After obtaining the case description text, it can be input into a large-scale language model (LLM) for processing. The model performs semantic understanding and legal domain classification on the input case description text, thereby predicting the most likely cause of action for the described case.

[0053] For example, if the case description text ("Company A and Company B... refuse to pay all the payment for goods") is input into the model, the model will analyze the key information such as "signing a contract", "selling goods" and "paying for goods", and based on its internal knowledge, predict that the cause of action of the case is "sales contract dispute".

[0054] After determining the cause of action, the predicted cause of action and the case description text are simultaneously input into a large-scale language model (LLM). The model then extracts key elements from the case description text based on the preset element framework corresponding to the cause of action (e.g., the preset element framework for the cause of action "sales contract dispute" may include the parties, the subject matter of the contract, the contract amount, the performance status, the focus of the dispute, etc.).

[0055] This embodiment achieves a structured, step-by-step intelligent preprocessing workflow by first extracting the case description text, then predicting the cause of action based on the case description text, and finally extracting key elements from the description text guided by the cause of action. Because this embodiment first determines the macro-level legal classification of the case (cause of action) and then performs targeted micro-level fact extraction (key elements), it avoids blind information extraction without contextual guidance, thereby significantly improving the accuracy of cause of action prediction and the completeness and relevance of key element extraction.

[0056] Based on any of the above embodiments, based on key elements, a search is conducted in the case knowledge base to obtain candidate cases related to the case to be queried, including: Determine the vector similarity between key elements and key elements pre-stored in each historical case in the case knowledge base; Historical cases with vector similarity greater than the first threshold in the case knowledge base are selected as candidate cases.

[0057] This embodiment details how to accurately recall candidate cases with the highest similarity to the current case from a massive number of historical cases through semantic-level matching.

[0058] Specifically, to achieve semantic-level comparison, the key textual elements are first converted into a computer-processable mathematical form. Optionally, embedding techniques can be used, where key elements extracted from the query text and key elements pre-stored for each historical case in the case knowledge base are input into a text embedding model. This model maps the key elements of the query text and the key elements of the historical cases to the same high-dimensional vector space, generating corresponding feature vectors. These feature vectors can capture the semantic information of the key element text, ensuring that semantically similar texts are also positioned relatively close in the vector space.

[0059] After obtaining the feature vectors of the key elements of the case to be queried, the vector similarity between this vector and the feature vectors of the key elements of each historical case stored in the case knowledge base is calculated. Vector similarity can be calculated using methods such as cosine similarity, Euclidean distance, or dot product. Taking cosine similarity as an example, it calculates the cosine of the angle between two vectors, with the result ranging from -1 to 1. The closer the value is to 1, the more consistent the directions of the two vectors are, meaning the more similar the semantics of the texts they represent.

[0060] For example, in the aforementioned "contract dispute between Company A and Company B," the extracted key elements set {contract type: sales contract}, {points of contention: defective goods, refusal to pay}, etc., are input into a text embedding model to obtain the query feature vector V. query Meanwhile, the case knowledge base has pre-stored a large number of feature vectors of historical cases, such as V. case1 V case2 Calculate the cosine similarity (V) one by one. query V case1 Cosine similarity (V) query V case2 )wait.

[0061] After calculating the vector similarity, this embodiment introduces a first threshold for filtering to ensure that the recalled candidate cases are highly relevant. The first threshold is a preset value (for example, when using cosine similarity, it can be set to 0.8, 0.85, etc.). Historical cases whose vector similarity score with the query text is greater than the first threshold are considered to be highly relevant to the query case and are thus filtered out to form a set of candidate cases.

[0062] Based on any of the above embodiments, based on key elements, a search is conducted in the legal knowledge base to obtain candidate legal provisions related to the case to be queried, including: Using the cause of action as a search tag, and combining it with key elements, semantic and / or keyword searches are conducted in the legal knowledge base to identify candidate legal provisions.

[0063] Considering that indiscriminately searching through massive legal knowledge bases is not only inefficient but also prone to recalling a large number of irrelevant legal provisions, interfering with subsequent analysis, this embodiment proposes a refined retrieval strategy that combines "tag pre-screening" and "multimodal retrieval" to address this issue.

[0064] Specifically, a search tag can be understood as a high-weight index used for initial screening and limiting the search scope. In this embodiment, the cause of action predicted in step 110 is used as the search tag because: when constructing the legal knowledge base, each legal provision or clause fragment can be pre-processed to associate one or more cause of action tags based on its content. For example, clauses concerning breach of contract liability can be pre-labeled with tags such as "sales contract dispute" or "contract for work dispute." When the search begins, the search scope is first narrowed from the entire legal knowledge base to the set of all legal provisions related to that cause of action using the search tag "sales contract dispute," greatly improving the targeting of the search.

[0065] Building upon this, and further combining the key elements extracted in step 110, a more refined search is performed within the pre-filtered set of legal provisions. This search can be semantic search, keyword search, or a combination of both. The semantic retrieval process can be as follows: the semantic vectors of key elements (such as "the goods have minor defects" or "refusal to pay the full amount") are compared with the semantic vectors of each legal provision in the legal provisions set to calculate the similarity, thereby recalling the legal provisions that are closest to the case in terms of legal concepts and connotations.

[0066] The keyword retrieval process can involve using core terms from key elements (such as "defect" or "payment") for precise or fuzzy text matching to ensure that key legal provisions containing these core legal terms are not overlooked.

[0067] Semantic retrieval and keyword retrieval can be performed in parallel and the results of the two can be merged. Alternatively, they can be performed according to a preset strategy (e.g., prioritizing semantic retrieval and using keyword retrieval as a supplement). This embodiment does not impose any specific limitations on this.

[0068] For example, if the predicted cause of action is "sales contract dispute," the key elements include {dispute focus: defective goods, refusal to pay}. In executing this embodiment: First, "sales contract dispute" is used as the search tag. All legal provisions tagged with this tag are filtered from the legal knowledge base. These provisions mainly focus on contract law and related sections. Then, within the filtered subset of legal provisions, the system performs a combined search for the key elements "defective goods" and "refusal to pay." Semantic retrieval finds clauses discussing "the quality of the subject matter not conforming to the agreement" and "the obligation to pay the price," while keyword retrieval ensures that clauses containing words such as "defect" are matched.

[0069] This embodiment pre-screens the legal knowledge base by using the cause of action as a search tag, and performs a mixed search of semantics and / or keywords by combining key elements, thereby achieving targeted, multi-dimensional, and high-precision retrieval of legal knowledge.

[0070] Based on any of the above embodiments, based on the cause of action, a search is conducted in the cause of action knowledge base to obtain candidate expert knowledge related to the cause of action, including: Determine the vector similarity between the causes of action and the causes of action knowledge base; The expert knowledge corresponding to the cause of action in the cause of action knowledge base with a vector similarity greater than the second threshold is selected as candidate expert knowledge.

[0071] This embodiment aims to measure the degree of correlation between the cause of action and the various causes of action pre-stored in the cause of action knowledge base through semantic-level computation. First, the cause of action (e.g., "sales contract dispute") is converted into a high-dimensional vector using a text embedding model. This vector is a mathematical representation of the semantic information of the cause of action text. At the same time, each cause of action stored in the cause of action knowledge base (serving as an index to the knowledge base) has also been pre-converted using a text embedding model and its corresponding vector has been stored.

[0072] Vector similarity is the similarity score between the vector of a cause of action and the vector of every cause of action in the knowledge base. This similarity score can be calculated using cosine similarity, which measures the similarity between two vectors by calculating the cosine of the angle between them in multidimensional space. Its value range is between [-1, 1], and the closer the value is to 1, the more similar the semantics of the two causes of action are.

[0073] The vector similarity-based matching method in this embodiment has better robustness and generalization ability compared to simple string exact matching. For example, even if the cause of action obtained after the user's query text is "contract dispute over the sale of goods", while the cause of action stored in the knowledge base is "sales contract dispute", the vector similarity calculation can still determine that the two are highly similar in semantics, thereby avoiding retrieval failure due to slight differences in wording.

[0074] In this embodiment, the second threshold is a preset value, such as 0.9. This threshold serves as a screening criterion to ensure that knowledge that is semantically close enough to the cause of action is recalled, thereby guaranteeing the quality and relevance of candidate expert knowledge.

[0075] After calculating the vector similarity between the cause of action and all causes of action in the cause of action knowledge base, if the similarity score of a cause of action in the cause of action knowledge base is greater than the set second threshold, then the cause of action is considered highly relevant to the user's query intent. In this case, the corresponding expert knowledge in the cause of action knowledge base (e.g., the legal elements of the cause of action, filing standards, relevant judicial interpretations, etc.) is extracted and included as part of the candidate expert knowledge. Conversely, if the similarity score is less than or equal to the second threshold, then its relevance is considered insufficient and it is not adopted.

[0076] Based on any of the above embodiments, and based on candidate cases, candidate legal provisions, and candidate expert knowledge, an answer text for the query text is generated, including: By integrating candidate cases, candidate legal provisions, candidate expert knowledge, and query texts, a fused text is obtained. Using a large language model and applying fused text, a correlation analysis was conducted on candidate cases and candidate legal provisions, and the candidate cases and candidate legal provisions were ranked based on the correlation analysis results. Based on the sorting results, related cases and related legal provisions are obtained by filtering from candidate cases and candidate legal provisions; The answer text is generated based on related cases, related legal provisions, and the knowledge of candidate experts.

[0077] In this embodiment, the purpose of multi-path parallel retrieval (steps 120, 130, 140) is to maximize the recall of all potentially relevant information, but this information is scattered and unfiltered in the initial stage. In order for the subsequent language model to perform unified, context-aware analysis, it is necessary to fuse this scattered information with the query text to construct a fused text that contains the original query intent and all candidate information.

[0078] The fused text can be understood as a temporary, content-rich set of contextual data or a structured prompt. It organizes and combines the user's original query text with all candidate information retrieved from three different knowledge bases according to a preset format.

[0079] As an alternative implementation, a JSON structure or concatenated text block containing the following fields can be constructed as the merged text: The query text reads: "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount on the grounds that the goods had minor defects. Is Company B's behavior legal, and how should Company A protect its rights?"

[0080] Key elements: {Contract type: Sales contract for goods}, {Points of contention: Defects in goods, refusal to pay}, etc.

[0081] Candidate cases: [Summary of Case A...], [Summary of Case B...], [Summary of Case C...].

[0082] Candidate legal provisions: [Article X of the Law...], [Article Y of the Law...], [Article Z of the Law...].

[0083] Candidate expert knowledge: "Definition of 'fundamental breach'...", "Regulations on the inspection of the subject matter...".

[0084] By generating this fused text, a complete and comprehensive information foundation is provided for subsequent refining and screening steps.

[0085] Furthermore, considering that while the candidate cases and legal provisions returned in the initial retrieval have a certain degree of relevance, their matching degree with the case to be queried varies, directly using all candidate information would introduce noise and affect the accuracy of the answer. Therefore, this embodiment introduces a fine-grained ranking process based on a large language model.

[0086] Specifically, relevance analysis refers to leveraging the powerful semantic understanding and reasoning capabilities of large-scale language models (which can be general-purpose models or specialized models distilled from judicial data) to deeply assess the correlation between each candidate case and each candidate legal provision in the fused text and its query text and key elements. The model evaluates the degree to which each candidate piece of information fits the case in terms of factual composition, points of contention, and applicable law, and provides a relevance score or a ranking result.

[0087] For example, in the above cases, large-scale language model analysis revealed that although Case A is also a sales contract dispute, the focus of the dispute is "delayed delivery," which deviates significantly from the core issue of "defective goods," thus receiving a lower relevance score. Cases B and C, on the other hand, both involve the scenario of "partial defects in goods, with the buyer refusing to pay the full amount," making them highly relevant to the target case and therefore receiving higher scores. Ultimately, the model outputs a list of candidate cases and candidate legal provisions, sorted by relevance from highest to lowest.

[0088] Next, based on the ranking results, related cases and related legal provisions are selected from the candidate cases and candidate legal provisions. The selection rules can be varied. As one optional embodiment, a fixed threshold can be set; for example, the top two most relevant candidate cases can be selected as related cases, and the top three most relevant candidate legal provisions can be selected as related legal provisions. As another optional embodiment, a relevance score threshold can be set, and all candidate cases and candidate legal provisions with scores higher than this threshold can be selected as related cases and related legal provisions.

[0089] After filtering out relevant cases and legal provisions, the query text, relevant cases, relevant legal provisions, and candidate expert knowledge are combined again to form a highly refined and focused final context, which is then input into the generative model (large-scale language model). Because the input context has less noise, stronger relevance, and higher quality, the model can perform logical reasoning and language organization more accurately, generating the final answer text.

[0090] For example, the model can generate more accurate and well-founded answers based on the two highest-scoring related cases, the three most relevant related legal provisions, and expert knowledge on sales contract disputes, avoiding the confusion caused by citing irrelevant precedents or legal provisions.

[0091] Based on any of the above embodiments, based on the query text, predicting the cause of action of the case to be queried and extracting key elements related to the case to be queried, further includes: The query text is identified by question type, and the existence of the corresponding question-answer pair in the distillation database is determined based on the identified type. If the question-answer pair corresponding to the query text exists in the distillation database, the answer text is retrieved from the distillation data based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is legal provision retrieval, the answer text is obtained by searching the legal provision database based on the query text. When the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is detailed case analysis, the large language model is used to perform case analysis on the query text to obtain the answer text; When the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is a brief case analysis, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted based on the query text.

[0092] In this embodiment, upon receiving a user's query text, the first step is to identify the question type. This step can utilize a classifier to determine the intent of the query text and categorize it into a preset type. The preset types may include legal provision retrieval, brief case analysis, detailed case analysis, and general types.

[0093] Among these, legal retrieval categories can be understood as where the user's intent is clearly to search for specific legal provisions. For example, "What are the provisions regarding the right to terminate a contract in the '... Law'?"

[0094] Brief case analysis can be understood as users providing a specific case description, hoping to get a preliminary characterization, similar case recommendations, or legal guidance. For example, "Company A and Company B signed a goods sales contract worth 500,000 yuan. After Company A delivered the goods on time, Company B refused to pay the full amount on the grounds that the goods had minor defects..."

[0095] Detailed case analysis questions can be understood as questions raised by users that are more macro-level and open-ended, requiring in-depth and multi-faceted comprehensive analysis, which may go beyond the scope of structured search. For example, "Please analyze the legal risks our company may face in supply chain finance business, taking into account recent judicial policies."

[0096] General-purpose questions can be understood as routine natural language interactions that are not directly related to knowledge-based questions in a specific professional field (e.g., the legal field). Examples include simple greetings (such as "Hello"), questions related to system functions (such as "What can you do?"), or general knowledge-based questions that do not belong to a professional field (such as "How is the weather today?").

[0097] After identifying the question type, the distillation database is further queried. The distillation database can be a pre-built cache of high-frequency question-answer pairs, generated through data distillation technology. This involves using a powerful generalized large language model to generalize, reason, and summarize massive amounts of historical queries and professional knowledge to generate high-quality, question-answer pairs that are "standard answers" for specific questions. These question-answer pairs are then stored to "distill" the knowledge from the generalized large model and migrate it to a smaller, more economical, and faster-responding dedicated knowledge base to handle high-concurrency common question queries.

[0098] Based on the above identification and query results, the traffic splitting process is performed according to the following logic: Scenario 1: If it is determined that the question-and-answer pair corresponding to the user's query text exists in the distillation database, the pre-stored answer text is directly extracted from the distillation database and returned to the user. For example, the distillation database already contains a question-and-answer pair, the question of which is: "If the buyer refuses to pay for the goods without a legitimate reason after receiving them, what should the seller do?". When a user enters a query text as: "What should I do if Company B refuses to pay after Company A has shipped the goods?", although the two expressions are different, semantic analysis can identify that they are asking the same core question, and their text vectors will be very close in the vector space. Therefore, it is determined that the user's query text corresponds to an existing question-and-answer pair, and this path is triggered, directly returning the pre-stored answer text from that question-and-answer pair.

[0099] Scenario 2: If the question-answer pair corresponding to the query text does not exist in the distillation database, and the question type is identified as a legal provision retrieval, a lightweight dedicated retrieval subroutine will be launched. This program directly performs keyword or semantic searches in the legal provision database (a database specifically storing legal and regulatory provisions) and returns the original text of the retrieved legal provisions as the answer text.

[0100] Scenario 3: If the question-answer pair does not exist in the distillation database and the question type is identified as a detailed case analysis type, considering the complexity and openness of this type of question, a large language model is directly invoked, with the user's query text as input, so that the large language model can use its powerful general knowledge and reasoning ability to directly analyze and generate the answer text.

[0101] Scenario 4: When the question-answer pair does not exist in the distillation database and the question type is identified as a brief case analysis, a three-way parallel retrieval process is initiated. That is, the program will continue to execute step 110 (based on the query text, predict the cause of action of the case to be queried and extract key elements related to the case to be queried), and execute steps 120, 130, 140 and 150 in sequence. Through multi-dimensional knowledge fusion and enhanced generation, a deep and accurate case analysis result is provided to the user.

[0102] Based on any of the above embodiments Figure 2 This is a flowchart illustrating another question-and-answer method provided by the present invention, as shown below. Figure 2 As shown, the method includes: First, the query text is obtained, and the question type is identified. Next, based on the identified type, it is determined whether the corresponding question-answer pair exists in the distillation database. If so, the answer text is retrieved from the distillation database.

[0103] If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is legal provision retrieval, then the answer text is obtained by searching the legal provision database based on the query text.

[0104] If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is detailed case analysis, then the large language model is used to perform case analysis on the query text to obtain the answer text.

[0105] If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is general knowledge question-answer, then the query text is analyzed using a large language model to obtain the answer text.

[0106] If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is a brief case analysis, then based on the query text, the cause of action is predicted and key elements are extracted, and a three-way parallel retrieval is performed according to the following path: Path 1: Based on key elements, search the case knowledge base to obtain candidate cases related to the case to be queried.

[0107] Path 2: Based on key elements, search the legal knowledge base to obtain candidate legal provisions related to the case to be queried.

[0108] Path 3: Based on the cause of action, search the cause of action knowledge base to obtain candidate expert knowledge related to the cause of action.

[0109] The candidate cases, candidate legal provisions, candidate expert knowledge, and query text are input into a large language model to obtain the answer text.

[0110] The question-and-answer device provided by the present invention is described below. The question-and-answer device described below can be referred to in correspondence with the question-and-answer method described above.

[0111] Based on any of the above embodiments Figure 3 This is a schematic diagram of the question-and-answer device provided by the present invention, as shown below. Figure 3 As shown, the device includes: The prediction unit 310 is used to predict the cause of action of the case to be queried and extract key elements related to the case to be queried based on the query text. The query text is natural language text containing a description of the case to be queried. The first retrieval unit 320 is used to retrieve candidate cases related to the case to be queried from the case knowledge base based on key elements. The second retrieval unit 330 is used to retrieve candidate legal provisions related to the case to be queried from the legal knowledge base based on key elements. The third retrieval unit 340 is used to retrieve candidate expert knowledge related to the cause of action from the cause of action knowledge base based on the cause of action. The generation unit 350 is used to generate the answer text of the query text based on the candidate cases, candidate legal provisions and candidate expert knowledge.

[0112] Based on any of the above embodiments, based on the query text, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted, including: Extract case description text from query text; Based on the case description text, predict the cause of action for the case to be queried; Based on the cause of action, key elements are extracted from the case description text.

[0113] Based on any of the above embodiments, based on key elements, a search is conducted in the case knowledge base to obtain candidate cases related to the case to be queried, including: Determine the vector similarity between key elements and key elements pre-stored in each historical case in the case knowledge base; Historical cases with vector similarity greater than the first threshold in the case knowledge base are selected as candidate cases.

[0114] Based on any of the above embodiments, based on key elements, a search is conducted in the legal knowledge base to obtain candidate legal provisions related to the case to be queried, including: Using the cause of action as a search tag, and combining it with key elements, semantic and / or keyword searches are conducted in the legal knowledge base to identify candidate legal provisions.

[0115] Based on any of the above embodiments, based on the cause of action, a search is conducted in the cause of action knowledge base to obtain candidate expert knowledge related to the cause of action, including: Determine the vector similarity between the causes of action and the causes of action knowledge base; The expert knowledge corresponding to the cause of action in the cause of action knowledge base with a vector similarity greater than the second threshold is selected as candidate expert knowledge.

[0116] Based on any of the above embodiments, and based on candidate cases, candidate legal provisions, and candidate expert knowledge, an answer text for the query text is generated, including: By integrating candidate cases, candidate legal provisions, candidate expert knowledge, and query texts, a fused text is obtained. Using a large language model and applying fused text, a correlation analysis was conducted on candidate cases and candidate legal provisions, and the candidate cases and candidate legal provisions were ranked based on the correlation analysis results. Based on the sorting results, related cases and related legal provisions are obtained by filtering from candidate cases and candidate legal provisions; The answer text is generated based on related cases, related legal provisions, and the knowledge of candidate experts.

[0117] Based on any of the above embodiments, based on the query text, predicting the cause of action of the case to be queried and extracting key elements related to the case to be queried, further includes: The query text is identified by question type, and the existence of the corresponding question-answer pair in the distillation database is determined based on the identified type. If the question-answer pair corresponding to the query text exists in the distillation database, the answer text is retrieved from the distillation database based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is legal provision retrieval, the answer text is obtained by searching the legal provision database based on the query text. When the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is detailed case analysis, the large language model is used to perform case analysis on the query text to obtain the answer text; When the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is a brief case analysis, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted based on the query text.

[0118] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can invoke logical instructions in the memory 430 to execute a question-and-answer method. This method includes: predicting the cause of action of a case to be queried and extracting key elements related to the case based on a query text, wherein the query text is natural language text containing a description of the case; retrieving candidate cases related to the case based on the key elements in a case knowledge base; retrieving candidate legal provisions related to the case based on the key elements in a legal knowledge base; retrieving candidate expert knowledge related to the cause of action in a cause-of-action knowledge base based on the cause of action; and generating an answer text for the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge.

[0119] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0120] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the question-answering method provided by the above methods. The method includes: predicting the cause of action of a case to be queried and extracting key elements related to the case to be queried based on a query text, wherein the query text is natural language text containing a description of the case to be queried; retrieving candidate cases related to the case to be queried based on the key elements in a case knowledge base; retrieving candidate legal provisions related to the case to be queried based on the key elements in a legal knowledge base; retrieving candidate expert knowledge related to the cause of action based on the cause of action in a cause of action knowledge base; and generating an answer text for the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge.

[0121] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the question-answering methods provided by the methods described above. The method includes: predicting the cause of action of a case to be queried based on a query text and extracting key elements related to the case to be queried, wherein the query text is natural language text containing a description of the case to be queried; retrieving candidate cases related to the case to be queried based on the key elements in a case knowledge base; retrieving candidate legal provisions related to the case to be queried based on the key elements in a legal knowledge base; retrieving candidate expert knowledge related to the cause of action based on the cause of action in a cause-of-action knowledge base; and generating an answer text for the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge.

[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A question-and-answer method, characterized in that, include: Based on the query text, the cause of action of the case to be queried is predicted and key elements related to the case to be queried are extracted. The query text is natural language text containing a description of the case to be queried. Based on the aforementioned key elements, a search is conducted in the case knowledge base to obtain candidate cases related to the case to be queried; Based on the aforementioned key elements, a search is conducted in the legal knowledge base to obtain candidate legal provisions related to the case to be queried; Based on the stated cause of action, a search is conducted in the cause of action knowledge base to obtain candidate expert knowledge related to the stated cause of action; Based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge, the answer text for the query text is generated.

2. The question-and-answer method according to claim 1, characterized in that, The process of predicting the cause of action of a case based on the query text and extracting key elements related to the case includes: Extract the case description text from the query text; Based on the case description text, predict the cause of action for the case to be queried; Based on the stated cause of action, the key elements are extracted from the case description text.

3. The question-and-answer method according to claim 1, characterized in that, Based on the key elements, the process of retrieving candidate cases related to the case to be queried from the case knowledge base includes: Determine the vector similarity between the key elements and the key elements pre-stored in each historical case in the case knowledge base; Historical cases in the case knowledge base with a vector similarity greater than a first threshold are selected as candidate cases.

4. The question-and-answer method according to claim 1, characterized in that, Based on the aforementioned key elements, a search is conducted in the legal knowledge base to obtain candidate legal provisions related to the case to be queried, including: Using the stated cause of action as a search tag, and combining it with the stated key elements, semantic search and / or keyword search are performed in the legal knowledge base to determine the candidate legal provisions.

5. The question-and-answer method according to claim 1, characterized in that, Based on the cause of action, the step of searching the cause of action knowledge base to obtain candidate expert knowledge related to the cause of action includes: Determine the vector similarity between the stated cause of action and each cause of action in the cause of action knowledge base; The expert knowledge corresponding to the case types in the case type knowledge base whose vector similarity is greater than the second threshold is used as the candidate expert knowledge.

6. The question-and-answer method according to claim 1, characterized in that, The step of generating the answer text for the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge includes: By integrating the candidate cases, the candidate legal provisions, the candidate expert knowledge, and the query text, a fused text is obtained. Using a large language model, the fused text is applied to perform a correlation analysis on the candidate cases and the candidate legal provisions, and the candidate cases and the candidate legal provisions are ranked based on the correlation analysis results; Based on the sorting results, related cases and related legal provisions are obtained by filtering from the candidate cases and the candidate legal provisions; The answer text is generated based on the related cases, the related legal provisions, and the knowledge of the candidate experts.

7. The question-and-answer method according to claim 1, characterized in that, The process of predicting the cause of action of the case to be queried based on the query text and extracting key elements related to the case to be queried also includes, prior to: The query text is identified by question type, and the existence of the question-answer pair corresponding to the query text in the distillation database is determined based on the identified type. If the question-answer pair corresponding to the query text exists in the distillation database, the answer text is obtained by searching the distillation database based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identification type is legal provision retrieval, the answer text is obtained by searching the legal provision database based on the query text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the type of identification is detailed case analysis, the query text is analyzed using a large language model to obtain the answer text. If the question-answer pair corresponding to the query text does not exist in the distillation database and the identified type is a brief case analysis, the cause of action of the case to be queried is predicted based on the query text, and key elements related to the case to be queried are extracted.

8. A question-and-answer device, characterized in that, include: The prediction unit is used to predict the cause of action of a case to be queried and extract key elements related to the case to be queried based on the query text, wherein the query text is natural language text containing a description of the case to be queried. The first retrieval unit is used to retrieve candidate cases related to the case to be queried from the case knowledge base based on the key elements. The second retrieval unit is used to retrieve candidate legal provisions related to the case to be queried from the legal knowledge base based on the key elements. The third retrieval unit is used to retrieve candidate expert knowledge related to the cause of action from the cause of action knowledge base based on the cause of action. The generation unit is used to generate the answer text of the query text based on the candidate cases, the candidate legal provisions, and the candidate expert knowledge.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the question-and-answer method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the question-and-answer method as described in any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the question-and-answer method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Related information recommendation method and device for complaint case, and storage medium

    CN112507110A

  • Case analysis application method and device based on large model

    CN118779441A

  • Slow-thinking-mode legal question answering method and device based on judge visual angle

    CN119719296A

  • Similar case retrieval method based on large model fusion multi-level legal element generation

    CN119989074A

  • Intelligent question answering system based on large language model and knowledge base

    CN120632014A