Intelligent interaction and accurate response method and system for legal questions and answers
By combining legal element graphs and dynamic decision engines, a progressive guidance from incomplete information to legal conclusions is achieved, solving the problems of unintelligent interaction and insufficient interpretability of conclusions in existing technologies, and improving the accuracy and user experience of legal question-and-answer systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-13
AI Technical Summary
Existing legal question-and-answer systems suffer from low accuracy and practicality when users initially provide incomplete information, exhibiting unintelligent interaction, weak reasoning ability, and insufficient interpretability of conclusions.
Using a legal element graph as the reasoning framework, a dynamic decision engine provides progressive guidance, and iterative questioning is conducted based on node states to generate legal conclusions with interpretable reasoning chains.
It improves the accuracy and efficiency of legal Q&A, enhances the interpretability and persuasiveness of conclusions, and optimizes the user experience.
Smart Images

Figure CN121658632A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and information technology, and more specifically, to a method and system for intelligent interactive and accurate response to legal questions. Background Technology
[0002] With the popularization of information technology, the public's demand for obtaining preliminary legal advice through online channels is growing. This has spurred the need for intelligent question-and-answer systems capable of understanding complex legal issues and providing reliable guidance. Such systems aim to simulate the interaction process of a professional legal advisor, helping users to gradually clarify the facts and obtain targeted legal analysis even when information is incomplete.
[0003] Currently, common legal question-answering technologies mainly rely on large-scale text retrieval and single-round question-and-answer matching. These methods are typically based on keyword matching or statistical models and may be effective when users provide complete and accurate queries. However, their fundamental flaws lie in the rigidity of the interaction mode and the lack of reasoning ability. When users' initial descriptions are vague or omit key facts, the system cannot proactively guide the dialogue to supplement necessary information, often providing vague or incorrect answers based directly on incomplete context. Although some systems have preset fixed follow-up question processes, their question sequences are static and linear, unable to dynamically adjust the logical focus and depth of subsequent questions based on the user's previous answers, resulting in low interaction efficiency and a poor user experience. Furthermore, existing technologies generally lack the ability to represent and apply structured legal knowledge. They typically treat legal provisions or cases as text fragments, making it difficult to understand and execute the complex logical dependencies and reasoning rules in legal arguments. Therefore, the conclusions generated are often just a collection of related texts, lacking rigorous logical deduction chains, poor interpretability, and difficulty in convincing users.
[0004] In summary, existing technologies suffer from problems such as unintelligent interaction, weak reasoning ability, and insufficient interpretability of conclusions when dealing with incomplete legal consultations, which limit their accuracy and practicality in real-world applications. Summary of the Invention
[0005] The present invention aims to provide a method and system for intelligent interaction and accurate response to legal questions and answers, so as to solve the problem of insufficient accuracy of legal questions and answers in the prior art due to incomplete information provided by users in their initial descriptions.
[0006] To achieve the above objectives, this invention first provides a legal question-and-answer intelligent interactive method. The core of this method lies in using a dynamic decision engine driven by node states and a legal element graph as the reasoning framework to achieve a progressive guidance and synthesis from fragmented information to a complete legal conclusion. Its basic implementation includes the following closed-loop process: First, receiving and parsing the user's initial inquiry to identify the legal cause of action and factual information; second, calling the corresponding legal element graph based on the cause of action, which defines the logical dependencies between elements in a directed graph structure; next, semantically matching the user's facts with the graph nodes to initialize the node's satisfaction state; then, dynamically deciding the next most important legal element to be questioned based on the graph topology and node states, and generating follow-up question information; subsequently, receiving the user's reply, updating the graph state, and iteratively executing the above follow-up question decision and state update process; finally, when all core legal elements are confirmed to be satisfied, generating and outputting a final legal conclusion with an interpretable reasoning chain based on the complete element satisfaction state and graph logic. This process transforms one-time information judgment into progressive reasoning based on dynamic state machines, thereby systematically improving the accuracy of question answering.
[0007] Furthermore, the dynamic decision-making process of pursuing the target simulates the logical sequence in legal argumentation. By prioritizing the pursuit of unmet requirements where all logical premises have been met, the system ensures that each question is based on confirmed facts, thus making the entire dialogue process logically consistent and efficient. As a preferred implementation, when multiple candidate targets exist, the system can calculate the topological distance from each node to the final conclusion node and prioritize pursuing the node with the closest distance. This "critical path first" strategy helps the dialogue focus more quickly on the core points of contention, optimizing interaction efficiency.
[0008] Furthermore, to enhance the collaborative and transparent nature of the interaction, the system can generate and present intermediate analysis information to the user while generating follow-up questions. This information clarifies the logical connection between currently confirmed and pending clarification requirements, helping users understand the system's intent and context, thereby guiding them to provide more accurate and targeted supplementary information.
[0009] Furthermore, the system achieves precise correlation between facts and legal requirements through semantic computation. Specifically, it calculates the cosine similarity between the semantic vectors of the factual statements and the text describing the requirements, and compares this similarity with a preset threshold to complete the matching. This technique objectively and computably maps unstructured natural language facts onto a structured legal requirement framework, laying an accurate data foundation for subsequent logical reasoning.
[0010] Furthermore, the iterative interaction process terminates with a clear and legally logical objective condition: the state of all nodes marked as core elements in the legal element graph is satisfied. This termination mechanism based on "core element completeness" ensures that the system can automatically end the follow-up questioning when sufficient legal reasoning is obtained, and promptly generate a reliable conclusion.
[0011] Furthermore, the generation of the final legal conclusion is based on logical backtracking and path synthesis of the graph, rather than simple assertion. The system searches for all valid paths from satisfied nodes to conclusion nodes in the graph and transforms these paths into reasoning chains expressed in natural language, thereby outputting a legal conclusion with internal logical argumentation, significantly enhancing the persuasiveness and credibility of the conclusion.
[0012] As an optimization of the basic implementation, the system can also use continuous satisfaction evaluation values instead of Boolean values to more finely characterize node states and handle information uncertainty. Under this scheme, the evaluation value is dynamically weighted based on the semantic relevance of fact matching and the reliability of the fact source. By setting different confidence thresholds corresponding to decision-making, termination, and conclusion generation, the system can achieve hierarchical management and expression of information certainty, making the final analysis conclusions more professional and in-depth.
[0013] Accordingly, the present invention also provides a legal question-and-answer precision response system specifically designed to implement the above-described method. The system includes:
[0014] The text receiving module and the text output module are responsible for interacting with the user.
[0015] The text parsing module, connected to the text receiving module, is used to parse text and identify legal causes of action and factual information;
[0016] The knowledge storage module is used to store legal requirement diagrams for different causes of action;
[0017] The status management module, which connects to the text parsing module and the knowledge storage module respectively, is used to perform the matching of facts and requirements and maintain the real-time status or satisfaction evaluation value of the graph nodes.
[0018] The reasoning control module, which connects the state management module and the knowledge storage module, serves as the control center of the system. It contains a path decision unit for determining the target of inquiry and a question-and-answer generation unit for generating inquiry questions, and controls the iterative execution of the main interactive loop of the system.
[0019] The conclusion generation module connects the state management module and the knowledge storage module, and is used to generate legal conclusions based on the final state of nodes and graph logic when certain conditions are met.
[0020] Furthermore, the system may also include an intermediate analysis module. This module works in conjunction with the state management module and the question-and-answer generation unit to generate explanatory text by utilizing the current node state and its relationships, thereby enhancing the system's guidance capabilities during the interaction process.
[0021] Furthermore, the path decision unit in the inference control module may include a distance calculation subunit. This subunit provides direct data support for implementing the "critical path priority" inquiry strategy by calculating the topological distance from unsatisfied nodes to the conclusion node.
[0022] Furthermore, the state management module can be configured to maintain and update the satisfaction evaluation values of the graph nodes. This configuration enables fine-grained management of information uncertainty, allowing the system to process and express legal facts with varying degrees of certainty, thereby supporting the optimized implementation.
[0023] The technical effects and advantages of this invention are as follows:
[0024] Regarding interaction mode and information completeness: Compared to the static and linear interaction methods in existing technologies, this invention reshapes the human-computer dialogue process by introducing a dynamic state management and iterative questioning mechanism based on a legal element graph. The system continuously maintains a graph state view reflecting the progress of legal argumentation during the dialogue, and in each round of interaction, it makes real-time decisions on the most efficient follow-up questions based on the current state and graph topology. This approach allows the system to intelligently guide users to supplement the next logically most needed fact, much like a legal expert, based on confirmed information. This transforms an incomplete consultation into a relatively complete legal case that can be accurately analyzed through multiple rounds of dialogue.
[0025] Regarding questioning strategies and logical coherence: Addressing the issues of mechanical questioning sequences and a disconnect from legal logic in existing technologies, this invention encodes the logical premise relationships between legal elements as directed edges in a graph, and designs a questioning decision algorithm based on this. The system prioritizes questioning nodes where all logical premises have been satisfied, ensuring that the questioning order strictly follows the dependencies of legal argumentation. By calculating and comparing the topological distances from unsatisfied nodes to the conclusion node, the system can implement a "critical path priority" questioning strategy, allowing the dialogue to focus more quickly on the core dispute. This approach simulates a professional legal thinking process, ensuring that each step of multi-round interactions closely revolves around constructing a complete legal argument.
[0026] Regarding conclusion generation and interpretability: Unlike existing methods that directly output conclusion assertions or related text fragments, this invention constructs the final conclusion generation process as a graph-based explicit reasoning chain synthesis process. After the termination condition is met, the system automatically backtracks all logical paths from confirmed facts to the final conclusion within the legal element graph, transforming these paths into coherent natural language arguments. This ensures that the final legal opinion not only includes the conclusion but also clearly demonstrates the complete process of "which confirmed facts, through what legal logical relationships, gradually led to this conclusion." This mechanism enhances the interpretability and persuasiveness of the system's output, enabling users to understand the basis behind the conclusion and providing a structured verification path for the reliability of the conclusion. Attached Figure Description
[0027] Figure 1 This is a flowchart of the intelligent legal question-and-answer interaction method of the present invention;
[0028] Figure 2 This is a flowchart illustrating the text parsing module of the present invention;
[0029] Figure 3 This is a logical flowchart of the target decision-making process of the present invention. Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] In AI-based legal question-and-answer scenarios, users' initial case descriptions in natural language are often incomplete, making it difficult for the system to generate accurate and reliable legal conclusions after a single round of interaction. Traditional methods based on retrieval or simple classification cannot simulate the progressive questioning process of lawyers to clarify the facts. To address this, this invention provides a method and system that solves the technical problem of achieving accurate legal responses under conditions of incomplete information by structuring domain knowledge into a legal element graph with logical premise relationships and dynamically maintaining the state of graph nodes during multi-round dialogues. Based on the graph topology and real-time state, intelligent questioning decisions are driven, thus resolving this issue.
[0032] Example 1
[0033] This embodiment describes the basic implementation of the present invention, and its core process is as follows: Figure 1 As shown, it includes the following steps:
[0034] S100, Receive the user's initial legal consultation text.
[0035] The system receives structured requests from user clients through a predefined communication interface (such as HTTPAPI). The natural language query text carried in this request is extracted and stored as an internal variable, denoted as "raw query text" (or "original query text"). This step completes the data access from external user input to the system's internal processing flow.
[0036] S200. Analyze the initial legal consultation text to identify the corresponding legal cause of action and the initial legal fact information contained therein.
[0037] This step is for Perform structured analysis to transform it into symbolic information that the system can process. This process involves two parallel processing sub-processes (see [link to relevant documentation]). Figure 2 (See the flowchart of the parsing module shown).
[0038] S201. Identify the cause of action.
[0039] The system will The input text is fed into a legal cause-of-fact classification model. This model is built on a pre-trained language model and fine-tuned to map the input text to a probability distribution containing N candidate causes of action (such as "labor dispute - work injury determination" or "contract dispute - loan contract").
[0040] Specifically, the model outputs a probability vector. ,in Indicates that the text belongs to the first The probability of a case cause. The system selects the case cause label with the highest probability value as the output, denoted as CT. CT, as a string or enumerated value, is a key index for subsequent retrieval of domain knowledge.
[0041] S202. Extract initial legal fact information.
[0042] The system will run in parallel The data is fed into an information extraction pipeline. This pipeline first identifies entity boundaries and types in the text using a sequence labeling model, such as Person (PER), Time (TIME), Location (LOC), and Action (ACT).
[0043] Subsequently, a relational classification model is used to determine co-occurring entity pairs, extracting their semantic relationships to form structured triples in the form of "(subject, relation, object)". All from The extracted triples form a set, denoted as . This is called the "initial set of factual information".
[0044] S300. Based on the legal cause of action, invoke the pre-constructed corresponding legal element map.
[0045] The system accesses an internal knowledge base. This knowledge base uses the case type CT as the primary key and stores multiple "legal element maps".
[0046] Each graph G is a directed graph data structure, formally defined as G=(V,E). The legal element graph G can be obtained by domain expert annotation, mapping from a structured legal knowledge base, or by extracting and organizing the elements and relationships from a large number of judgment documents.
[0047] V is a set of nodes. Each node This represents the constituent elements required for a legal argument (e.g., "the existence of an employment relationship" or "the accident occurred in the workplace"). Node It includes attributes such as a unique identifier (id), natural language text describing the requirement (desc), and a boolean flag. . This is used to indicate whether the element is defined as a core element necessary for deriving the final conclusion.
[0048] E is the set of directed edges. Each edge Represents a node The element it represents is a node. The logical premises of the represented elements. This relationship reflects the conditional dependency in legal rules, and the graph contains one or more nodes designated as "conclusion nodes" ( The node represents the end point of the reasoning chain.
[0049] The system retrieves and loads the corresponding atlases based on CT scans. This graph is then stored in working memory. It constitutes a static domain knowledge framework. In subsequent sessions, the system will instantiate a dynamic "state view" for this graph.
[0050] S400. Match the initial legal fact information with the nodes in the legal requirement graph to determine the nodes in the graph that have been satisfied and the nodes that have not been satisfied.
[0051] This step aims to incorporate specific user facts. Mapped to an abstract set of legal requirements Above, the dynamic state view of the initial map is initialized. The system is for the map. Each node in Create and maintain a state variable Its initial value is a Boolean "false".
[0052] for Each fact triple in The system converts it into a complete declarative sentence. .
[0053] Using a trained sentence semantic encoder (e.g., Sentence-BERT), respectively... and each node Description text Convert to a fixed-dimensional semantic vector and .
[0054] calculate and The cosine similarity sim is calculated using the following formula: .
[0055] Set a preset similarity threshold. This threshold can be determined by validation on an labeled legal fact-element matching dataset, with a typical range of [0.7, 0.8]. If for a given node... There is at least one fact Make Then it is considered a fact Supporting requirements and the state of the node. Set to "True".
[0056] After the traversal is complete, the state of all nodes that are not supported by any fact matching is... Keep it as "false".
[0057] S500. Based on the topological structure and node satisfaction status of the legal requirements map, execute the inquiry target decision process.
[0058] This step is crucial for achieving intelligent interaction in this method, and its decision-making logic (such as...) Figure 3 As shown, this determines the coherence and efficiency of the system's questioning, with the goal of identifying the legal requirements corresponding to the next most appropriate question to ask the user.
[0059] S501. Construct a high-priority candidate set. The system first iterates through all states. The node is considered "false". For each such node... Check all its direct logical premise nodes (i.e., all nodes that satisfy the condition) nodes Are all states of ) "true"?
[0060] If so, then the node Add it to a set called the "high-priority candidate set". The nodes in this set represent nodes where all the premises required for reasoning are in place, and asking about such nodes follows the logical progression order.
[0061] S502, Decision-making inquiry into objectives.
[0062] like If not empty, then the system starts from... Select a node as the current target for follow-up questions. .
[0063] like If the value is empty, the system selects from all nodes with a "false" state according to preset secondary rules. A secondary rule is to select the node with the fewest unsatisfied direct logical premises.
[0064] Furthermore, in the aforementioned S502 decision-making process, when multiple candidate nodes exist (regardless of whether in (Even after applying secondary rules), the system uses a sorting rule based on topological distance to make follow-up questions more focused.
[0065] The system calculates each candidate node To the pre-defined conclusion node in the graph Topological distance . Defined from arrive The system prioritizes the selection of the shortest directed path based on the number of edges traversed. The node with the smallest value is used as This sorting method makes the system's questioning sequence more closely resemble the core logical progression of legal argumentation.
[0066] S600. Generate and present follow-up information to the user based on the legal requirements corresponding to the current follow-up target.
[0067] System read Node description text The system maintains a library of follow-up question templates associated with the case type CT. This library is organized according to common element types, and each template contains a fixed sentence structure and a method for embedding... The variable part. The system is based on... Preset type tags or pairs Keyword analysis is used to locate the corresponding template group, and one of them is selected to generate a complete follow-up question. Subsequently, the system will communicate via the interface. Send it to the user's client for display.
[0068] As a preferred implementation, in generating Within the same period, the system also generates and presents an intermediate analysis report. .
[0069] The generation process is as follows: The system retrieves all current states. For nodes that are "true", identify the "boundary truth nodes" that have at least one directed edge pointing to a node in the "false" state. The system organizes its language to correlate the descriptions of confirmed boundary nodes with the descriptions of unsatisfied nodes that need clarification, forming a... . and Send it to the user together.
[0070] S700: Receive the user's reply text in response to the follow-up question, extract supplementary legal fact information from it, and update the satisfaction status of the nodes in the legal element graph accordingly.
[0071] users Enter reply text The system for Repeat the fact extraction process described in step S200 to obtain a "supplementary fact information set". .
[0072] Subsequently, the system For input, repeat the semantic matching process described in step S400. This process is incremental: using The facts in the graph are matched with the nodes in the graph, and only those that have reached the matching threshold due to new facts are updated. The state of the node (From "false" to "true").
[0073] S800, iteratively execute the steps of inquiry target decision, inquiry generation and presentation, and response processing and status update.
[0074] Steps S500, S600, and S700 together form an interactive loop. The system operates in a loop mode: after each update of the node state based on S700, S500 is re-executed to determine the new follow-up target based on the latest state, followed by the execution of S600 and S700. This loop continues, driving multiple rounds of dialogue.
[0075] Furthermore, the preset iteration termination condition includes: graph All marked as The node, its state All conditions have been changed to "true". When the system detects that the condition is met, it terminates the loop and enters the final conclusion generation stage.
[0076] S900. When the iteration termination condition is met, the final legal conclusion is generated based on the final satisfaction state of the nodes in the legal element graph.
[0077] This stage involves graph-based closed-loop reasoning and conclusion synthesis.
[0078] S901, Extract the reasoning path. The system extracts the reasoning path from the graph. In the process, starting from all nodes whose state is "true", follow the directed edge. Perform a graph traversal in the specified direction, searching for all nodes that can reach the specified conclusion. The path.
[0079] S902. Synthesize the conclusion text. For each found path, the system organizes the desc text of each node on the path in sequence to form a logically coherent reasoning statement. All reasoning statements from all paths are merged, duplicates are removed, and the entire "Reasoning Basis" paragraph is integrated.
[0080] Finally, combining the conclusion node The desc text is used to generate a final legal conclusion text containing "reasoning basis" and "conclusion assertion". And send it to the user through the output interface.
[0081] Example 2
[0082] Based on Example 1, this example provides a more refined node state management method, namely, replacing Boolean states with a continuously quantified "satisfaction evaluation value" mechanism.
[0083] Under this scheme, the system provides each node with... Maintain a satisfaction rating value , replace Boolean state .
[0084] During the matching process in steps S400 and S700, Based on the semantic similarity (sim) of the matched facts and the directness weight of the fact source. Perform weighted calculations and updates, for example Among these, facts directly confirmed by the user, A value of 1.0 is acceptable; for facts inferred by the system, Values less than 1.0 are acceptable.
[0085] The system sets two preset thresholds: (e.g., 0.6) and (For example, 0.9). In step S500 decision, if a node's If the logical premise is satisfied, it is considered temporarily satisfied; the system tends to choose... The node is used as the target for further inquiry.
[0086] In the termination condition judgment of step S800, all core nodes are required to... In step S902, when synthesizing the conclusion, for Between and The core elements will be marked and explained in the reasoning basis, and the tone of the final conclusion can be expressed in a gradient according to the average confidence level of the core elements.
[0087] Accordingly, the present invention also provides a "precise legal question-and-answer system" for implementing the above method. This system is constructed in a modular manner, with each module working collaboratively to execute the method:
[0088] The text receiving module is used to perform step S100, receiving the raw text input by the user.
[0089] The text parsing module, connected to the text receiving module, is used to execute step S200. It includes a case classification unit and a fact extraction unit, corresponding to steps S201 and S202 respectively.
[0090] The knowledge storage module is used to store and manage the legal element diagrams corresponding to different legal causes of action. This provides data support for step S300.
[0091] The state management module, connected to both the text parsing module and the knowledge storage module, is used to execute steps S400 and S700. Internally, it includes a semantic matching unit for calculating similarity and a state maintenance unit for updating and saving the state of the graph nodes. Or satisfaction rating .
[0092] The reasoning control module, connected to the state management module and the knowledge storage module, is the control center of the system. This module includes a path decision unit and a question-and-answer generation unit. The path decision unit executes step S500 to implement the decision logic for the follow-up question; the question-and-answer generation unit executes step S600 to generate follow-up question information. The reasoning control module is also responsible for controlling the execution flow and termination judgment (step S800) of the system in the main loop (the iterative process consisting of steps S500-S700).
[0093] The conclusion generation module, connected to the state management module and the knowledge storage module, is used to execute step S900 when the termination condition is met. Internally, it includes a path search unit for extracting reasoning paths (S901) and a text synthesis unit for synthesizing the final legal conclusion (S902).
[0094] The intermediate analysis module, as an optional extension module, connects to the question-and-answer generation unit of the state management module and the inference control module to implement intermediate analysis information. The generation function.
[0095] The text output module, connected to the question-and-answer generation unit, intermediate analysis module, and conclusion generation module, is used to present follow-up questions, intermediate analysis information, and final conclusions to the user.
[0096] The modules exchange and call data through predefined internal interfaces to form a complete processing pipeline.
[0097] The following simplified example is used to illustrate the technical solution of the present invention. This example is only used to explain the principle and not to limit the application scenario:
[0098] 1. Input and Parsing: The system receives the user's input text: "An accident occurred in the workshop during work, resulting in an arm injury." After parsing, the cause of action, CT, is identified as "work-related injury determination," and the initial facts are extracted, such as the location being "workshop," and the result is "injury."
[0099] 2. Knowledge Invocation and State Initialization: The system invokes the legal requirements map for "Work Injury Determination". .set up Includes core component nodes: (An employment relationship exists) (The accident occurred at the workplace) (Injury due to work-related reasons), and conclusion points. (Constitutes a work-related injury), the logical relationship is as follows: Initial matching showed that the actual "workshop" supports this. Therefore Set to true; and It is false.
[0100] 3. Decision-Making and Generation: The system pursues the goal of decision-making through inquiry. Because... premise Satisfied. Joined And selected as .
[0101] System generates follow-up questions Was the accident caused by the performance of work duties?
[0102] 4. Interaction and Status Update: The user replies: "Yes, this occurs when operating the specified device."
[0103] The system extracts this fact, matches it, and updates it. It is true. At this time, It became the only unmet core requirement.
[0104] 5. Iteration and Termination: Questioning the System for the Next Round of Decisions .
[0105] After the user confirms the existence of an employment relationship Updated to true. All core components are true, satisfying the termination condition.
[0106] 6. Conclusion Generation: The system extracts from... , , arrive The reasoning path is used to synthesize the conclusion text, explaining that based on the confirmed labor relationship, workplace, and work-related reasons, the situation meets the core requirements for work-related injury determination.
[0107] In summary, this invention constructs a legal element graph as a reasoning framework, dynamically maintains node states during dialogue, and intelligently determines the inquiry target based on topological dependencies, thus achieving multi-round guided interaction from incomplete initial consultation to the generation of legal conclusions. The above specific embodiments are detailed descriptions of the technical solution of this invention, and not limitations. Those skilled in the art can make various modifications within the spirit and scope of the appended claims.
[0108] Finally, the following points should be noted: First, in the description of this application, it should be noted that, unless otherwise specified and limited, the terms "installation", "connection", and "linkage" should be interpreted broadly, and can be mechanical or electrical connections, or internal connections between two components, or direct connections. "Up", "down", "left", "right", etc. are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may change.
[0109] Secondly: The accompanying drawings of the embodiments disclosed in this invention only involve the structures involved in the embodiments disclosed in this invention. Other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of this invention can be combined with each other.
[0110] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A legal question-and-answer intelligent interactive method, characterized in that, Includes the following steps: S1. Receive the user's initial legal consultation text; S2. Analyze the initial legal consultation text to identify the corresponding legal cause of action and the initial legal fact information contained therein; S3. Based on the legal cause of action, call the pre-constructed corresponding legal element graph. The legal element graph contains multiple legal element nodes and directed edges connecting these nodes, where a directed edge indicates that there is a logical premise relationship between the two legal element nodes it connects. S4. Match the initial legal fact information with the nodes in the legal element map to determine the nodes that have been satisfied and the nodes that have not been satisfied in the map; S5. Based on the topology and node satisfaction status of the legal requirements graph, execute the inquiry target decision process, which includes: firstly, finding all nodes that are not satisfied and whose logical premise nodes have been satisfied as candidate targets; if there are candidate targets, select the current inquiry target from them; otherwise, select the current inquiry target from all unsatisfied nodes according to the preset heuristic rules. S6. Generate and present follow-up information to the user based on the legal requirements corresponding to the current follow-up target; S7. Receive the user's reply text in response to the follow-up question, extract supplementary legal fact information from it, and update the satisfaction status of the nodes in the legal element graph accordingly; S8. Iterate through steps S5 to S7 until the preset iteration termination condition is met. S9. When the iteration termination condition is met, the final legal conclusion is generated based on the final satisfaction state of the nodes in the legal element graph.
2. The intelligent interactive method for legal question answering according to claim 1, characterized in that, In each iteration of step S8, while generating and presenting follow-up information to the user in step S6, intermediate analysis information is also generated and presented. The intermediate analysis information is generated based on all currently satisfied legal requirement nodes and the legal logical connections established between these nodes and unsatisfied nodes through directed edges.
3. The intelligent interactive method for legal question answering according to claim 1, characterized in that, In step S5, the preset heuristic rule is: calculate the topological distance from each unsatisfied node to the preset conclusion node in the graph, and preferentially select the node with the closer topological distance as the current inquiry target.
4. The intelligent interactive method for legal question answering according to claim 1, characterized in that, In step S4, the process of matching factual information with legal requirement nodes includes: calculating the similarity between the semantic representation of the factual information and the semantic representation of the requirement description text corresponding to the node; when the similarity exceeds a set threshold, it is determined that the factual information satisfies the corresponding legal requirement node.
5. The intelligent interactive method for legal question answering according to claim 1, characterized in that, The preset iteration termination condition includes: all nodes marked as core elements in the legal element map have been determined to be satisfied.
6. The intelligent interactive method for legal question answering according to claim 1 or 5, characterized in that, In step S9, generating the final legal conclusion includes: in the legal elements graph, finding all logical paths that start from the already satisfied nodes and ultimately point to the conclusion node, converting the logical paths into legal reasoning chains expressed in natural language, and forming a legal conclusion text based on this.
7. A precise legal question-and-answer system, characterized in that, include: The text receiving module is used to receive legal consultation texts and response texts input by the user. A text parsing module, connected to the text receiving module, is used to parse text and identify legal causes of action and legal fact information; The knowledge storage module is used to store pre-built legal element maps for different legal causes of action, wherein the maps are composed of legal element nodes with logical premise relationships; The status management module is connected to the text parsing module and the knowledge storage module respectively. It is used to match the identified legal fact information with the legal element nodes in the knowledge storage module and maintain the real-time satisfaction status of each node in the graph. The reasoning control module is connected to the state management module and the knowledge storage module, and the reasoning control module includes: The path decision unit is used to determine the current legal requirement target to be investigated based on the topology of the graph in the knowledge storage module and the node satisfaction status provided by the state management module. The question-and-answer generation unit, connected to the path decision unit, is used to generate follow-up question information based on the current legal requirements to be followed up. The output module, connected to the question-and-answer generation unit, is used to output the follow-up question information to the user; The system receives the user's response to follow-up questions through the text receiving module, and iteratively processes the response through the text parsing module, the state management module, the inference control module, and the output module in sequence, until the inference control module determines that the termination condition has been met. The conclusion generation module, connected to the state management module and the knowledge storage module, is used to generate a legal conclusion based on the final satisfaction state of the node and the graph logic when the termination condition is met, and present it through the output module.
8. The legal question-and-answer precision response system according to claim 7, characterized in that, It also includes an intermediate analysis module, which is connected to the state management module and the output module. In each round of interaction, the intermediate analysis module generates intermediate information describing the current legal analysis progress based on the currently satisfied nodes and their logical associations, and the output module outputs the information.
9. The accurate legal question-and-answer system according to claim 7, characterized in that, The path decision unit includes a distance calculation subunit, which is used to calculate the logical path length from unsatisfied nodes to preset conclusion nodes in the graph, and prioritize the nodes according to the length to assist in decision-making.
10. The accurate legal question-and-answer system according to claim 7, characterized in that, The state management module maintains a satisfaction evaluation value for each node in the graph. The satisfaction evaluation value is dynamically adjusted based on the semantic relevance and certainty of the matched legal fact information. The reasoning control module determines whether a node satisfies the logical condition based on whether the satisfaction evaluation value reaches the corresponding threshold.