Intelligent legal question-answering method, device and system and related equipment
By generating scenario-specific question feature vectors and retrieving multiple knowledge bases, and optimizing the processing of candidate answers, the system addresses the shortcomings of existing legal question-answering systems in terms of professionalism and practicality, achieving more accurate and personalized legal answers.
Patent Information
- Application Number
- CN202610002774.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-04
- Publication Date
- 2026-03-31
AI Technical Summary
Existing legal intelligent question-answering systems lack the ability to dynamically adapt to different scenarios when dealing with legal issues at multiple levels, resulting in insufficient professionalism and practicality of the answers.
By receiving legal question text input from target users, obtaining scenario tags and historical interaction data, generating scenario-specific question feature vectors, and simultaneously searching legal provisions, case libraries, and practice guide libraries, the system performs optimization processing to generate answer content, including verification of logical consistency and time validity.
It achieves a precise understanding of legal issues, provides more professional and practical answers, and improves the system's adaptability to complex scenarios and the comprehensiveness and reliability of its solutions.
Smart Images

Figure CN121765057A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a legal intelligent question-answering method, device, system and related equipment. Background Technology
[0002] In the field of intelligent legal question answering, existing systems primarily rely on single question-answering models or legal knowledge bases, facing challenges in handling multi-scenario and multi-level legal issues. For example, some systems can only provide basic legal provision searches, lacking comprehensive consideration of legal cases and practical operational points, resulting in insufficient professionalism and practicality in the answers. Furthermore, current intelligent legal question answering systems often lack dynamic scenario adaptation capabilities in question understanding, making it difficult to provide personalized question analysis based on different user identities and historical interaction data.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] This disclosure provides a legal intelligent question-and-answer method, device, system, and related equipment, which at least to some extent overcomes the technical problem that the answers provided by legal question-and-answer systems in related technologies lack professionalism and practicality.
[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.
[0006] According to one aspect of this disclosure, a legal intelligent question-answering method is provided, comprising: receiving legal question text input by a target user; obtaining scene tags of the legal question text and historical interaction data of the target user; generating a scene-specific question feature vector based on the legal question text, the scene tags, and the historical interaction data; simultaneously searching multiple knowledge bases based on the question feature vector to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guide database; and optimizing the candidate answers to obtain the answer content of the legal question text.
[0007] In some embodiments, generating a scenario-specific problem feature vector based on the legal issue text, the scenario tag, and the historical interaction data includes: generating a problem element vector based on the legal issue text, wherein the problem element vector includes at least one of the following: a subject feature vector, a behavior feature vector, and a consequence feature vector; generating a scenario tag embedding vector based on the scenario tag; generating a historical interaction vector based on the historical interaction data; and performing weighted fusion of the problem element vector, the scenario tag embedding vector, and the historical interaction vector to obtain a scenario-specific problem feature vector.
[0008] In some embodiments, the process of simultaneously retrieving multiple knowledge bases based on the question feature vector to obtain candidate answers includes: calculating the semantic similarity between the question feature vector and knowledge nodes, wherein the knowledge nodes are nodes obtained by vectorizing the knowledge in each knowledge base; and outputting a preset number of candidate answers sorted first according to the semantic similarity from largest to smallest, wherein the number of candidate answers is configured according to the identity information of the target user.
[0009] In some embodiments, calculating the semantic similarity between the problem feature vector and the vectorized knowledge node includes: calculating the first semantic similarity between the problem feature vector and the first knowledge node; if the first semantic similarity exceeds a preset threshold and the first knowledge node and the second knowledge node are related, then calculating the second semantic similarity between the problem feature vector and the second knowledge node; and weighting and fusing the first semantic similarity and the second semantic similarity to obtain a comprehensive semantic similarity.
[0010] In some embodiments, optimizing the candidate answers to obtain the solution content of the legal question text includes: performing multi-dimensional verification on the candidate answers, wherein the multi-dimensional verification includes: logical consistency verification and / or time validity verification; and performing corresponding scenario adaptability optimization on the candidate answers based on the identity information of the target user, and outputting the solution content including conclusion information, legal basis, case number and practical guidance.
[0011] According to another aspect of this disclosure, a legal intelligent question-and-answer device is also provided, comprising: a user interaction module for receiving legal question text input by a target user; a data acquisition module for acquiring scene tags of the legal question text and historical interaction data of the target user; a question feature vector generation module for generating scene-specific question feature vectors based on the legal question text, the scene tags, and the historical interaction data; a candidate answer retrieval module for simultaneously retrieving multiple knowledge bases based on the question feature vectors to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guide database; and an answer generation module for optimizing the candidate answers to obtain the answer content of the legal question text.
[0012] According to another aspect of this disclosure, a legal intelligent question-answering system is also provided, comprising: an input module for receiving legal question text input by a target user, obtaining scene tags of the legal question text and historical interaction data of the target user; a dynamic scene adaptation module for generating a scene-specific question feature vector based on the legal question text, the scene tags, and the historical interaction data; a multi-source knowledge fusion module for simultaneously searching multiple knowledge bases based on the question feature vector to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guidance database; a multi-dimensional verification and optimization module for performing multi-dimensional verification and scene adaptability optimization processing on the candidate answers; and an output module for outputting answer content containing conclusion information, legal provisions, case numbers, and practical guidance.
[0013] According to another aspect of this disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the legal intelligent question-answering method described in any of the preceding claims by executing the executable instructions.
[0014] According to another aspect of this disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the legal intelligent question-and-answer method described in any of the preceding claims.
[0015] According to another aspect of this disclosure, a computer program product is also provided, comprising: a computer program or instructions that, when executed by a processor, implement the legal intelligent question-answering method described in any one of the preceding claims.
[0016] The legal intelligent question-answering method, apparatus, system, and related equipment provided in this disclosure embodiment receive legal question text input by a target user; obtain scene tags of the legal question text and historical interaction data of the target user; generate scene-specific question feature vectors based on the legal question text, scene tags, and historical interaction data; simultaneously search multiple knowledge bases based on the question feature vectors to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: legal provisions database, case database, and practical guide database; optimize the candidate answers to obtain the answer content of the legal question text.
[0017] This disclosure, through dynamic scene adaptation and multi-source knowledge fusion, enables a precise understanding of legal issues and provides more professional and practical legal answers.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0020] Figure 1 This diagram illustrates an application system architecture according to an embodiment of the present disclosure. Figure 2 This diagram illustrates a flowchart of a legal intelligent question-and-answer method according to an embodiment of the present disclosure; Figure 3 This diagram illustrates a flowchart of a problem feature vector generation method according to an embodiment of the present disclosure. Figure 4 This diagram illustrates a candidate answer generation flowchart according to an embodiment of the present disclosure; Figure 5 This diagram illustrates an extended retrieval flowchart according to an embodiment of the present disclosure; Figure 6 This diagram illustrates a flowchart of a method for verifying and optimizing candidate answers according to an embodiment of the present disclosure. Figure 7 This diagram illustrates a legal intelligent question-and-answer device according to an embodiment of the present disclosure; Figure 8 This diagram illustrates a legal intelligent question-and-answer system according to an embodiment of the present disclosure; Figure 9 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0021] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0022] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0023] To facilitate understanding, before introducing the embodiments of this disclosure, the following explanations are provided for several terms involved in the embodiments of this disclosure: Generative Language Model: This refers to an artificial intelligence model based on deep learning technology, trained on massive amounts of text data, with a large number of parameters (usually in the billions to hundreds of billions), which can predict and generate coherent natural language text based on input content.
[0024] Large Model: A machine learning model with a large number of parameters and a complex structure, capable of processing massive amounts of data and performing various complex tasks, such as natural language processing, computer vision, and speech recognition.
[0025] The specific implementation methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0026] Figure 1 This diagram illustrates an application system architecture according to an embodiment of the present disclosure. Figure 1 As shown, the system architecture may include terminal device 101, network 102 and server 103.
[0027] Network 102 is a medium used to provide a communication link between terminal device 101 and server 103, and can be a wired network or a wireless network.
[0028] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats, including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPSec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0029] In this disclosure, the terminal device 101 refers to an entity on the user side used to receive or transmit signals, and may also be referred to as a terminal, mobile station (MS), mobile terminal (MT), etc. This disclosure does not limit the specific technology or device form used in the terminal.
[0030] In some embodiments of this disclosure, the terminal device 101 may be a mobile phone, tablet computer, laptop computer, notebook computer, personal digital assistant (PDA), handheld computer, netbook, ultra-mobile personal computer (UMPC), mobile internet device (MID), augmented reality (AR), virtual reality (VR) device, robot, wearable device, flight vehicle, vehicle user equipment (VUE), shipboard equipment, pedestrian user equipment (PUE), smart home (home devices with wireless communication capabilities, such as refrigerators, televisions, washing machines, or furniture), game console, personal computer (PC), ATM, or self-service machine, etc. Wearable devices include: smartwatches, smart bracelets, smart earphones, smart glasses, smart jewelry (smart bracelets, smart chains, smart rings, smart necklaces, smart anklets, smart anklets, etc.), smart wristbands, smart clothing, etc. Among these, in-vehicle devices can also be referred to as in-vehicle terminals, in-vehicle controllers, in-vehicle modules, in-vehicle components, in-vehicle chips, or in-vehicle units, etc. It should be noted that the specific type of terminal device 101 is not limited in the embodiments disclosed herein.
[0031] Optionally, the client of the application installed on different terminal devices 101 may be the same, or the client of the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client may also be different; for example, the application client may be a mobile client, a PC client, etc.
[0032] Server 103 can be a server that provides various services, such as a backend management server that supports the device operated by the user using terminal device 101. The backend management server can analyze and process received requests and other data, and feed the processing results back to the terminal device.
[0033] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0034] Those skilled in the art will know that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.
[0035] Under the above system architecture, this disclosure provides a legal intelligent question-answering method, which can be executed by any electronic device with computing power.
[0036] In some embodiments, the intelligent legal question-answering method provided in this disclosure can be executed by a terminal device of the above-described system architecture; in other embodiments, the intelligent legal question-answering method provided in this disclosure can be executed by a server in the above-described system architecture; in still other embodiments, the intelligent legal question-answering method provided in this disclosure can be implemented by the terminal device and the server in the above-described system architecture through interaction.
[0037] Figure 2 This invention discloses a flowchart of a legal intelligent question-answering method according to an embodiment of the present invention, such as... Figure 1 As shown, the intelligent legal question-answering method provided in this embodiment includes the following steps: S202, Receive legal question text input by the target user.
[0038] It should be noted that, in this embodiment of the disclosure, the target user refers to the user who raises a legal question, which can be an individual user or a corporate user. The legal question text refers to the legal question presented in text form, which can be text directly input by the target user or converted from other data input by the target user. For example, when a user inputs a voice message, the voice data can be converted into text data using speech recognition software.
[0039] S204, Obtain the scenario tags of the legal issue text and the target user's historical interaction data.
[0040] In this embodiment, scenario tags refer to tags used to categorize the field or context to which legal issues belong. Common scenario tags include "labor contract disputes," "private lending," "intellectual property infringement," and "marital and family property division." Scenario tags help the system quickly locate the legal scope of a legal issue. Historical interaction data can be the interaction data between the target user and the legal Q&A system within a historical time period, including but not limited to legal questions previously submitted by the target user, the answers provided by the system, and user feedback on the answers (such as satisfaction level or whether follow-up questions were asked). This historical interaction data can be used to understand user needs and preferences, improving the relevance of subsequent answers.
[0041] In some embodiments, scene tags may be directly entered by the target user; in other embodiments, scene tags may be automatically generated by the system based on legal question text entered by the target user.
[0042] S206 generates a scenario-specific problem feature vector based on legal issue text, scenario tags, and historical interaction data.
[0043] In this embodiment of the disclosure, the scenario-specific problem feature vector refers to a feature vector customized for the scenario label of the current legal issue. For example, the feature vector for a labor dispute scenario would focus on dimensions such as labor relations, labor contract terms, and labor arbitration procedures, while the feature vector for a private lending scenario would focus on dimensions such as loan contracts, interest rate regulations, and repayment periods. The problem feature vector refers to the transformation of unstructured legal issue text, scenario labels, and historical interaction data into a computer-recognizable vectorized representation.
[0044] S208. Based on the question feature vector, multiple knowledge bases are searched simultaneously to obtain candidate answers. Among them, the multiple knowledge bases include at least one of the following: legal provisions base, case base, and practical guide base.
[0045] It should be noted that using question feature vectors as the retrieval basis and simultaneously querying multiple knowledge bases in parallel can improve retrieval efficiency and quickly integrate information from multiple sources. In this embodiment, the database set storing legally related structured information is the core data support for the legal question-and-answer system, and common types include: ① Legal provisions database: refers to a database used to store currently effective laws, administrative regulations, local regulations, judicial interpretations and other normative documents, such as the provisions of the Civil Code, the Labor Contract Law and the Criminal Law; ②Case Library: This refers to a database used to store effective judgments that have been adjudicated by the courts, including case introductions, key points of the judgments, and judgment results. Cases can be used to refer to judicial handling methods in similar situations. ③ Practical Guide Library: This refers to a database used to store practical legal operation guidelines, such as "Labor Arbitration Application Process", "Evidence Collection Techniques in Civil Litigation", and "Contract Drafting Precautions", focusing on solving practical operational problems.
[0046] S210: Optimize the candidate answers to obtain the solution content of the legal question text.
[0047] In order to generate legal question answers that better meet user needs, in this embodiment of the disclosure, after retrieving candidate answers, the candidate answers are optimized to obtain the answer content of the legal question text.
[0048] In some embodiments, such as Figure 3 As shown, the intelligent legal question-answering method provided in this embodiment can generate scenario-specific question feature vectors through the following steps: S302, Based on the legal issue text, generate an issue element vector, wherein the issue element vector includes at least one of the following: subject feature vector, behavior feature vector, and consequence feature vector; S304, Generate scene tag embedding vectors based on scene tags; S306, Generate historical interaction vectors based on historical interaction data; S308 performs weighted fusion of the problem element vector, scene label embedding vector, and historical interaction vector to obtain a scene-specific problem feature vector.
[0049] It should be noted that the problem element vector refers to a vector that numerically represents the core constituent elements of a legal issue text. It is a structured data carrier obtained after deconstructing key information of a legal issue, used to accurately depict the core demands of the issue. It differs from the overall problem feature vector, focusing more on the elemental dimensions of the issue itself. The subject feature vector refers to a sub-vector that numerically models the attributes of the subjects involved in the legal issue. Subjects include natural persons, enterprises, and administrative organs, etc. The vector dimensions can cover features such as subject type (e.g., individual / legal person), subject identity (e.g., employee / employer, creditor / debtor), and inter-subject relationship (e.g., contracting parties, tortfeasor and injured party). The behavioral feature vector refers to a sub-vector that numerically extracts the nature, type, and method of core behaviors in a legal issue. Core behaviors include contract signing / breach of contract, tort (e.g., plagiarism, personal injury), and labor employment (e.g., dismissal, overtime), etc. The vector dimensions can cover features such as the legality of the behavior, the type of behavior, and the method of implementation of the behavior. The consequence feature vector refers to a sub-vector that numerically represents the results or demands arising from the behavior in a legal issue. Consequences include property loss, personal injury, and failure to achieve the purpose of the contract. Claims include compensation, termination of the contract, and liability for breach of contract. The vector dimension can cover characteristics such as the severity of consequences, the type of claim, and quantitative indicators of loss.
[0050] In practice, the weight information for weighted fusion of problem element vector, scene tag embedding vector, and historical interaction vector can be configured according to the actual situation. For example, when the user's problem scenario is clear, the weight of the scene tag embedding vector will be increased; when the user's historical interaction data is highly relevant to the current problem, the weight of the historical interaction vector will be increased.
[0051] In this embodiment, legal issues are decomposed into three core element vectors: subject, behavior, and consequence, rather than using a vague representation of the entire text. This structured decomposition accurately captures the key attributes of legal issues, such as distinguishing the behavioral differences between "employee's voluntary resignation" and "employer's dismissal," and the consequence differences between "property loss" and "personal injury," effectively avoiding misunderstandings caused by ambiguity in natural language and laying an accurate foundation for subsequent retrieval and answers. Converting discrete scenario classification labels into dense vectors recognizable by computers can capture the connections and differences between different legal scenarios (such as the subtle differences between "labor contract disputes" and "service contract disputes"). Compared to traditional label matching methods, vectorized representation supports semantic-level scenario matching, accurately classifying even non-standard question expressions into corresponding legal scenarios, improving the system's adaptability to complex scenarios. The system incorporates users' past questioning preferences and needs into the feature representation. For example, if a user has repeatedly consulted on practical labor arbitration issues, the system will strengthen the weight of the "practical operation" dimension in the feature vector; if the user is more concerned with legal provisions, the system will emphasize the legal provision relevance dimension. This personalized modeling allows the system to output solutions that better meet the user's needs.
[0052] In this embodiment, the generated scenario-specific question feature vector serves as the core basis for subsequent synchronous retrieval across multiple knowledge bases (legal provisions, case studies, and practical guidelines), accurately locating legal provisions, case studies, and practical guidelines that match the question. On one hand, vector-based retrieval is far more efficient than traditional keyword retrieval, enabling parallel queries across multiple knowledge bases; on the other hand, candidate answers retrieved based on precise feature vectors have stronger relevance, reducing the cost of filtering invalid information and ultimately optimizing the comprehensiveness and reliability of the answer content.
[0053] In some embodiments, such as Figure 4 As shown, the intelligent legal question-answering method provided in this embodiment can generate candidate answers through the following steps: S402, calculate the semantic similarity between the problem feature vector and the knowledge node, where the knowledge node is the node obtained by vectorizing the knowledge in each knowledge base; S404: Output a preset number of candidate answers in descending order of semantic similarity. The number of candidate answers is configured based on the target user's identity information.
[0054] In this embodiment, semantic similarity is a quantitative indicator that measures the degree of semantic matching between the problem feature vector and the knowledge node vector. The value range is usually [0,1], and the closer the value is to 1, the higher the semantic correlation between the two. For example, the semantic similarity between the problem vector of "labor contract breach claim" and the knowledge node vector of "breach of contract liability clause in the Civil Code" will be significantly higher than that between the problem vector of "intellectual property infringement clause" and the knowledge node vector of "intellectual property infringement clause".
[0055] In this embodiment, the vector carrier obtained by vectorizing the discrete knowledge units in the knowledge base is the smallest retrieval unit of the knowledge base. Knowledge nodes in different types of knowledge bases correspond to different content: ① Legal provisions: knowledge nodes may correspond to a single legal provision (such as Article 39 of the Labor Contract Law) or key clauses within a legal provision; ② Case studies: knowledge nodes may correspond to the key points of a single case's judgment or a case summary; ③ Practical guides: knowledge nodes may correspond to specific practical operation steps or precautions.
[0056] In this embodiment of the disclosure, the target user's identity information is used as attribute data to distinguish user types. The user identity here can be, but is not limited to, "ordinary individual," "corporate legal counsel," or "lawyer." Different user identities have different needs for candidate answers. For example, corporate legal counsel may need more candidate cases and practical guidance (preset quantity is set to 20), while ordinary individuals need concise legal provisions and answers (preset quantity is set to 5).
[0057] Optionally, in some embodiments, the legal intelligent question-answering method provided in this disclosure can calculate the semantic similarity between the question feature vector and the vectorized knowledge node through the following steps: S4022, Calculate the first semantic similarity between the problem feature vector and the first knowledge node; S4024, If the first semantic similarity exceeds the preset threshold and the first knowledge node and the second knowledge node are related, then calculate the second semantic similarity between the problem feature vector and the second knowledge node; S4026, the first semantic similarity and the second semantic similarity are weighted and fused to obtain the comprehensive semantic similarity.
[0058] In the embodiments of the present disclosure, the first knowledge node is the knowledge node that performs the first similarity calculation with the problem feature vector. It is usually an initial node obtained through preliminary retrieval and having a relatively high semantic matching degree with the problem (such as a legal provision node directly matching the problem keywords). The second knowledge node is other knowledge nodes that have a logical association with the first knowledge node. The association relationship is set based on the internal logic of legal knowledge. For example, for legal provision association: if the first knowledge node is a clause in the contract chapter of the Civil Code, the second knowledge node can be the corresponding judicial interpretation clause; for case association: if the first knowledge node is a certain breach of contract case, the second knowledge node can be other judgment cases of the same type of case situation; for practice association: if the first knowledge node is the arbitration application process, the second knowledge node can be the arbitration evidence collection guide. The critical value for determining whether the first semantic similarity is valid, for example, setting the threshold to 0.7. Only when the first semantic similarity ≥ 0.7, the retrieval of subsequent associated nodes is triggered to avoid ineffective expansion of nodes with low matching degrees.
[0059] A strategy for integrating and calculating after assigning different weight coefficients to the first semantic similarity and the second semantic similarity. The weight size is set according to the association priority of the node and the problem. For example, if the first knowledge node is a core legal provision, the weight is set to 0.6; if the second knowledge node is a supporting judicial interpretation, the weight is set to 0.4, and the comprehensive semantic similarity = 0.6 × the first semantic similarity + 0.4 × the second semantic similarity.
[0060] The comprehensive semantic similarity in the embodiments of the present disclosure takes into account the matching degrees of both the core knowledge node and the associated knowledge node with the problem, and is more comprehensive and accurate than single similarity calculation. It is the ultimate basis for sorting candidate answers.
[0061] Exemplarily, Figure 5 shows a flowchart of an extended retrieval in the embodiments of the present disclosure. As Figure 5 shown, when using the problem feature vector as a query, if there is a "reference" relationship between node A (such as the legal concept being the node "contract breach") and node B (such as the relevant legal provision Article 577 of the Civil Code / similar case "(2023) Jing 0105 Min Chu 1234 Hao Judgment"), then B is retrieved synchronously, and so on.
[0062] In some embodiments, the legal intelligent question - answering method provided in the embodiments of the present disclosure can optimize the candidate answers through the following steps: [[ID=,18]]S602, perform multi - dimensional verification on the candidate answers, where the multi - dimensional verification includes: logical consistency verification and / or time validity verification; S604, according to the identity information of the target user, perform corresponding scenario adaptability optimization processing on the candidate answers, and output the answer content including conclusion information, legal provision basis, case number, and practice guidance.
[0063] It should be noted that the acquisition, storage, use, and processing of data in this disclosed technical solution comply with the relevant provisions of laws and regulations. All types of data, such as personal identity data, operational data, and behavioral data related to individuals, customers, and groups, obtained in this disclosed embodiment have been agreed upon by the users.
[0064] Based on the same inventive concept, this disclosure also provides a legal intelligent question-and-answer device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to that of the method embodiments described above, the implementation of this device embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be elaborated further.
[0065] Figure 7 This illustration shows a schematic diagram of a legal intelligent question-and-answer device according to an embodiment of the present disclosure, such as... Figure 7 As shown, the device includes: a user interaction module 701, a data acquisition module 702, a question feature vector generation module 703, a candidate answer retrieval module 704, and an answer generation module 705.
[0066] The system includes: a user interaction module 701 for receiving legal question text input by a target user; a data acquisition module 702 for acquiring scene tags of the legal question text and historical interaction data of the target user; a question feature vector generation module 703 for generating scene-specific question feature vectors based on the legal question text, scene tags, and historical interaction data; a candidate answer retrieval module 704 for simultaneously retrieving multiple knowledge bases based on the question feature vectors to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guide database; and an answer generation module 705 for optimizing the candidate answers to obtain the solution content for the legal question text.
[0067] In some embodiments, the above-mentioned problem feature vector generation module 703 is further configured to: generate a problem element vector based on the legal problem text, wherein the problem element vector includes at least one of the following: subject feature vector, behavior feature vector, and consequence feature vector; generate a scene tag embedding vector based on scene tags; generate a historical interaction vector based on historical interaction data; and perform weighted fusion of the problem element vector, scene tag embedding vector, and historical interaction vector to obtain a scene-specific problem feature vector.
[0068] In some embodiments, the candidate answer retrieval module 704 is further configured to: calculate the semantic similarity between the question feature vector and the knowledge node, wherein the knowledge node is a node obtained by vectorizing the knowledge in each knowledge base; and output a preset number of candidate answers in descending order of semantic similarity, wherein the number of candidate answers is configured according to the identity information of the target user.
[0069] In some embodiments, the candidate answer retrieval module 704 is further configured to: calculate the first semantic similarity between the question feature vector and the first knowledge node; if the first semantic similarity exceeds a preset threshold and the first knowledge node and the second knowledge node are related, calculate the second semantic similarity between the question feature vector and the second knowledge node; and perform weighted fusion of the first semantic similarity and the second semantic similarity to obtain a comprehensive semantic similarity.
[0070] In some embodiments, the answer generation module 705 is further configured to: perform multi-dimensional verification on candidate answers, wherein the multi-dimensional verification includes: logical consistency verification and / or time validity verification; perform corresponding scenario adaptability optimization processing on candidate answers based on the identity information of the target user, and output answer content containing conclusion information, legal basis, case number and practical guidance.
[0071] It should be noted that the examples and application scenarios implemented by the modules in the above device embodiments and the corresponding steps in the method embodiments are the same, but are not limited to the content disclosed in the above method embodiments. It should also be noted that the above modules, as part of the device, can be executed in a computer system such as a set of computer-executable instructions.
[0072] Based on the same inventive concept, this disclosure also provides a legal intelligent question-and-answer system, as described in the following embodiments. Since the principle by which this system solves the problem is similar to that of the method embodiments described above, the implementation of this system can refer to the implementation of the method embodiments described above, and repeated details will not be elaborated further.
[0073] Figure 8 This illustration shows a schematic diagram of a legal intelligent question-and-answer system according to an embodiment of the present disclosure, such as... Figure 8 As shown, the system includes: an input module 801, a dynamic scene adaptation module 802, a multi-source knowledge fusion module 803, a multi-dimensional verification and optimization module 804, and an output module 805.
[0074] The system includes: an input module 801 for receiving legal question text input by a target user, obtaining scenario tags for the legal question text, and the target user's historical interaction data; a dynamic scenario adaptation module 802 for generating scenario-specific question feature vectors based on the legal question text, scenario tags, and historical interaction data; a multi-source knowledge fusion module 803 for simultaneously searching multiple knowledge bases based on the question feature vectors to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guidance database; a multi-dimensional verification and optimization module 804 for performing multi-dimensional verification and scenario adaptability optimization on the candidate answers; and an output module 805 for outputting answer content containing conclusion information, legal basis, case number, and practical guidance.
[0075] In some embodiments, the dynamic scene adaptation module 802 is further configured to: generate a problem element vector based on the legal problem text, wherein the problem element vector includes at least one of the following: subject feature vector, behavior feature vector, and consequence feature vector; generate a scene tag embedding vector based on scene tags; generate a historical interaction vector based on historical interaction data; and perform weighted fusion of the problem element vector, the scene tag embedding vector, and the historical interaction vector to obtain a scene-specific problem feature vector.
[0076] In some embodiments, the multi-source knowledge fusion module 803 is further configured to: calculate the semantic similarity between the question feature vector and the knowledge node, wherein the knowledge node is a node obtained by vectorizing the knowledge in each knowledge base; and output a preset number of candidate answers in descending order of semantic similarity, wherein the number of candidate answers is configured according to the identity information of the target user.
[0077] Furthermore, in some embodiments, the multi-source knowledge fusion module 803 is also used to: calculate the first semantic similarity between the problem feature vector and the first knowledge node; if the first semantic similarity exceeds a preset threshold and the first knowledge node and the second knowledge node are related, calculate the second semantic similarity between the problem feature vector and the second knowledge node; and perform weighted fusion of the first semantic similarity and the second semantic similarity to obtain a comprehensive semantic similarity.
[0078] In some embodiments, the multi-dimensional verification optimization module 804 is further configured to: perform multi-dimensional verification on candidate answers, wherein the multi-dimensional verification includes: logical consistency verification and / or time validity verification; perform corresponding scenario adaptability optimization processing on candidate answers based on the identity information of the target user, and output answer content including conclusion information, legal basis, case number and practical guidance.
[0079] In practical implementation, the dynamic scene adaptation module 802, the multi-source knowledge fusion module 803, and the multi-dimensional verification optimization module 804 perform the following functions: 1) Dynamic Scene Adaptation Module: 1.1) Input processing: User-input legal question text (e.g., "Is the penalty clause in the contract valid?").
[0080] Scene tags (e.g., "contract review" or "dispute mediation") are provided by the user.
[0081] User history interaction data includes past question records (such as question text sequences) and answer feedback (such as user ratings or modification suggestions), which are stored in the system database.
[0082] User identity information: This distinguishes between ordinary users (such as non-professionals) and legal professionals (such as lawyers), and is obtained through user profiles.
[0083] After a user enters a legal question, the system simultaneously receives scenario tags (such as contract review, dispute mediation, etc.), historical interaction data (such as question records, feedback ratings, etc.) and identity information (such as ordinary users, legal professionals, etc.).
[0084] Scene tags are converted into vectors through the embedding layer. Historical data is encoded into vectors using a time series model. Identity information is encoded using one-hot encoding (e.g., [1,0] represents a regular user, [0,1] represents a professional), and then converted into an identity feature vector through a fully connected layer. .
[0085] 1.2) Hierarchical feature extraction: For the question text Employing multi-layered outputs from a pre-trained language model: Main feature vector Extract from the output of the lower layers (layers 1-3), capture local syntax and entity information (such as the contract subject name), and generate subject feature vectors using vectors marked with [CLS] or average pooling at specific entity locations.
[0086] Behavioral feature vector Extracting from the output of the middle layer (layers 4-8), capturing actions and relationships (such as "breach of contract"), focusing on verb-related lexical units through an attention mechanism, and generating behavioral feature vectors.
[0087] Consequence feature vector Extract from the output of higher layers (layers 9-12), capture global semantics and consequences (such as “damage outcome”), and generate consequence feature vectors using [CLS] labeled vectors or sequence average pooling.
[0088] 1.3) Weighted fusion: Scenario-based weight allocation: such as assigning weights to contract review scenarios. Higher weight (0.6) enhances dispute mediation scenarios. and Weights (0.4 each); Generate scenario-specific problem feature vectors The weight Dynamically adjusted by scene tags and It is determined by the user's identity and historical data.
[0089] Weights of the problem feature vector ,in, This reflects the level of focus the scenario places on the "core subjects / entities in the problem." For example, in a contract review scenario, it is necessary to focus on identifying the identities of the contracting parties, the subject matter, and other relevant information. The weight is relatively high. This reflects the level of focus the scenario places on the "key behaviors / legal relationships in the problem." For example, in a dispute mediation scenario, the focus should be on breach of contract, causal relationships, etc. The weighting has been increased. This reflects the level of attention the scenario places on the "legal consequences of the behavior." For example, in a litigation consultation scenario, the focus should be on analyzing the consequences of the behavior, such as compensation and penalties. The weight is relatively high.
[0090] Weights of scene label embedding vectors This weight reflects the strength of the influence of the scenario label itself on the problem analysis. The closer the connection between the scenario and the problem, the better. For example, the labor arbitration scenario matches the "wage arrears" problem. Value enhancement to strengthen the impact of context-specific semantics.
[0091] Weights of user history interaction vectors This weight reflects the reference value of historical user data for analyzing the current problem. For example, if a user consults multiple times about lease contract disputes, then... The improved value makes the model more inclined to analyze similar problem features in historical interactions, thereby improving personalized adaptability.
[0092] 2) Multi-source knowledge fusion module: 2.1) Knowledge base construction: Construct a legal provisions database, a case database, and a practice guide database for synchronous retrieval after the multi-source legal knowledge fusion module receives the problem feature vector.
[0093] Legal texts database: Structured storage of legal texts published by authoritative institutions, such as the Civil Code and the Criminal Law, indexed by "legal department - clause number"; Case Library: Integrates judicial judgments from platforms such as China Judgments Online, extracting key information such as case facts, points of contention, and basis for judgment; Practical Guide Library: Includes experiential knowledge such as the Bar Association's operational guidelines and legal practice books, and constructs a knowledge graph of key operational points such as evidence collection and negotiation strategies.
[0094] 2.2) Knowledge Connections: Using problem feature vectors For the query, calculate its correlation with vectorized knowledge nodes. Semantic similarity:
[0095] Associated Node Expansion: If there is a "reference" relationship between node A (e.g., the legal concept is the node "contract breach") and node B (e.g., the relevant law, Article 577 of the Civil Code / similar case, Judgment No. (2023) Jing 0105 Min Chu 1234), then synchronously retrieve B, and so on.
[0096] Associated Trigger Condition: When the legal provision node A meets the following conditions, trigger the extended retrieval of case node B: Semantic Association Threshold: ; Relationship Strength Verification: The weight of the "reference" relationship A→B in the knowledge graph (The relationship weight is default calculated by historical reference frequency).
[0097] Node Pair Similarity Fusion Calculation: Adopt a two-layer fusion strategy to integrate the similarity between node A and node B: The First Layer: Node Independent Similarity (Cosine Similarity):
[0098] The Second Layer: Relationship Enhancement Fusion , where is the node weight coefficient, is the relationship strengthening factor, is the reference relationship strength pre-calculated by the knowledge graph.
[0099] 2.3) Generation of Candidate Answers: Sort by similarity, adjust the value of K according to the user identity (e.g., for legal practitioners, K = 10; for ordinary users, K = 5), and return the top-K relevant laws, cases, and practical guidelines to form a candidate set (L: laws, C: cases, G: practical guidelines, K: the upper limit of the number of returned answers).
[0100] 3) Multi-dimensional Verification and Optimization Module: 3.1) Logical Consistency Verification: The rule engine matches laws with cases: For example, personal injury compensation needs to be associated with the provisions of the tort liability chapter of the Civil Code, otherwise an alarm is triggered; Use BERTScore to calculate the semantic consistency score between the legal citation and the case description, and it passes only when the threshold > 0.8.
[0101] 3.2) Timeliness Verification: Connect to the legal database and filter out repealed / revised laws based on the current retrieval date; Filter cases in the case library for judgments in the past three years (e.g., from 2022 to 2025) to ensure timeliness.
[0102] 3.3) Scene adaptability optimization: For regular users: Add a simple explanation layer when generating answers (such as "breach of contract liability refers to the failure of a party to fulfill its obligations"). Legal professionals: The evolution of supplementary provisions (such as the revision history of Article 577 of the Civil Code) and academic opinions from the industry.
[0103] 3.4) Final Output: Answer structure: Conclusion + legal basis (e.g., Article 577 of the Civil Code) + case number (e.g., (2023) Jing 0105 Min Chu 1234) + practical guidance (e.g., Chapter 3 of the Civil Evidence Rules Practice Guide).
[0104] As can be seen from the above, the multi-level intelligent legal question-answering method and system provided in this disclosure aims to solve the problems of insufficient accuracy in question understanding, insufficient knowledge integration, poor traceability and insufficient credibility of answers in existing legal question-answering systems through a multi-level question understanding mechanism that adapts to dynamic scenarios, an answer generation mechanism that integrates multiple sources of legal knowledge, and an interpretable answer tracing and dynamic verification mechanism. It achieves the technical effect of realizing accurate understanding and credible answers to legal questions, improving the professionalism and practicality of answers, and ensuring that the system has high response efficiency in high-concurrency scenarios.
[0105] In practical implementation, the main process steps are as follows: the user inputs a legal question and provides a scenario tag; the system obtains the user's historical interaction data and identity information; the dynamic scenario adaptation module, based on multi-dimensional information, uses hierarchical natural language processing technology to adjust the question parsing strategy, extracts feature vectors through multi-layer output of a pre-trained language model, and weights and fuses them to generate scenario-specific question feature vectors; the multi-source legal knowledge fusion module receives the question feature vectors, simultaneously searches the legal provisions database, case database, and practice guide database, establishes relationships through knowledge graph technology, calculates semantic similarity, and generates a set of candidate answers; the interpretable multi-dimensional verification and optimization module performs logical consistency checks, legal timeliness verification, and user scenario adaptability assessment on the candidate answers. After verification, the final answer is output and the cited basis is displayed, forming a complete closed loop of "question understanding - knowledge fusion - verification output".
[0106] Taking a contract review scenario as an example, a user inputs the legal question "The legal consequences of the lessor's failure to disclose property mortgage information in a housing rental contract," and tags the scenario "Contract Review." The system simultaneously obtains the user's identity information (ordinary user) and historical interaction data (inquiries about the validity of rental contract clauses within the past 3 months). The functional descriptions of the dynamic scenario adaptation module, multi-source knowledge fusion module, and interpretable verification module are as follows: 1) Dynamic Scene Adaptation Module: This module uses the BERT model to perform hierarchical feature extraction on the input text, obtaining feature vectors (768 dimensions) for elements such as "lessor," "undisclosed mortgage information," and "contract validity." These vectors are then combined with the embedding vector of the scene tag "contract review" (a pre-trained 512-dimensional vector) and weighted fusion using an attention mechanism to generate a scene-specific question feature vector (1024 dimensions). The calculation process is as follows: Suppose the question element vector is a 768-dimensional vector, denoted as V1, which is a feature vector containing elements such as "lessor," "undisclosed mortgage information," and "contract validity." For example, some elements might be [0.23, -0.15, 0.42, ..., 0.18] (768 values in total). This vector primarily involves the core semantics of the user's question (such as subject, behavior, and legal consequences), forming the basis for the model's understanding of "what the user is asking." It has higher information density and richer details (e.g., distinguishing subtle differences between similar legal concepts like "mortgage" and "pledge"). If too few dimensions are allocated, key element information may be lost (e.g., the behavioral feature of "undisclosed" might be over-compressed).
[0107] Assuming the scenario label vector is a 512-dimensional vector, denoted as V2, it is the embedding vector for the "contract review" scenario, with some elements as [0.31, 0.08, -0.27, ..., 0.35] (a total of 512 values). The scenario label vector only contains the macroscopic tendencies of scenario attributes (such as "contract review" and "dispute mediation"), with more concentrated information and lower redundancy (for example, the core features of the "contract review" scenario can be summarized by limited dimensions such as "subject qualification" and "clause validity"), and core information can be retained without too many dimensions.
[0108] In this embodiment of the disclosure, based on information retention requirements, feature importance, and target dimension constraints, dimension mapping is performed on vectors V1 and V2: Assume d1=600, d2=424 (600+424=1024).
[0109] The vector V1 is mapped to a 600-dimensional vector using W1 (a 768×600 matrix). For example, some results are [0.14, -0.09, 0.25, ..., 0.11] (600 values).
[0110] The vector V2 is mapped to a 424-dimensional vector by W2 (a 512×424 matrix). For example, some results are [0.19, 0.05, -0.16, ..., 0.21] (424 values).
[0111] By concatenating the 600-dimensional and 424-dimensional vectors, a 1024-dimensional scene-specific problem feature vector Vscene is obtained, which is used for retrieval and matching in the subsequent multi-source knowledge fusion module.
[0112] 2) Multi-source knowledge fusion module: After receiving the feature vectors, it synchronously retrieves the legal provision library (locates the "Transfer of Mortgaged Property" clause in Article 406 of the Civil Code), the case library (matches the judgment of (2022) Hu 0115 Min Chu No. 12345, where the lessor's failure to disclose the mortgage led to the dissolution of the contract), and the practical guide library (extracts the "Key Points of Mortgage Information Disclosure" in Chapter 5 of the "Practical Guidelines for Contract Review"). It establishes a "House Mortgage Disclosure" node through a knowledge graph, associates the above legal provisions, cases, and practical guidelines, calculates the cosine similarity between the problem feature vector and each knowledge node (0.89, 0.85, 0.82 respectively), and generates a candidate answer set including "Article 406 of the Civil Code stipulates that the transfer of mortgaged property requires notification to the mortgagee", "It is possible to claim the dissolution of the contract by referring to the judgment of (2022) Hu 0115 Min Chu No. 12345", and "It is necessary to verify the mortgage registration information in practice".
[0113] 3) Explainable verification module: It verifies that the legal provision citation matches the contract law norms through a rule engine (passed), docks with a legal database to confirm the current validity of Article 406 of the Civil Code (valid), screens cases as judgments in the past three years (complied), and adjusts the answer details according to the user's identity (version for ordinary users: "If the lessor fails to inform that the house is mortgaged, you can request the dissolution of the contract and claim damages, and the legal basis is Article 406 of the Civil Code"). Finally, it outputs the answer and displays the citation basis to complete a complete question-and-answer closed loop.
[0114] As an optional embodiment, the legal intelligent question-and-answer method provided in the embodiments of the present disclosure can support cross-language legal question-and-answer. For foreign-related legal consultation scenarios, language type recognition (Chinese / English / Japanese) is added to the dynamic scenario adaptation module, a multi-language pre-trained model (such as mBERT) is used to extract cross-language feature vectors, and multi-language problem features are generated in combination with scenario labels (such as "Foreign-related Contract Review"). The multi-source knowledge fusion module expands the international convention library (such as the United Nations Convention on Contracts for the International Sale of Goods) and the foreign legal provision library (such as the Uniform Commercial Code of the United States), establishes mappings of Chinese and foreign legal concepts through a cross-language knowledge graph (such as "fundamental breach" corresponding to "fundamental breac"), realizes the semantic alignment of multi-language legal knowledge, and supports answering cross-language questions such as "the criteria for determining fundamental breach in a goods sales contract signed between a Chinese company and an American enterprise".
[0115] As another optional embodiment, the legal intelligent question-answering method provided in this disclosure embodiment can support multi-round conversational question-answering optimization. A dialogue history tracking mechanism is added to the interpretable verification module, using a Long Short-Term Memory (LSTM) network to record users' historical questions and system answers, identifying implicit needs (such as a user's initial question about "contract termination conditions," followed by a follow-up question about "whether failure to notify the mortgagee affects termination"). A dynamic scenario adaptation module adjusts the feature extraction strategy based on dialogue round information (subsequent rounds focus on extracting supplementary elements), and a multi-source knowledge fusion module optimizes candidate set generation based on historical answers (prioritizing matching related clauses and cases). Finally, it outputs a coherent answer containing contextual relevance (such as "Based on your previous question, failure to notify the mortgagee may restrict the right to terminate the contract, specifically according to Article 406, Paragraph 2 of the Civil Code"), enhancing the interactive depth of complex legal issues.
[0116] The intelligent legal question-answering method provided in this embodiment can achieve the following technical effects: 1) A multi-layered problem understanding mechanism with dynamic scene adaptation: By combining scene tags, user identity, and historical interaction data with hierarchical feature extraction and dynamic weight allocation, personalized problem parsing is achieved, solving the problem of insufficient adaptability in traditional legal question-answering systems and outperforming the single parsing method of static models. The feature vectors output from multiple layers are fused with scene tags and user identity information through dynamic weighting to achieve precise matching of "problem-scene-user." This collaborative mechanism cannot be achieved by existing single pre-trained models or static feature extraction, significantly improving the personalization and accuracy of problem understanding.
[0117] 2) Multi-source legal knowledge fusion mechanism: Integrate legal provisions database, case database, and practice guide database, establish cross-source knowledge associations through knowledge graph, and combine a two-layer fusion algorithm that weights cosine similarity and relationship strength to solve the problems of fragmented multi-source knowledge and low matching accuracy in traditional legal question answering systems, so as to achieve deep integration and efficient retrieval of knowledge.
[0118] 3) A closed-loop architecture for multi-dimensional verification and identity-driven output: This architecture constructs a triple verification mechanism encompassing logical consistency, legal timeliness, and scenario adaptability, simultaneously displaying the legal basis, case number, and practical guidance for the answer. This addresses the issues of insufficient traceability and credibility in traditional legal Q&A systems. In this embodiment, logical verification, timeliness filtering, and user identity adaptation are combined to form a complete "generation-verification-optimization" closed loop. This ensures the professionalism of the answer while dynamically adjusting information density to meet the needs of different users.
[0119] In this disclosed embodiment, through multi-scenario adaptation and multi-source knowledge fusion, comprehensive answers covering legal provisions, cases, and practical points are provided for scenarios such as contract review and dispute mediation. This addresses the problem of one-sided answers in traditional legal question-and-answer systems and meets the professional needs of both ordinary users and legal practitioners. A multi-dimensional verification mechanism ensures that the answers are logically consistent and based on current validity, and simultaneously displays the cited sources, allowing users to trace the basis and increasing trust in the answers. This is suitable for scenarios requiring reliable legal references. The dynamic scenario adaptation module can efficiently handle real-time questions from different users. The identity-driven output strategy balances information simplicity (for ordinary users) and depth (for legal practitioners), and the system architecture supports high-concurrency response, making it widely applicable to practical business scenarios such as online legal consultation and intelligent contract review.
[0120] Those skilled in the art will understand that various aspects of this disclosure can be implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as a "circuit", "module" or "system".
[0121] Based on the same inventive concept, this disclosure also provides an electronic device, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the legal intelligent question-answering method described above by executing the executable instructions. Since the principle of solving the problem in this electronic device embodiment is similar to that of the above method embodiment, the implementation of this electronic device embodiment can refer to the implementation of the above method embodiment, and repeated details will not be described again.
[0122] The following reference Figure 9 To describe an electronic device 900 according to such an embodiment of the present disclosure. Figure 9 The electronic device 900 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0123] like Figure 9 As shown, the electronic device 900 is manifested in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including storage unit 920 and processing unit 910).
[0124] The storage unit stores program code that can be executed by the processing unit 910, causing the processing unit 910 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 910 can perform the following steps of the above method embodiments: receiving legal question text input by a target user; obtaining scene tags of the legal question text and historical interaction data of the target user; generating a scene-specific question feature vector based on the legal question text, scene tags, and historical interaction data; synchronously searching multiple knowledge bases based on the question feature vector to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guide database; and optimizing the candidate answers to obtain the solution content of the legal question text.
[0125] Storage unit 920 may include readable media in the form of volatile storage units, such as random access memory (RAM) 9201 and / or cache memory 9202, and may further include read-only memory (ROM) 9203.
[0126] The storage unit 920 may also include a program / utility 9204 having a set (at least one) program module 9205, such program module 9205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0127] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0128] Electronic device 900 can also communicate with one or more external devices 940 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 950. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 960. As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0129] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0130] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the legal intelligent question-answering method described above. Since the principle by which this computer-readable storage medium embodiment solves the problem is similar to that of the above method embodiments, the implementation of this computer-readable storage medium embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.
[0131] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having 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.
[0132] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0133] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0134] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0135] Based on the same inventive concept, this disclosure also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the legal intelligent question-answering method of any one of the above method embodiments. Since the principle by which this computer program product embodiment solves the problem is similar to that of the above method embodiments, the implementation of this computer program product embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.
[0136] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0137] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0138] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0139] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. A legal intelligent question-and-answer method, characterized in that, include: Receive legal question text input by the target user; Obtain the scenario tags of the legal issue text and the target user's historical interaction data; Based on the legal issue text, the scenario tags, and the historical interaction data, a scenario-specific issue feature vector is generated. Based on the problem feature vector, multiple knowledge bases are searched simultaneously to obtain candidate answers. The multiple knowledge bases include at least one of the following: legal provisions database, case database, and practical guide database. The candidate answers are optimized to obtain the solution to the legal question text.
2. The intelligent legal question-answering method according to claim 1, characterized in that, Based on the legal issue text, the scenario tags, and the historical interaction data, a scenario-specific issue feature vector is generated, including: Based on the legal issue text, an issue element vector is generated, wherein the issue element vector includes at least one of the following: subject feature vector, behavior feature vector, and consequence feature vector; Based on the scene labels, generate scene label embedding vectors; Based on the historical interaction data, a historical interaction vector is generated; The problem element vector, the scene tag embedding vector, and the historical interaction vector are weighted and fused to obtain a scene-specific problem feature vector.
3. The intelligent legal question-answering method according to claim 1, characterized in that, Based on the question's feature vector, multiple knowledge bases are searched simultaneously to obtain candidate answers, including: Calculate the semantic similarity between the problem feature vector and the knowledge node, wherein the knowledge node is a node obtained by vectorizing the knowledge in each knowledge base; The system outputs a preset number of candidate answers in descending order of semantic similarity, wherein the number of candidate answers is configured according to the identity information of the target user.
4. The intelligent legal question-answering method according to claim 3, characterized in that, Calculating the semantic similarity between the problem feature vector and the vectorized knowledge nodes includes: Calculate the first semantic similarity between the problem feature vector and the first knowledge node; If the first semantic similarity exceeds a preset threshold, and the first knowledge node and the second knowledge node are related, then the second semantic similarity between the problem feature vector and the second knowledge node is calculated. The first semantic similarity and the second semantic similarity are weighted and fused to obtain the comprehensive semantic similarity.
5. The intelligent legal question-answering method according to any one of claims 1 to 4, characterized in that, The candidate answers are optimized to obtain the solution content for the legal question text, including: The candidate answers are validated in multiple dimensions, including: logical consistency validation and / or time validity validation. Based on the target user's identity information, the candidate answers are optimized for scenario suitability, and the output includes conclusion information, legal basis, case number, and practical guidance.
6. A legal intelligent question-and-answer device, characterized in that, include: The user interaction module is used to receive legal question texts input by the target user. The data acquisition module is used to acquire the scene tags of the legal issue text and the target user's historical interaction data; The problem feature vector generation module is used to generate a scenario-specific problem feature vector based on the legal problem text, the scenario tag, and the historical interaction data. The candidate answer retrieval module is used to simultaneously retrieve multiple knowledge bases based on the question feature vector to obtain candidate answers, wherein the multiple knowledge bases include at least one of the following: legal provisions database, case database, and practical guide database; The answer generation module is used to optimize the candidate answers to obtain the solution content of the legal question text.
7. A legal intelligent question-and-answer system, characterized in that, include: The input module is used to receive legal question text input by the target user, obtain the scene tags of the legal question text and the target user's historical interaction data; The dynamic scene adaptation module is used to generate a scene-specific problem feature vector based on the legal issue text, the scene tag, and the historical interaction data. The multi-source knowledge fusion module is used to simultaneously retrieve multiple knowledge bases based on the problem feature vector to obtain candidate answers. The multiple knowledge bases include at least one of the following: a legal provisions database, a case database, and a practical guide database. The multi-dimensional verification and optimization module is used to perform multi-dimensional verification and scenario adaptability optimization on the candidate answers. The output module is used to output the answer content, which includes conclusion information, legal basis, case number, and practical guidance.
8. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the legal intelligent question-answering method according to any one of claims 1 to 6 by executing the executable instructions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the legal intelligent question-and-answer method according to any one of claims 1 to 6.
10. A computer program product comprising: A computer program or instruction, characterized in that, when executed by a processor, the computer program or instruction implements the legal intelligent question-and-answer method as described in any one of claims 1 to 6.