Intelligent law consultant system based on knowledge graph and case library
By combining multimodal fusion parsing and intelligent inquiry engine with knowledge graphs and three-level review, we have solved many of the shortcomings of existing legal AI systems and achieved efficient, accurate and reliable structured processing and analysis of legal information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 杨添羽
- Filing Date
- 2025-07-24
- Publication Date
- 2026-04-24
AI Technical Summary
Existing legal AI systems suffer from problems such as insufficient accuracy of content, lack of multimodal understanding, rigid interaction mechanisms, defects in knowledge representation, lack of review mechanisms, and rough case matching in the legal field. These issues lead to problems such as fabricated legal provisions, omissions in interactive information, weak management of the timeliness of legal provisions, inability to accurately quantify judgment results, and difficulty in cross-domain case association.
It employs multimodal fusion parsing technology to process text, images, PDFs, and handwritten materials. Combined with an intelligent questioning engine, knowledge enhancement and retrieval modules, DeepSeek API, and a three-level review mechanism, it achieves contract clause recognition, judgment structuring, legal provision timeliness management, hallucination detection, and risk warnings, generating structured legal reports.
It achieves precise structured processing of multimodal inputs, ensures the integrity of case information, prevents fabricated legal provisions, provides logically rigorous legal advice, quantifies legal relationships and risks, and builds an efficient end-to-end legal AI assistance system.
Smart Images

Figure CN121921807A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to a legal intelligent advisory system based on knowledge graphs and case libraries. Background Technology
[0002] As the application of artificial intelligence technology in the legal field deepens, existing legal AI systems mainly present four technical routes: traditional legal information systems based on keyword retrieval (such as Peking University Law Database), question-and-answer systems based on rule templates (such as the 12348 hotline), text analysis tools based on deep learning (such as the CAIL competition model), and general assistants based on large language models (such as ChatLaw). These systems face fundamental limitations in practical applications: traditional retrieval relies on surface keyword matching, making it difficult to understand the semantic relationship between "traffic accident liability determination" and "damage compensation"; rule templates have poor scalability, requiring manual compilation of a large number of decision trees for new domains; large models suffer from serious content illusions, fabricating legal provisions (such as generating a non-existent Article 1523 of the Civil Code) and fabricating case numbers; lack of multimodal processing capabilities, unable to parse unstructured inputs such as contract texts and handwritten IOUs; rigid interaction mechanisms, only able to reply "cannot judge" when user information omits key elements (such as the time of debt or the level of work-related injury); single-dimensional case retrieval, ignoring professional characteristics such as legal relationships and points of contention; and generally lacking content review mechanisms, erroneous legal advice may lead to serious consequences.
[0003] The existing system suffers from six core defects: Insufficient content accuracy – the large language model has a high illusion rate, leading to fabricated legal provisions, confusion of legal sources (e.g., mistaking articles from the Criminal Law for content from the Civil Code), and citation of repealed regulations (e.g., using the expired Contract Law); Lack of multimodal understanding – it only supports plain text input and lacks structured parsing capabilities for evidence materials such as PDF contracts, WeChat chat screenshots, and handwritten medical documents; Rigid interaction mechanism – it lacks a case element completeness judgment model and cannot proactively guide users to supplement key information such as loan time, employment relationship status, and accident liability determination; Defective knowledge representation – weak management of legal provisions' timeliness, making it difficult to synchronize with legal revisions in a timely manner (e.g., the Civil Code replacing old laws), and case retrieval relies solely on text similarity while ignoring the hierarchy of legal elements; Blank review mechanism – it lacks functions for checking the factual consistency of generated content, verifying logical rationality, and providing risk warnings; Coarse case matching – it cannot accurately quantify the reference value of judgment results, and cross-domain case association is difficult. Therefore, a legal intelligent advisory system based on knowledge graphs and case databases is proposed to address the above issues. Summary of the Invention
[0004] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a legal intelligent advisor system based on knowledge graphs and case libraries to address the problems raised in the background section.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a legal AI advisory system based on multimodal fusion and structured questioning mechanism, comprising: The multimodal input parsing module is used to uniformly process text, images, PDF documents, Word documents and handwritten materials. By integrating OCR recognition technology, entity extraction technology and document structure analysis technology, it can realize the hierarchical recognition of contract clauses, the structuring of judgment paragraphs and cross-document correlation analysis. The intelligent follow-up questioning engine dynamically generates follow-up questioning paths based on predefined legal element templates. The templates contain a set of mandatory elements for three types of cases: loan disputes, labor disputes, and traffic accidents. The engine calculates the priority score of missing elements through an element completeness judgment unit (importance weight × 0.4 + dependency weight × 0.3 + information gain weight × 0.2 + user friendliness × 0.1) and switches between clarifying, direct, and confirming follow-up questioning strategies according to the dialogue rounds. The knowledge enhancement and retrieval module integrates a legal knowledge graph and a vector database. The knowledge graph dynamically manages the legal citation network and timely versions, while the vector database adopts a multi-dimensional case similarity calculation model (case facts weight 0.35, legal relationship weight 0.20, legal dispute weight 0.20, judgment result weight 0.02). The DeepSeek API integration module includes a legal-specific prompt word engineering unit and an illusion detection filter. The prompt word engineering unit injects legal constraints and case context, while the illusion detection filter matches the format of Article X of the "Law Name" using regular expressions and verifies the local legal database, while simultaneously blocking fictitious case numbers. The content generation and review module adopts a three-level pipeline review mechanism: the first level is an adversarial training model to detect legal concept illusions, the second level is a rule engine to verify the logical chain of legal citations, and the third level is to add risk warning statements; The legal report generation module adaptively selects templates based on case type and automatically generates a structured report containing a directed graph of legal relationships, a risk assessment matrix, and a heatmap of evidentiary strength. The system integration interface supports batch RESTful API consultation, real-time multi-turn WebSocket conversation persistence, and synchronous conversion of report formats (PDF / DOCX / HTML).
[0006] Preferably, the multimodal input parsing module specifically performs: using a machine learning model to identify the types of contract, judgment, and evidence material documents, extracting legal entities such as parties, amounts, and dates through a pre-trained NER model, establishing a cross-document reference relationship detection mechanism, and adopting OCR recognition enhanced by differential privacy for handwritten materials.
[0007] Preferably, the legal element templates of the intelligent questioning engine include: the borrowing dispute template requires five elements: borrowing amount, borrowing time, repayment agreement, interest clause, and borrowing certificate; the labor dispute template requires three elements: labor relationship status, salary standard, and dispute matters; the traffic accident template requires five elements: accident time, location, liability determination, casualties, and property damage.
[0008] Preferably, the statute timeliness management of the knowledge enhancement and retrieval module includes: automatically marking repealed laws and associating alternative provisions, establishing a timeline index for the applicable relationship between old and new laws; the case retrieval adopts an adaptive weight fusion strategy. When the query case information is complete, the weight of the case facts is increased to 0.45, and when the information is missing, the weight of the legal issue is increased to 0.30.
[0009] Preferably, the operations of the hallucination detection filter include: extracting statute references through the regular expression r'《(\[^》\]+)》第(\d+)条' and checking the validity of the local legal database; verifying the authenticity of cases through the case number pattern r'\((\d{4})\)(\[^)\]+)(\d+)号'; performing semantic analysis based on the thesaurus.
[0010] Preferably, the visualization chart generation of the legal report generation module includes: the legal relationship directed graph uses edge weights to represent the intensity of rights and obligations; the risk assessment matrix marks the risk level with the probability of occurrence and the degree of impact as the coordinate axes; the probative force heat map is colored in three levels according to the intensity of probative force.
[0011] Preferably, the batch processing function of the system integration interface is implemented through a Celery distributed task queue, dynamically allocating GPU resources. The WebSocket interface supports the persistence of the questioning session state, and the report format conversion adopts a unified rendering engine.
[0012] A legal consultation service method based on multimodal fusion includes the following steps: S1. Receive the text and multimodal attachments input by the user, and analyze the case situation through document type recognition and entity extraction. S2. Match the legal element template corresponding to the case type, generate a questioning sequence according to the priority, and supplement the missing elements through multiple rounds of dialogue. S3. Retrieve the time-limited laws in the knowledge graph and similar cases in the vector database, where the similarity calculation of similar cases comprehensively considers dimensions such as factual features, legal relationships, and legal issues. S4. Construct a large model for inputting legal constraint prompts to generate an initial draft, which undergoes a three-level review process: illusion detection, logic verification, and risk warning. S5. Adaptively selects report templates to generate professional legal reports with visual charts, and outputs multiple formats including PDF, DOCX, and HTML.
[0013] The technical effects and advantages of this invention are as follows: Compared to existing technologies, this invention achieves structured processing of contracts, judgments, and handwritten materials through multimodal fusion parsing technology, and accurately extracts legal entities using differential privacy OCR and document hierarchical analysis; the intelligent questioning engine based on element templates generates clarifying or direct questions through a dynamic priority algorithm (weighted by importance / dependency / information gain / user-friendliness) to ensure the integrity of case information; the knowledge-enhanced retrieval module integrates the timeliness management of legal knowledge graphs and multi-dimensional similarity calculations of vector databases (comprehensive weighting of case details / legal relationships / points of contention) to ensure the accuracy of legal provisions and similar case citations; DeepSeek... The API integration module employs legally specific prompts and regular expression-driven illusion detection, combined with real-time verification using a local database, to completely eliminate fabricated legal provisions and cases. A three-tiered review pipeline ensures the logical rigor of the content through adversarial models, rule engines, and risk warning mechanisms. The adaptive report generation module transforms legal relationships into edge-weighted directed graphs, risk matrix coordinates, and evidence heatmaps, enabling a quantitative presentation of legal analysis. The system interface layer relies on Celery distributed tasks and WebSocket session persistence to simultaneously support high-concurrency batch processing and real-time interaction, ultimately constructing an end-to-end, accurate, reliable, and efficient legal AI assistance system. Attached Figure Description
[0014] Figure 1 This is a system architecture diagram of the present invention.
[0015] Figure 2 This is a flowchart of the multimodal analysis process of the present invention.
[0016] Figure 3 This is the logic diagram for the intelligent questioning of the present invention.
[0017] Figure 4 This is a schematic diagram of the timeline index of the present invention.
[0018] Figure 5 This is a flowchart of the unified rendering engine for this invention. Detailed Implementation
[0019] 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.
[0020] Example 1 As attached Figure 1-5 The legal AI advisory system shown is based on multimodal fusion and structured questioning mechanisms, characterized by comprising: The multimodal input parsing module is used to uniformly process text, images, PDF documents, Word documents and handwritten materials. By integrating OCR recognition technology, entity extraction technology and document structure analysis technology, it can realize the hierarchical recognition of contract clauses, the structuring of judgment paragraphs and cross-document correlation analysis. The intelligent follow-up questioning engine dynamically generates follow-up questioning paths based on predefined legal element templates. The templates contain a set of mandatory elements for three types of cases: loan disputes, labor disputes, and traffic accidents. The engine calculates the priority score of missing elements through an element completeness judgment unit (importance weight × 0.4 + dependency weight × 0.3 + information gain weight × 0.2 + user friendliness × 0.1) and switches between clarifying, direct, and confirming follow-up questioning strategies according to the dialogue rounds. The knowledge enhancement and retrieval module integrates a legal knowledge graph and a vector database. The knowledge graph dynamically manages the legal citation network and timely versions, while the vector database adopts a multi-dimensional case similarity calculation model (case facts weight 0.35, legal relationship weight 0.20, legal dispute weight 0.20, judgment result weight 0.02). The DeepSeek API integration module includes a legal-specific prompt word engineering unit and an illusion detection filter. The prompt word engineering unit injects legal constraints and case context, while the illusion detection filter matches the format of Article X of the "Law Name" using regular expressions and verifies the local legal database, while simultaneously blocking fictitious case numbers. The content generation and review module adopts a three-level pipeline review mechanism: the first level is an adversarial training model to detect legal concept illusions, the second level is a rule engine to verify the logical chain of legal citations, and the third level is to add risk warning statements; The legal report generation module adaptively selects templates based on case type and automatically generates a structured report containing a directed graph of legal relationships, a risk assessment matrix, and a heatmap of evidentiary strength. The system integration interface supports batch RESTful API consultation, real-time multi-turn WebSocket conversation persistence, and synchronous conversion of report formats (PDF / DOCX / HTML).
[0021] In this embodiment, the legal AI advisor system described in claim 1 is implemented as follows: 1. Multimodal input parsing module Users upload PDF accident liability determination reports and handwritten medical expense receipts. System call MultimodalProcessor: Using PaddleOCR to recognize handwritten content on a receipt (with differential privacy optimization), the amount "¥12,800" was extracted. Analyzing the structure of the PDF document, the liability determination letter is divided into three parts: "Description of Facts", "Determination of Liability", and "Legal Basis". Establish a link between receipts and incidents (by matching timestamps). 2. Intelligent follow-up question engine Matching traffic accident templates (5 elements): Detecting missing "property damage" element Priority calculation (weight formula: 0.4 × Importance + 0.3 × Dependency + 0.2 × Information Gain + 0.1 × User-friendliness): (Code) score = 0.4*0.9 + 0.3*0.6 + 0.2*0.7 - 0.1*0.2 = 0.82 # High priority Based on the initial dialogue, a clarifying follow-up question was asked: "Was the accident damaging the vehicle? Approximately how much would the repairs cost?" 3. Knowledge Enhancement and Retrieval Module Knowledge graph retrieval of Article 76 of the Road Traffic Safety Law (2023 revised version) automatically marks repealed clauses from the previous version. Perform case retrieval using a vector database: Calculate the multidimensional similarity: Factual features 0.35 × 0.85 + Legal relationship 0.20 × 0.92 + Legal dispute 0.20 × 0.78 + Judgment result 0.02 × 0.65 = 0.83 Returning to (2023) Hu 01 Min Zhong 5678 as a reference case 4. DeepSeek API Integration Module Hint word engineering injection constraints: (Code) self.legal_constraints = "1. The validity of citing the Road Traffic Safety Law needs to be verified; 2. Disability compensation is based on the 2023 urban residents' disposable income standard." Hallucination detector in operation: The regular expression r'《([^》]+)》Article (\d+)' intercepts false clauses "Article 25 of the Traffic Accident Handling Regulations" The case number verifier rejected the fabricated case "(2023)Supreme People's Court Civil Final Judgment No. 9999". 5. Content Generation and Review Module Three-level review process: L1: The adversarial training model accurately detected the concept of "Level 10 Disability Compensation Standard". L2: The rule engine verifies the consistency between the liability ratio (70%) and the compensation calculation logic chain. L3: Add risk warning: "The statute of limitations is one year; the lawsuit must be filed before June 2024." 6. Legal Report Generation Module Select a traffic accident report template Generate visualization components: Directed graph of legal relationships: edge weight 0.7 (liability of the party primarily liable for compensation). Risk assessment matrix: The statute of limitations risk is positioned in the high-risk zone [probability 0.6, impact 0.8]. Evidence strength heatmap: Liability determination letter is dark red (proof strength 0.95), handwritten receipt is yellow (0.65). 7. System Integration Interface WebSocket maintains session state: storing follow-up paths and collected elements. Simultaneously output reports in three formats: PDF (formatted according to standards), DOCX (editable tables), and HTML (interactive heatmap).
[0022] Example 2 Based on Embodiment 1, the solution in Embodiment 1 will be further described in detail below, with reference to the specific working method described in detail: like Figure 1-3 As shown, in a preferred embodiment, a legal AI advisory system based on multimodal fusion and structured questioning mechanism is characterized in that the multimodal input parsing module specifically performs the following: using a machine learning model to identify contract, judgment, and evidence document types; extracting legal entities such as parties, amounts, and dates through a pre-trained NER model; establishing a cross-document citation relationship detection mechanism; and employing differential privacy-enhanced OCR recognition for handwritten materials; as the multimodal input parsing module Technical details: When a user uploads a PDF version of the "Commercial Housing Sales Contract" and a handwritten "Supplementary Agreement": 1. Document type recognition: Call the DocumentProcessor._identify_document_type() method: # Extract document features: Title contains "sales contract", complete clause structure features = extract_features("contract.pdf") doc_type = doc_classifier.predict(features) # Output "contract" 2. Content Analysis: PDF parsing uses the PyPDF2 library to extract the text layer while preserving paragraph structure. paragraphs = pdf_parser.extract_structure("contract.pdf") # Output: ["First subject matter", "Second price..."] Contract terms identification uses the BiLSTM-CRF model: clauses = clause_parser.parse("Price: RMB 5,000,000") # Output: {"type": "price", "amount": 5000000, "currency": "CNY"} 3. Handwritten material processing: OCR with differential privacy enhancement: text = ocr_engine.recognize("supplement.jpg", privacy_noise_scale=0.1) # Add Laplace noise # Output: "Supplementary Clause: Garage belongs to the buyer" 4. Cross-document association: Establish the reference relationship between the main contract and the supplementary agreement: link_refs("contract.pdf[Article 3]", "supplement.jpg[Garage Clause]").
[0023] In this embodiment, the legal element templates of the intelligent inquiry engine include: a loan dispute template requiring five elements: loan amount, loan time, repayment agreement, interest terms, and loan voucher; a labor dispute template requiring three elements: employment relationship status, wage standard, and disputed matters; and a traffic accident template requiring five elements: accident time, location, liability determination, injuries and fatalities, and property damage. As a template for the intelligent inquiry engine, the loan dispute case implementation process is as follows: 1. Template matching: Load loan dispute template: template = LegalTemplates.templates["Loan Disputes"] required = template["required_elements"] # 5 elements 2. Missing item detection: User description: "Borrowed 500,000 yuan, not repaid" → Missing "Repayment Agreement," "Interest Terms," and "Loan Certificate" 3. Priority Calculation: # Interest Clause Score score_interest = ( 0.4 * 0.9 + # Importance (affects compensation calculation) 0.3 * 0.7 + # Dependency relationship (principal must be confirmed first) 0.2 * 0.8 - # Information gain (determines whether to claim interest) 0.1 * 0.2 # User-friendliness (sensitive issues will be downgraded) ) = 0.82 4. Follow-up questions generated: The first round adopted a clarification strategy: Question = "Was interest agreed upon when you took out the loan? If so, was it an annual interest rate or a monthly interest rate?"
[0024] In this embodiment, the legal provision timeliness management of the knowledge enhancement and retrieval module includes: automatically marking repealed laws and associating them with replacement provisions; establishing a timeline index for the application relationship between old and new legal provisions; employing an adaptive weight fusion strategy for case retrieval, increasing the weight of case facts to 0.45 when the case information is complete, and increasing the weight of legal disputes to 0.30 when information is missing; adjusting knowledge retrieval weights; and implementing details for labor dispute cases. 1. Statute of limitations management of legal provisions: Knowledge graphs automatically mark obsolete clauses: mark_deprecated("Article 28 of the Labor Law", replacement="Article 46 of the Labor Contract Law") Create a timeline index: (as shown in the appendix Figure 4 ).
[0025] 2. Dynamic weight adjustment: When the user only provides vague information such as "dismissed": if user_input.completeness < 0.6: weights["facts"] = 0.25 # original 0.35 weights["legal_issues"] = 0.30 # original 0.20 Similarity calculation: score = 0.25*fact_sim + 0.30*issue_sim + 0.20*relation_sim... In this embodiment, the operations of the hallucination detection filter include: extracting legal article references through the regular expression r'《(\[^》\]+)》第(\d+)条', checking the validity of the local legal database; verifying the authenticity of cases through the case number pattern r'\((\d{4})\)(\[^)\]+)(\d+)号'; conducting semantic analysis based on the thesaurus; as a hallucination detection filter, the implementation steps for the contract review scenario: 1. Legal article reference extraction: Regular matching: matches = re.finditer(r'《(\w+)》第(\d+)条', "根据《合同法》第39条...") # Capture groups: ("Contract Law", "39") 2. Local database verification: Query the SQLite legal database: SELECT status FROM laws WHERE name='Contract Law' AND article=39; -- Return "deprecated" (abolished) 3. Intercept fictional cases: Verify the case number "(2023) Supreme People's Court Civil Final Appeal No. 9999": if case_no > max_case_num("Supreme People's Court", 2023): # The actual maximum number is 4567 flag_as_hallucination() 4. Sensitive content filtering: Based on a sensitive word database and BERT classification model: risk_level = sensitive_classifier.predict("special vocabulary") # Output: "high_risk", triggering replacement.
[0026] In this embodiment, the visualization chart generation of the legal report generation module includes: a directed graph of legal relationships using edge weights to represent the strength of rights and obligations; a risk assessment matrix using probability of occurrence and degree of impact as coordinate axes to label risk levels; and an evidence strength heatmap colored in three levels according to the strength of probative force. Details of the implementation of work injury compensation reports: Directed graph of legal relationships: Build using NetworkX: G.add_edge("Employer", "Employee", weight=0.9, label="Work Injury Insurance Liability") G.add_edge("Social Security Agency", "Employer", weight=0.6, label="Supplementary Compensation") Edge weight mapping to line width: line_width = weight * 10 Risk assessment matrix: Coordinate axis definition: X-axis: Probability of occurrence (0-5 levels) Y-axis: Influence level (0-5) Risk assessment for missing evidence: (3.5, 4.2) → High-risk area (red) Evidence strength heatmap: Evidence type, probative value, RGB value Work-related injury determination certificate 0.95 (0, 128, 0) Eyewitness testimony: 0.45 (255, 165, 0) Unit monitoring is missing 0.0 (128, 128, 128).
[0027] In this embodiment, the batch processing function of the system integration interface is implemented through the Celery distributed task queue, which dynamically allocates GPU resources. The WebSocket interface supports persistent session state tracking, and the report format conversion uses a unified rendering engine. Batch processing function technical details: Celery Distributed Tasks: @celery_app.task(autoretry_for=(TimeoutError,), max_retries=3) def process_consultation(case): # Dynamic GPU allocation gpu_type = "A100" if case.complexity>0.7 else "V100" allocate_gpu(gpu_type) WebSocket session persistence: Redis storage structure: json { "session_id": "WS202406001", "collected_elements": {"Loan Amount": 50000, "Loan Date": "2023-01-01"}, "missing_elements": ["Interest agreement"], "conversation": [ {"role": "user", "content": "Friend borrowed money and didn't pay it back..."}, {"role": "system", "content": "Please specify the loan amount..."} ] } Report format conversion: Unified rendering engine workflow: (as attached) Figure 5 (As shown).
[0028] A legal consulting service method based on multimodal fusion includes the following steps: S1. Receive text input from the user and multimodal attachments, and analyze the case through document type recognition and entity extraction; S2. Match the legal element templates corresponding to the case type, generate a sequence of follow-up questions according to priority, and supplement the missing elements through multiple rounds of dialogue; S3. Retrieve time-limited legal provisions from the knowledge graph and similar cases from the vector database, where the similarity calculation of similar cases takes into account the dimensions of factual features, legal relationships, and legal disputes; S4. Construct a large model for inputting legal constraint prompts to generate an initial draft, which undergoes a three-level review process: illusion detection, logic verification, and risk warning. S5. Adaptively select report templates to generate professional legal reports with visual charts, and output multiple formats including PDF / DOCX / HTML; Intellectual Property Infringement Case Implementation Process: Input parsing: Analysis of Design Drawing Copyright Registration Certificate: extract_text("cert.pdf") # Output: "Registration Number: National Work Registration No.-2023-F-123456" Image recognition of infringing products: brand = ocr_engine.detect("product.jpg") # Output: "Counterfeit XX brand" Follow-up questions on key elements: The detection lacked "evidence of profits gained from infringement": generate_followup("element": "Sales Evidence", "template": "Please provide a screenshot of the sales record on the e-commerce platform") Knowledge retrieval: Legal provision search: Article 53 of the Copyright Law (vector similarity 0.92) Case matching: (2022) Jing 73 Min Zhong 567 (Multidimensional similarity 0.88) Content review: Three-level review process: # L1: Adversarial Model Validation of the Concept of "Copyright of Artworks" # L2: Rule chain checks the logic of "registration certificate validity → infringement determination → compensation calculation" # L3: Add risk warning "Statutory compensation limit of 5 million yuan" Report output: Generate infringement comparison image: gen_comparison_chart(original="design.png", infringing="product.jpg").
[0029] Technical parameters and effects Algorithm parameters: Priority formula weights: 0.4 / 0.3 / 0.2 / 0.1 Similarity calculation base weights: 0.35 / 0.20 / 0.20 / 0.02 Performance metrics: Module response time accuracy data source Multimodal resolution 1.2s 98.5% Hallucination detection: 0.05s, 99.2% Report generated in 8.7 seconds (97.3%). Hardware configuration: GPU: NVIDIA A100 (80GB VRAM) OCR-specific optimization: FP16 accuracy acceleration 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. 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. 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 AI advisory system based on multimodal fusion and structured questioning mechanism, characterized in that, include: The multimodal input parsing module is used to uniformly process text, images, PDF documents, Word documents and handwritten materials. By integrating OCR recognition technology, entity extraction technology and document structure analysis technology, it can realize the hierarchical recognition of contract clauses, the structuring of judgment paragraphs and cross-document correlation analysis. The intelligent follow-up questioning engine dynamically generates follow-up questioning paths based on predefined legal element templates. The templates contain a set of mandatory elements for three types of cases: loan disputes, labor disputes, and traffic accidents. The engine calculates the priority score of missing elements through an element completeness judgment unit (importance weight × 0.4 + dependency weight × 0.3 + information gain weight × 0.2 + user friendliness × 0.1) and switches between clarifying, direct, and confirming follow-up questioning strategies according to the dialogue rounds. The knowledge enhancement and retrieval module integrates a legal knowledge graph and a vector database. The knowledge graph dynamically manages the legal citation network and timely versions, while the vector database adopts a multi-dimensional case similarity calculation model (case facts weight 0.35, legal relationship weight 0.20, legal dispute weight 0.20, judgment result weight 0.02). The DeepSeek API integration module includes a legal-specific prompt word engineering unit and an illusion detection filter. The prompt word engineering unit injects legal constraints and case context, while the illusion detection filter matches the format of Article X of the "Law Name" using regular expressions and verifies the local legal database, while simultaneously blocking fictitious case numbers. The content generation and review module adopts a three-level pipeline review mechanism: the first level is an adversarial training model to detect legal concept illusions, the second level is a rule engine to verify the logical chain of legal citations, and the third level is to add risk warning statements; The legal report generation module adaptively selects templates based on case type and automatically generates a structured report containing a directed graph of legal relationships, a risk assessment matrix, and a heatmap of evidentiary strength. The system integration interface supports batch RESTful API consultation, real-time multi-turn WebSocket conversation persistence, and synchronous conversion of report formats (PDF / DOCX / HTML).
2. The legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The multimodal input parsing module specifically performs the following: using a machine learning model to identify the document types of contracts, judgments, and evidence materials; extracting legal entities such as parties, amounts, and dates through a pre-trained NER model; establishing a cross-document reference relationship detection mechanism; and employing differential privacy-enhanced OCR recognition for handwritten materials.
3. The legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The legal element templates of the intelligent inquiry engine include: the loan dispute template requires five elements: loan amount, loan time, repayment agreement, interest terms, and loan voucher; the labor dispute template requires three elements: labor relationship status, wage standard, and disputed matters; and the traffic accident template requires five elements: accident time, location, liability determination, injuries and fatalities, and property damage.
4. The legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The statute timeliness management of the knowledge enhancement and retrieval module includes: automatically marking repealed laws and associating alternative provisions, and establishing a timeline index for the application relationship between old and new statutes; the case retrieval adopts an adaptive weight fusion strategy, increasing the weight of case facts to 0.45 when the queried case information is complete, and increasing the weight of legal issues to 0.30 when the information is missing.
5. A legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The operations of the hallucination detection filter include: extracting statute citations through the regular expression r'《(\[^》\]+)》第(\d+)条', and verifying the validity of the local legal database; verifying the authenticity of cases through the case number pattern r'\((\d{4})\)(\[^)\]+)(\d+)号'; intercepting politically sensitive content based on the sensitive word library and semantic analysis.
6. The legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The visualization chart generation of the legal report generation module includes: the directed graph of legal relationships represents the intensity of rights and obligations with edge weights; the risk assessment matrix marks the risk level with the probability of occurrence and the degree of impact as the coordinate axes; the heat map of probative force is colored in three levels according to the intensity of probative force.
7. A legal AI advisory system based on multimodal fusion and structured questioning mechanism according to claim 1, characterized in that, The batch processing function of the system integration interface is implemented through the Celery distributed task queue, dynamically allocating GPU resources, the WebSocket interface supports the persistence of the follow-up conversation state, and the report format conversion adopts a unified rendering engine.
8. A legal consulting service method based on multimodal fusion, characterized in that, It includes the following steps: S1. Receive the text and multimodal attachments input by the user, and analyze the case situation through document type recognition and entity extraction; S2. Match the legal element template corresponding to the case type, generate a follow-up sequence according to the priority, and supplement the missing elements through multiple rounds of conversation; S3. Retrieve the time-limited statutes in the knowledge graph and similar cases in the vector database, where the similarity calculation of similar cases comprehensively considers the dimensions of factual features, legal relationships, and legal issues; S4. Construct a legal constraint prompt word to input into the large model to generate a draft, which is subject to three-level reviews of hallucination detection, logical verification, and risk reminder; S5. Adaptively select a report template, generate a professional legal report with visualization charts, and output multiple format versions of PDF / DOCX / HTML.