Law query system based on big data

Through the multi-source data collection, knowledge graph construction and dynamic semantic search of the big data legal query system, the problem of dispersed legal data and low retrieval accuracy is solved, the credible collection and personalized retrieval of legal data is realized, and the efficiency and accuracy of legal work are improved.

CN120448523APending Publication Date: 2025-08-08HEILONGJIANG UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510655697.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, legal data is scattered and lacks unified collection methods, data credibility is difficult to guarantee, search depends on keyword matching, cannot understand semantics, low search accuracy, lack similar case prediction and automatic detection of legal conflicts, manual analysis is time-consuming and error-prone.

Method used

A legal query system based on big data is designed, including a multi-source data acquisition module, a data processing module, a knowledge graph construction module, a dynamic semantic search module and an intelligent analysis engine module. Data is captured through distributed crawlers and verified by blockchain hashing to ensure data integrity. A multi-layer knowledge graph is built using a BERT model, and a dynamic weighting algorithm and an intelligent analysis engine are combined for personalized search and analysis.

Benefits of technology

It realizes comprehensive integration and credible collection of legal data, improves search accuracy, reduces manual analysis time, enhances the efficiency and accuracy of legal work, and provides personalized search results and automated prediction of similar case judgments and legal conflict detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448523A_ABST
    Figure CN120448523A_ABST
Patent Text Reader

Abstract

The invention discloses a law query system based on big data, and relates to the technical field of computer science, and the law query system comprises a multi-source data acquisition module, a data processing module, a knowledge graph construction module, a dynamic semantic retrieval module, an intelligent analysis engine module and a security and combination scale module, the system has the advantages that the problems of dispersity and credibility of legal data are remarkably relieved through the multi-source data collection module and the block chain evidence storage technology, in the claims, the multi-source data collection module is in communication connection with a court public database, a legal library and an academic periodical platform, the legal data are captured through distributed crawlers, and the legal data are stored in the block chain evidence storage technology; by means of the design, the system can widely collect legal information from different channels, a comprehensive and credible data basis is provided for legal practitioners and researchers, the legal practitioners and the researchers do not need to spend a large amount of time to verify the authenticity and accuracy of data when querying and analyzing the legal information, and the legal practitioners and the researchers can check the authenticity and accuracy of the data. And the working efficiency and the research quality are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer science and technology, and in particular to a legal inquiry system based on big data. Background Art

[0002] For legal practitioners, when handling various cases, they need to quickly and comprehensively search for relevant legal provisions, judicial interpretations, and past similar cases, based on which they can formulate reasonable litigation strategies or make fair judgments. For example, in commercial dispute cases, lawyers need to quickly find the specific legal provisions applicable to the case, as well as similar judgments with reference value, to provide clients with accurate legal advice and effective agency services. When hearing cases, judges also need to refer to a large amount of legal materials and past precedents to ensure the fairness and rationality of the judgment. When conducting academic research, legal researchers also need to widely collect various legal materials, including changes in legal provisions in different regions and different periods, as well as relevant academic views and research results. The comprehensive collection and in-depth analysis of these materials will help promote the development and improvement of legal theory.

[0003] Existing technologies have certain defects. First, in existing technologies, legal data is scattered across multiple platforms, lacking a unified collection method, and data credibility is difficult to guarantee. Second, traditional searches mostly rely on keyword matching, which cannot understand semantics, resulting in low retrieval accuracy and inability to accurately locate the required information. Furthermore, existing technologies lack similar case prediction and automatic detection of legal conflicts, and manual analysis is time-consuming and error-prone. To this end, we propose a legal query system based on big data. Summary of the Invention

[0004] The purpose of the present invention is to provide a legal inquiry system based on big data.

[0005] To solve the problems raised in the above background technology, the present invention provides the following technical solutions: a legal inquiry system based on big data, the inquiry system comprising a multi-source data acquisition module, a data processing module, a knowledge graph construction module, a dynamic semantic retrieval module, an intelligent analysis engine module, and a security and compliance module;

[0006] Multi-source data acquisition module: Communicates and connects with the court's public database, legal database, and academic journal platform, captures legal data through distributed crawlers, and generates data integrity verification codes through blockchain hash storage. Distributed crawlers refer to the technology of using multiple computing nodes to perform data capture tasks in parallel, which can improve data collection efficiency. The multi-source data acquisition module uses distributed crawlers to capture legal data, which can achieve efficient acquisition of multi-source heterogeneous data, providing a rich data foundation for subsequent data processing and analysis. The data integrity verification code generated through blockchain hash storage can ensure the integrity and non-tamperability of data during the collection, storage, and transmission process, thereby improving the credibility of the data;

[0007] Data processing module: This module receives raw data from the multi-source data acquisition module and uses natural language processing technology to clean, convert, and standardize the data. Natural language processing technology can understand and analyze legal texts in natural language. Through these processes, this module removes noise and erroneous information from the raw data, unifies the data into a standard format, improves data quality, and facilitates the subsequent construction of the knowledge graph.

[0008] Knowledge graph construction module: Receives data processed by the data processing module, extracts legal entities and relationships using a BERT model fine-tuned based on legal domain text, constructs a multi-layer knowledge graph encompassing "legal provisions - case studies - academic opinions", and stores the multi-layer knowledge graph data in the Neo4j graph database. The BERT model is a pre-trained language model based on the Transformer architecture. After being fine-tuned with legal domain text, it can more accurately extract legal entities and relationships. The multi-layer knowledge graph constructed by this module structurally associates knowledge such as legal provisions, case studies, and academic opinions, facilitating in-depth query and analysis of legal information by users.

[0009] Dynamic semantic retrieval module: This module interacts with the knowledge graph construction module and the user terminal. Based on the semantic analysis results of the user identity tag and the query statement, it calls the dynamic weighting algorithm to generate a search priority list and returns the relevant results through the API interface. The dynamic semantic retrieval module uses the dynamic weighting algorithm to generate a search priority list based on the characteristics of the user identity and the query statement, taking into account multiple factors, providing users with personalized and accurate search results to meet the needs of different users.

[0010] Intelligent Analysis Engine Module: This module receives the output data from the dynamic semantic retrieval module, performs similar case judgment prediction, legal conflict detection, and dispute focus cluster analysis, and transmits the analysis results to a visualization terminal. Through these functions, the intelligent analysis engine module can provide valuable reference information for legal practitioners, assisting them in case analysis and decision-making, and improving the efficiency and quality of legal work.

[0011] Security and Compliance Module: Embedded between the multi-source data collection module and the data processing module, it performs real-time desensitization on sensitive information and restricts the user access level through the permission control gateway. Through real-time desensitization of sensitive information and permission control, the security and compliance module can ensure data security and compliance, and protect users' privacy and legitimate rights and interests.

[0012] As a further solution of the present invention: The multi-source data collection module includes a distributed crawler cluster. The distributed crawler cluster uses dynamic IP proxy technology to rotate IP addresses to bypass anti-crawling mechanisms and configures differentiated crawling strategies for different data sources. Specifically, it includes: using captcha recognition and Session persistence technology to maintain a long connection to capture the full text of judgment documents from the court public database, and using OCR technology to parse legal terms in PDF documents on academic journal platforms and extract the citation relationships of legal articles in unstructured text.

[0013] As a further solution of the present invention: The multi-source data collection module further includes a data cleaning unit and a blockchain evidence storage unit. The data cleaning unit matches the case numbers in the judgment documents (in the format such as "(2023) Jing01 Minzhong Computer Science Number") through regular expressions and uniformly converts them into a standard format. The blockchain evidence storage unit calculates the SHA-256 hash value of the data cleaned by the data cleaning unit in blocks according to the timestamp and uploads it to the consortium chain for subsequent verification and invocation.

[0014] As a further solution of the present invention: The data processing module uses a natural language processing model fine-tuned based on legal domain texts to perform词性标注 (pos tagging), named entity recognition, and syntactic analysis on the original data. Through these processes, the original data is converted into structured data, redundant information in the data is removed, and high-quality data is transmitted to the knowledge graph construction module.

[0015] As a further solution of the present invention: The knowledge graph construction module uses a BERT model fine-tuned based on legal domain texts. Its training data includes judgment documents, legal articles, and legal papers with annotated entity types. The entity types include "legal subject", "illegal act", and "legal consequence". Its training loss function is defined as the sum of the cross-entropy loss and the L2 regularization term. The specific formula is as follows:

[0016]

[0017] Where: x i represents the input text, y i It should be noted that "词性标注" in the translation of item is the literal Chinese expression. It should be replaced with the accurate English term "pos tagging" in actual use.Represents the entity label, θ represents the model parameter, and λ represents the weight coefficient. The knowledge graph construction module extracts the "precondition-behavior pattern-legal effect" triple by parsing the logical structure of the legal text, and establishes a bidirectional reference relationship network between the case and the legal text. The parsing results are stored in the Neo4j graph database. Neo4j is a high-performance database specially used for storing and querying graph data. It can efficiently process complex node and relationship data in the knowledge graph, and provide strong support for subsequent semantic retrieval and intelligent analysis.

[0018] As a further solution of the present invention, the dynamic semantic retrieval module calculates the priority score of the retrieval results using a dynamic weighting algorithm. The dynamic weighting algorithm comprehensively considers the semantic similarity between the query statement and the candidate documents, the authority and timeliness of the candidate documents, to ensure the accuracy and relevance of the retrieval results. The specific algorithm formula is as follows:

[0019] S=α·Sim(Q,D)+β·Authority(D)+γ·Freshness(D)

[0020] Where: Q represents the user query statement, D represents the candidate document, Sim(Q,D) represents the cosine similarity based on knowledge graph embedding, which is used to measure the semantic similarity between the query statement and the candidate document, Authority(D) represents the document authority weight, specifically a weight of 1.0 for judicial interpretation and 0.8 for local regulations, which reflects the difference in authority of different types of legal documents, Freshness(D) represents the timeliness weight, which decays by 0.2 for every additional year of publication time, reflecting the impact of the timeliness of legal information on retrieval results, and the coefficients α, β, and γ are dynamically adjusted according to the user identity to achieve personalized retrieval services. The dynamic semantic retrieval module further supports cross-regional legal comparison functions. By mapping legal provisions of different jurisdictions to the "region" attribute node of the knowledge graph, a difference comparison matrix is generated, which facilitates users to intuitively compare the differences in legal provisions in different regions.

[0021] As a further solution of the present invention, the intelligent analysis engine module includes a similar case judgment prediction model unit and a legal conflict detection rule engine unit. The similar case judgment prediction model unit is provided with a similar case judgment prediction model. The similar case judgment prediction model uses a Siamese neural network based on an attention mechanism to calculate the similarity score between the case to be predicted and the historical case library. The specific formula for similarity calculation is as follows:

[0022]

[0023] Where: v cThe case feature vector includes the cause of the case, the completeness of the chain of evidence, the occupation of the parties, the age of the parties, and the past criminal records of the parties. The similar case judgment prediction model provides a basis for similar case judgment prediction by comparing the feature vectors of the case to be predicted with historical cases and evaluating the similarity between them.

[0024] As a further solution of the present invention, the legal conflict detection rule engine unit is provided with a legal conflict detection rule engine, which constructs a propositional logic expression by parsing the logical operators in the legal provisions (such as "A should be and B is prohibited"). It is marked as a high-risk conflict. The legal conflict detection rule engine can systematically and accurately discover potential conflicts between legal provisions, providing guarantees for the improvement of the legal system and the accuracy of legal practice.

[0025] As a further solution of the present invention: the security and compliance module includes a desensitizing unit, an authority control gateway and a query log audit unit. The desensitizing unit matches the ID number in the judgment (format such as "11010119990101 Computer Science") through a regular expression and replaces it with an anonymous identifier, effectively protecting sensitive information involving personal privacy. The authority control gateway generates a JWT token based on the OAuth2.0 protocol, verifies the user role (judge / lawyer / public), and implements role-based access control (RBAC) on the full text of the undisclosed case, restricting public users from accessing the full text of the undisclosed case, ensuring that only users with corresponding authority can obtain specific data resources. The query log audit unit is used to record the user's IP address, query time and content, and encrypt and store them in a private chain to audit and supervise the user's query behavior and ensure the security and compliance of the system.

[0026] As a further solution of the present invention: the query system also includes an incremental learning unit and a mobile adaptation module. The incremental learning unit receives user feedback on the retrieval results (relevant / irrelevant), updates the knowledge graph embedding vector through the gradient descent algorithm, and optimizes the model parameters. The gradient descent algorithm is a commonly used optimization algorithm that can gradually adjust the parameters of the model according to user feedback information, so that the retrieval performance of the system is continuously improved. The mobile adaptation module integrates a lightweight knowledge graph cache (occupies memory <500MB), supports offline retrieval and voice input to text functions, and facilitates users to use the system anytime and anywhere on mobile devices, thereby improving the system's usability and user experience.

[0027] By adopting the above technical solution, compared with the prior art, the beneficial effects of the present invention are:

[0028] 1. The present invention significantly alleviates the problems of dispersion and credibility of legal data through a multi-source data acquisition module and blockchain evidence storage technology. In the claims, the multi-source data acquisition module is connected to the court's public database, legal database and academic journal platform, and uses a distributed crawler to capture legal data. This design enables the system to widely collect legal information from different channels, covering a wide range of content from official regulations to academic research, breaking the situation where data is scattered in various isolated data sources and realizing the comprehensive integration of legal data. At the same time, a data integrity verification code is generated through blockchain hash evidence storage, and the data is divided into blocks according to timestamps to calculate the SHA-256 hash value and uploaded to the consortium chain, ensuring the integrity and non-tamperability of the data during the collection, storage and transmission process. This provides a comprehensive and reliable data foundation for legal practitioners and researchers, so that they no longer need to spend a lot of time verifying the authenticity and accuracy of the data when querying and analyzing legal information, thereby improving work efficiency and research quality.

[0029] 2. The present invention significantly improves the retrieval accuracy of traditional keyword matching by leveraging the dynamic weighting algorithm in the dynamic semantic retrieval module. The dynamic semantic retrieval module generates a retrieval priority list based on the semantic analysis results of the user identity tag and the query statement, and the algorithm comprehensively considers the semantic similarity between the query statement and the candidate document, the authority and timeliness of the candidate document, and the coefficient is dynamically adjusted according to the user identity. Traditional keyword matching methods can only mechanically match keywords in the text and are unable to understand semantics and perform personalized retrieval based on user needs. In contrast, the dynamic weighting algorithm of the present invention can more accurately understand user intent and prioritize the display of retrieval results that are most relevant to the user's needs. For example, for legal practitioners, the system will focus more on displaying highly authoritative judicial interpretations, while for ordinary people, it will prioritize displaying content that is easy to understand and has strong timeliness. Through actual test comparisons, under the same query conditions, the proportion of relevant information retrieved by the system of the present invention is greatly improved, and the retrieval efficiency is significantly improved;

[0030] 3. The present invention effectively reduces manual analysis time through the intelligent analysis engine module, which uses similar case judgment prediction and legal conflict detection functions. The intelligent analysis engine module includes a similar case judgment prediction model and a legal conflict detection rule engine. The similar case judgment prediction model uses a Siamese neural network based on the attention mechanism to calculate the similarity score between the case to be predicted and the historical case library, providing a basis for similar case judgment prediction. The legal conflict detection rule engine constructs propositional logic expressions by parsing logical operators in legal provisions to detect potential conflicts between legal provisions. In practical applications, when handling cases, legal practitioners used to spend a lot of time searching for similar cases and conducting manual comparative analysis, as well as checking legal provisions one by one for conflicts. The intelligent analysis function of the present invention can quickly complete these tasks, automatically screening the most relevant historical cases and predicting judgment outcomes, while accurately detecting conflicting points in legal provisions. For example, when handling complex commercial disputes, the intelligent analysis engine module can complete the analysis of a large number of cases and detect legal conflicts in a short period of time, greatly reducing the time and effort required for manual analysis and improving the efficiency and accuracy of legal work. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 Schematic diagram of the system flow in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The specific embodiments of the present invention will be further described below in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0033] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0034] Example 1: A legal inquiry system based on big data, the inquiry system includes a multi-source data acquisition module, a data processing module, a knowledge graph construction module, a dynamic semantic retrieval module, an intelligent analysis engine module, and a security and compliance module;

[0035] Multi-source data acquisition module: Communicates and connects with the court's public database, legal database, and academic journal platform, captures legal data through distributed crawlers, and generates data integrity verification codes through blockchain hash storage. Distributed crawlers refer to the technology of using multiple computing nodes to perform data capture tasks in parallel, which can improve data collection efficiency. The multi-source data acquisition module uses distributed crawlers to capture legal data, which can achieve efficient acquisition of multi-source heterogeneous data, providing a rich data foundation for subsequent data processing and analysis. The data integrity verification code generated through blockchain hash storage can ensure the integrity and non-tamperability of data during the collection, storage, and transmission process, thereby improving the credibility of the data;

[0036] Data processing module: This module receives raw data from the multi-source data acquisition module and uses natural language processing technology to clean, convert, and standardize the data. Natural language processing technology can understand and analyze legal texts in natural language. Through these processes, this module removes noise and erroneous information from the raw data, unifies the data into a standard format, improves data quality, and facilitates the subsequent construction of the knowledge graph.

[0037] The knowledge graph construction module receives data processed by the data processing module and extracts legal entities and relationships using the BERT model fine-tuned based on legal domain text. It then constructs a multi-layer knowledge graph encompassing "legal provisions, case studies, and academic opinions," and stores the multi-layer knowledge graph data in the Neo4j graph database. The BERT model is a pre-trained language model based on the Transformer architecture. After being fine-tuned with legal domain text, it can more accurately extract legal entities and relationships. The multi-layer knowledge graph constructed by this module structurally links legal provisions, case studies, and academic opinions, facilitating in-depth query and analysis of legal information.

[0038] Dynamic semantic retrieval module: This module interacts with the knowledge graph construction module and the user terminal. Based on the semantic analysis results of the user identity tag and the query statement, it calls the dynamic weighting algorithm to generate a search priority list and returns the relevant results through the API interface. The dynamic semantic retrieval module uses the dynamic weighting algorithm to generate a search priority list based on the characteristics of the user identity and the query statement, taking into account multiple factors, providing users with personalized and accurate search results to meet the needs of different users.

[0039] Intelligent Analysis Engine Module: This module receives the output data from the dynamic semantic retrieval module, performs similar case judgment prediction, legal conflict detection, and dispute focus cluster analysis, and transmits the analysis results to a visualization terminal. Through these functions, the intelligent analysis engine module can provide valuable reference information for legal practitioners, assisting them in case analysis and decision-making, and improving the efficiency and quality of legal work.

[0040] Security and Compliance Module: Embedded between the multi-source data acquisition module and the data processing module, it desensitizes sensitive information in real time and limits user access levels through the permission control gateway. The Security and Compliance Module ensures data security and compliance, and protects user privacy and legal rights through real-time desensitization and permission control of sensitive information.

[0041] Therefore, in order to effectively solve the above problems, this application proposes a legal inquiry system based on big data, as shown in the accompanying drawings of the specification. Figure 1 shown.

[0042] Specific work process: The multi-source data collection module includes a distributed crawler cluster. The distributed crawler cluster uses dynamic IP proxy technology to rotate and access IP addresses to bypass anti-crawling mechanisms, and configures differentiated crawling strategies for different data sources. Specifically, it uses captcha recognition and Session maintenance technology to maintain long connections for crawling the full text of judgments in the court public database, uses OCR technology to parse legal terms in PDF documents on academic journal platforms, and extracts the legal citation relationships in unstructured texts. The multi-source data collection module also includes a data cleaning unit and a blockchain evidence storage unit. The data cleaning unit matches the case numbers in the judgments through regular expressions (the format is like "(2023) Jing01 Minzhong Computer Science Number") and uniformly converts them into a standard format. The blockchain evidence storage unit calculates the SHA-256 hash value of the data cleaned by the data cleaning unit in chunks according to timestamps and uploads it to the consortium blockchain for subsequent verification and invocation.

[0043] Further, taking the example of a lawyer handling a civil contract dispute case, the working process of the system is as follows:

[0044] Data collection: The multi-source data collection module starts to work. The distributed crawler cluster, according to the configured differentiated crawling strategies, uses captcha recognition and Session maintenance technology to maintain long connections for crawling the full text of relevant civil contract dispute judgments in the court public database, obtains the latest contract-related laws and regulations from the legal database, and uses OCR technology to parse legal terms and legal citation relationships in PDF documents on academic journal platforms. The collected data passes through the data cleaning unit, where the case numbers are matched through regular expressions and unified in format, and then the blockchain evidence storage unit calculates the SHA-256 hash value and uploads it to the consortium blockchain for evidence storage, and then transmits the cleaned data to the data processing module.

[0045] Data processing: The data processing module receives the original data and uses a natural language processing model fine-tuned based on legal domain texts to perform词性标注 (pos tagging), named entity recognition, and syntactic analysis on the data, identifies key information such as contract parties, breach behaviors, and compensation liabilities in the contract dispute judgments, removes redundant information, and converts it into structured data before transmitting it to the knowledge graph construction module.

[0046] Knowledge graph construction: The knowledge graph construction module uses a BERT model fine-tuned based on legal domain texts to process the input data, extracts legal entities and relationships, constructs a multi-layer knowledge graph of "contract dispute cases - relevant legal provisions - academic viewpoints", establishes a two-way citation relationship between specific contract dispute cases and the relevant provisions of the contract chapter in the Civil Code, and stores the multi-layer knowledge graph data in a Neo4j graph database.

[0047] Note: "词性标注" is a term in Chinese for "pos tagging" in English. If this is not the expected translation, please provide more context or clarify the requirements.When training the BERT model fine-tuned on legal text, we use judgments, legal texts, and legal papers labeled with entity types as training data. Entity types include "legal subject," "illegal behavior," and "legal consequences." The training loss function is defined as the sum of the cross-entropy loss and the L2 regularization term. The specific formula is as follows:

[0048]

[0049] We have a small training dataset consisting of N=3 samples.

[0050] First sample:

[0051] Input text x1: "Company A signed a contract with Company B. Company B failed to deliver the goods on time as agreed. Company A requires Company B to bear the liability for breach of contract."

[0052] Entity label y1: "Legal entities: Company A, Company B, Illegal behavior: Company B failed to deliver the goods on time, Legal consequence: Company A requires Company B to bear the liability for breach of contract." For ease of calculation, we encode the entity label into vector form. After encoding, y1 = (0.8, 0.9, 0.7).

[0053] The model’s predicted probability for this sample is P(y1│x1;θ)=(0.7, 0.8, 0.6) (also the example probability).

[0054] Second sample:

[0055] Input text x2: "C and D signed a lease contract. D sublet the house without authorization, and C requested to terminate the contract."

[0056] Entity label y2: "Legal entities: C, D, illegal behavior: D sublet the house without authorization, legal consequence: C requested to terminate the contract", after encoding y2 = (0.85, 0.95, 0.75).

[0057] The model’s predicted probability for this sample is P(y2│x2;θ)=(0.75,0.85,0.65).

[0058] The third sample:

[0059] Input text x3: "E borrowed money from J and failed to repay the money on time. J requires E to repay the principal and interest."

[0060] Entity label y3: "Legal entities: E and F, Illegal behavior: E failed to repay the loan on time, Legal consequence: F required E to repay the principal and interest", after encoding y2 = (0.9, 0.92, 0.72).

[0061] The model’s predicted probability for this sample is P(y3│x3;θ)=(0.8,0.82,0.62).

[0062] Model parameter and weight coefficient setting

[0063] Model parameters θ = (0.1, 0.2, 0.3), weight coefficient λ = 0.01.

[0064] Loss function calculation

[0065] First calculate the cross entropy loss part:

[0066] For the first sample:

[0067] -log P (y1│x1; θ)=-(0.8×log(0.7)+0.9×log(0.8)+0.7×log(0.6))≈0.92

[0068] For the second sample: Calculate the second sample in the same way and the result is 0.9.

[0069] For the third sample: The result of the third sample calculated in the same way is 0.93.

[0070] The sum of cross entropy losses:

[0071]

[0072] Then calculate the L2 regularization term:

[0073] λ‖θ‖ 2 =λ×(0.1 2 +0.2 2 +0.3 2 )=0.01×(0.1 2 +0.2 2 +0.3 2 )=0.0014

[0074] Final loss function value:

[0075]

[0076] By continuously adjusting the model parameters θ, the loss function L is gradually reduced, thereby optimizing the model performance and improving the accuracy of legal entity and relationship extraction;

[0077] Retrieval and analysis: A lawyer enters a query statement through the user terminal, such as "judgment basis and compensation standards for similar contract dispute cases." After receiving the query request, the dynamic semantic retrieval module parses the user identity tag (lawyer) and the query statement semantics, and uses a dynamic weighting algorithm to calculate the priority score of the search results. This algorithm comprehensively considers the semantic similarity between the query statement and the candidate documents, as well as the authority and timeliness of the candidate documents. The specific formula is as follows:

[0078] S=α·Sim(Q,D)+β·Authority(D)+γ·Freshness(D)

[0079] Where Q is the user query statement, D is the candidate document, Sim(Q,D) is the cosine similarity based on knowledge graph embedding, which is used to measure the semantic similarity between the query statement and the candidate document, Authority(D) is the document authority weight, specifically the judicial interpretation weight is 1.0, the local regulations weight is 0.8, Freshness(D) is the timeliness weight, which decays by 0.2 for every additional year of publication time, and the coefficients α, β, and γ are dynamically adjusted according to the user's identity (lawyer) to achieve personalized retrieval services. Assume that in the current query, α = 0.6, β = 0.3, and γ = 0.1, the semantic similarity Sim(Q,D1) between a candidate document D1 and the query statement is 0.8, which is a local regulation (authority weight Authority(D1)=0.8), and the publication time is 2 years ago (freshness weight Freshness(D)=1-2×0.2=0.6), then the priority score of the document is S1=0.6×0.8+0.3×0.8+0.1×0.6=0.78. The dynamic semantic retrieval module sorts the retrieval results according to the calculated priority score, retrieves relevant information from the knowledge graph and returns it to the lawyer through the API interface.

[0080] At the same time, the intelligent analysis engine module receives the search results and performs similar case judgment prediction. The similar case judgment prediction model uses a Siamese neural network based on the attention mechanism to calculate the similarity score between the case to be predicted and the historical case library. The specific formula for similarity calculation is as follows:

[0081]

[0082] Among them, the feature vector v of the case to be predicted C c =(0.2, 0.3, 0.1, 0.4), the characteristic vector v of historical case C1 c1 =(0.1,0.4,0.2,0.3), then v c ·v c1=0.2×0.1+0.3×0.4+0.1×0.2+0.4×0.3=0.28. By calculating the similarity scores between the case to be predicted and multiple historical cases, the possible judgment outcome of the current case is predicted, legal conflict detection is performed to check whether there are potential conflicts in relevant legal provisions, and cluster analysis is performed on the focus of disputes, such as the interpretation of contract terms and the determination of breach of contract liability. The analysis results are transmitted to the visualization terminal and presented to the lawyer in the form of charts, reports, etc.

[0083] Security and compliance assurance: The security and compliance module plays a role in the data collection and processing process, performing real-time desensitization on sensitive information such as the parties' ID numbers in the collected judgment documents. The permission control gateway generates a JWT token based on the OAuth2.0 protocol. After verifying the lawyer's identity, it allows them to access relevant case information according to the RBAC policy. The query log audit unit records the lawyer's query behavior and encrypts and stores it in a private chain.

[0084] Example 2:

[0085] Based on the first embodiment, as shown in the accompanying drawings of the specification Figure 1 As shown in the figure, the data processing module uses a natural language processing model fine-tuned based on legal field text to perform part-of-speech tagging, named entity recognition and syntactic analysis on the original data. Through these processes, the original data is converted into structured data, redundant information in the data is removed, and high-quality data is transmitted to the knowledge graph construction module.

[0086] Specific workflow: The knowledge graph construction module uses a BERT model fine-tuned based on legal text. Its training data includes judgments, legal texts, and legal papers labeled with entity types, including "legal subject," "illegal behavior," and "legal consequences." Its training loss function is defined as the sum of the cross-entropy loss and the L2 regularization term. The specific formula is as follows:

[0087]

[0088] Where: x i Indicates input text, y i Represents the entity label, θ represents the model parameter, and λ represents the weight coefficient. The knowledge graph construction module extracts the "precondition-behavior pattern-legal effect" triple by parsing the logical structure of the legal text, and establishes a bidirectional reference relationship network between the case and the legal text. The parsing results are stored in the Neo4j graph database. Neo4j is a high-performance database specially used for storing and querying graph data. It can efficiently process complex node and relationship data in the knowledge graph, providing strong support for subsequent semantic retrieval and intelligent analysis.

[0089] Furthermore, let’s take the example of a judge hearing a complex commercial crime case.

[0090] Data collection and processing optimization: In addition to collecting data from conventional data sources, the multi-source data collection module has also expanded to industry regulatory databases to obtain regulatory information on companies involved in the case. In the data processing module, based on the characteristics of commercial crime case data, the recognition and processing of commercial terms such as "insider trading" and "commercial bribery" have been added to further optimize the data processing process and improve data quality.

[0091] In-depth application of knowledge graphs: When constructing the knowledge graph, the knowledge graph construction module strengthens the analysis of the correlation between legal provisions, cases and academic research related to commercial crimes. For example, specific commercial crime cases are compared and correlated with similar cases in different regions. At the same time, relevant economic laws and regulations and industry norms are integrated to make the knowledge graph more comprehensive and in-depth. When training the BERT model based on fine-tuning of legal field texts, newly collected data is continuously used for training, and model parameters are constantly adjusted to adapt to the complex legal entities and relationships in the field of commercial crimes.

[0092] Intelligent analysis enhancement: The dynamic semantic retrieval module adjusts the coefficients of the dynamic weighting algorithm according to the identity of the judge. After adjustment, α=0.7, β=0.2, and γ=0.1. When calculating the priority score of the search results, it focuses more on highly authoritative legal provisions and the latest judicial interpretations. The similar case judgment prediction model of the intelligent analysis engine module not only considers the basic characteristics of the case, but also combines industry trends and changes in judicial practice for prediction. When calculating the similarity score between the predicted case and historical cases, it accurately obtains the case feature vector v c and historical case feature vector v c1 , and calculates the similarity based on the formula to provide judges with more accurate judgment prediction references. The legal conflict detection rule engine conducts in-depth analysis of the clauses involving commercial crimes in legal documents at different levels to ensure the accuracy of legal application.

[0093] Incremental learning feedback: When using the system, judges provide feedback on retrieval results and analysis reports. The incremental learning unit receives the feedback information, updates the knowledge graph embedding vector through the gradient descent algorithm, and optimizes the model parameters. The gradient descent algorithm adjusts the model parameters based on the feedback information, so that the model can more accurately meet the needs of judges in subsequent retrieval and analysis.

[0094] Example 3:

[0095] Based on the second embodiment, as shown in the accompanying drawings of the specification Figure 1 As shown in the figure, the dynamic semantic retrieval module calculates the priority score of the retrieval results through a dynamic weight algorithm. The dynamic weight algorithm comprehensively considers the semantic similarity between the query statement and the candidate documents, the authority and timeliness of the candidate documents to ensure the accuracy and relevance of the retrieval results. The specific algorithm formula is as follows:

[0096] S=α·Sim(Q,D)+β·Authority(D)+γ·Freshness(D)

[0097] Where: Q represents the user query statement, D represents the candidate document, Sim(Q,D) represents the cosine similarity based on knowledge graph embedding, which is used to measure the semantic similarity between the query statement and the candidate document, Authority(D) represents the document authority weight, specifically a weight of 1.0 for judicial interpretation and 0.8 for local regulations, which reflects the difference in authority of different types of legal documents, Freshness(D) represents the timeliness weight, which decays by 0.2 for every additional year of publication, reflecting the impact of the timeliness of legal information on retrieval results, and the coefficients α, β, and γ are dynamically adjusted according to the user's identity to achieve personalized retrieval services. The dynamic semantic retrieval module further supports cross-regional legal comparison functions. By mapping legal provisions of different jurisdictions to the "region" attribute node of the knowledge graph, a difference comparison matrix is generated, which allows users to intuitively compare the differences in legal provisions in different regions.

[0098] Specific workflow: The intelligent analysis engine module includes a similar case judgment prediction model unit and a legal conflict detection rule engine unit. The similar case judgment prediction model unit is equipped with a similar case judgment prediction model. The similar case judgment prediction model uses a Siamese neural network based on the attention mechanism to calculate the similarity score between the case to be predicted and the historical case library. The specific formula for similarity calculation is as follows:

[0099]

[0100] Where: v c It represents the case feature vector, which includes information about the cause of the case, the completeness of the chain of evidence, the occupation of the parties, the age of the parties, and the parties' past criminal records. The similar case judgment prediction model provides a basis for similar case judgment prediction by comparing the feature vectors of the case to be predicted with historical cases and evaluating the similarity between them.

[0101] Furthermore, for legal scholars conducting cross-regional comparative legal research, the system's workflow is as follows:

[0102] Multi-source data collection expansion: The multi-source data collection module collects legal data sources from different regions, including legal databases and judicial case libraries from different countries and regions, and uses dynamic IP proxy technology to bypass anti-crawling mechanisms to ensure smooth data collection.

[0103] Data processing and graph construction: The data processing module uniformly processes the collected data from multiple regions, converting data in different languages and formats into a standard format. The knowledge graph construction module constructs a cross-regional legal knowledge graph, associates legal provisions, cases, and academic opinions from different regions, and annotates them with "region" attribute nodes. During the construction process, the BERT model fine-tuned based on legal field text is used, and the model is optimized according to the loss function formula to accurately extract legal entities and relationships in different regions.

[0104] Dynamic semantic retrieval and comparative analysis: Legal scholars input query statements through the mobile adaptation module, such as "Compare the differences in intellectual property legal protection between China and the United States." The dynamic semantic retrieval module uses the cross-regional legal comparison function to map the intellectual property-related legal provisions of China and the United States to the "region" attribute node of the knowledge graph, generating a difference comparison matrix. At the same time, it calls the dynamic weight algorithm to calculate the priority score of the search results, and dynamically adjusts the coefficients α, β, and γ according to the identity of the legal scholar, with α=0.5, β=0.3, and γ=0.2. During the calculation process, the semantic similarity Sim(Q,D) between the query statement and the candidate document, the document authority weight Authority(D), and the timeliness weight Freshness(D) are accurately obtained, providing scholars with search results that better meet their needs. The intelligent analysis engine module performs cluster analysis on the two countries' laws in terms of the scope of intellectual property protection, infringement identification standards, and compensation methods, providing scholars with in-depth research references.

[0105] Convenient use on mobile devices: The mobile adaptation module uses lightweight knowledge graph caching to support scholars in offline retrieval of relevant information. The voice input to text function facilitates scholars to quickly query during field research or meetings, thereby improving research efficiency.

[0106] Example 4:

[0107] Based on the third embodiment, as shown in the accompanying drawings of the specification Figure 1 As shown, the legal conflict detection rule engine unit is provided with a legal conflict detection rule engine. The legal conflict detection rule engine constructs a propositional logic expression by parsing the logical operators in the legal provisions (such as "A should be and B is prohibited"). When a logical contradiction is detected, It is marked as a high-risk conflict. The legal conflict detection rule engine can systematically and accurately discover potential conflicts between legal provisions, providing guarantees for the improvement of the legal system and the accuracy of legal practice. The security and compliance module includes a desensitizing unit, a permission control gateway and a query log audit unit. The desensitizing unit matches the ID number in the judgment through a regular expression (such as "11010119990101 Computer Science") and replaces it with an anonymous identifier, effectively protecting sensitive information involving personal privacy. The permission control gateway generates a JWT token based on the OAuth2.0 protocol, verifies the user role (judge / lawyer / public), and implements role-based access control (RBAC) on the full text of the unpublished case, restricting public users from accessing the full text of the unpublished case, ensuring that only users with corresponding permissions can obtain specific data resources. The query log audit unit is used to record the user's IP address, query time and content, and encrypts and stores them in a private chain to audit and supervise the user's query behavior and ensure the security and compliance of the system.

[0108] Specific workflow: The query system also includes an incremental learning unit and a mobile adaptation module. The incremental learning unit receives user feedback on the search results (relevant / irrelevant), updates the knowledge graph embedding vector through the gradient descent algorithm, and optimizes the model parameters. The gradient descent algorithm is a commonly used optimization algorithm that can gradually adjust the model parameters according to user feedback information, so that the system's retrieval performance is continuously improved. The mobile adaptation module integrates a lightweight knowledge graph cache (occupies memory <500MB), supports offline retrieval and voice input to text functions, and facilitates users to use the system anytime, anywhere on mobile devices, thereby improving the system's usability and user experience.

[0109] Furthermore, for the daily legal knowledge learning scenarios of ordinary people:

[0110] Simplified data collection and processing: The multi-source data collection module focuses on collecting legal data closely related to daily life, such as regulations and cases on consumer rights protection, house rentals, etc. The data processing module simplifies the processing flow, highlighting the popular explanation of legal provisions and easy-to-understand presentation of cases.

[0111] Retrieval and feedback: Ordinary people enter simple query statements through user terminals, such as "What should I do if the landlord does not return the deposit when renting a house?" The dynamic semantic retrieval module adjusts the retrieval strategy based on the identity of the ordinary people, prioritizing easy-to-understand explanations and common cases. When calculating the priority score of the retrieval results, the coefficients α, β, and γ are dynamically adjusted to α=0.4, β=0.3, and γ=0.3 to meet the ordinary people's demand for knowledge acquisition. The public provides feedback on the retrieval results, and the incremental learning unit optimizes the retrieval model based on the feedback, making subsequent retrieval results more in line with the ordinary people's understanding level.

[0112] Security and compliance assurance: The security and compliance module strictly restricts the public's access to sensitive legal data and only provides public, general-purpose legal information. The query log audit unit records the public's query behavior to ensure the security and compliance of the system.

[0113] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A legal inquiry system based on big data, characterized by: The query system includes a multi-source data acquisition module, a data processing module, a knowledge graph construction module, a dynamic semantic retrieval module, an intelligent analysis engine module, and a security and compliance module; Multi-source data acquisition module: Communicates with the court's public database, legal database, and academic journal platform, captures legal data through distributed crawlers, and generates data integrity verification codes through blockchain hash storage; Data processing module: receives raw data from the multi-source data acquisition module and uses natural language processing technology to clean, convert and standardize the data; Knowledge graph construction module: Receives the data processed by the data processing module, extracts legal entities and relationships using a BERT model fine-tuned based on legal text, constructs a multi-layer knowledge graph consisting of "legal provisions-cases-academic opinions", and stores the multi-layer knowledge graph data in the Neo4j graph database; Dynamic semantic retrieval module: interacts with the knowledge graph construction module and user terminals, calls a dynamic weighting algorithm to generate a search priority list based on the user identity tag and the semantic analysis results of the query statement, and returns the related results through the API interface; Intelligent analysis engine module: Receives output data from the dynamic semantic retrieval module, performs similar case judgment prediction, legal conflict detection, and dispute focus cluster analysis, and transmits the analysis results to the visualization terminal; Security and Compliance Module: Embedded between the multi-source data acquisition module and the data processing module, it desensitizes sensitive information in real time and limits user access levels through the permission control gateway.

2. The big data-based legal inquiry system according to claim 1, characterized in that: The multi-source data acquisition module includes a distributed crawler cluster, which uses dynamic IP proxy technology to rotate access to IP addresses to bypass anti-crawling mechanisms, and configures differentiated crawling strategies for different data sources, including: using verification code recognition and session persistence technology to maintain a long connection to the court's public database to capture the full text of the judgment, and using OCR technology to parse legal terms in PDF documents on the academic journal platform, and extracting legal reference relationships in unstructured texts.

3. The big data-based legal inquiry system according to claim 2, characterized in that: The multi-source data acquisition module also includes a data cleaning unit and a blockchain evidence storage unit. The data cleaning unit matches the case number in the judgment through regular expressions and converts it into a standard format. The blockchain evidence storage unit divides the data cleaned by the data cleaning unit into blocks according to timestamps, calculates the SHA-256 hash value and uploads it to the alliance chain for subsequent verification and call.

4. The big data-based legal inquiry system according to claim 1, characterized in that: The data processing module adopts a natural language processing model fine-tuned based on legal field text to perform part-of-speech tagging, named entity recognition and syntactic analysis on the original data. Through these processes, the original data is converted into structured data, redundant information in the data is removed, and high-quality data is transmitted to the knowledge graph construction module.

5. The big data-based legal inquiry system according to claim 1, characterized in that: The knowledge graph construction module uses a BERT model fine-tuned based on legal text. Its training data includes judgments, legal texts, and legal papers labeled with entity types, including "legal subject", "illegal behavior", and "legal consequences". Its training loss function is defined as the sum of cross-entropy loss and L2 regularization term. The specific formula is as follows: Where: x i Indicates input text, y i Represents the entity label, θ represents the model parameter, and λ represents the weight coefficient. The knowledge graph construction module extracts the "precondition-behavior pattern-legal effect" triple by parsing the logical structure of the legal provisions, establishes a bidirectional reference relationship network between cases and legal provisions, and stores the parsing results in the Neo4j graph database.

6. The big data-based legal inquiry system according to claim 1, characterized in that: The dynamic semantic retrieval module calculates the priority score of the retrieval results using a dynamic weighting algorithm. The dynamic weighting algorithm comprehensively considers the semantic similarity between the query statement and the candidate documents, the authority and timeliness of the candidate documents. The specific algorithm formula is as follows: S=α·Sim(Q,D)+β·Authority(D)+γ·Freshness(D) Where: Q represents the user query statement, D represents the candidate document, Sim(Q,D) represents the cosine similarity based on knowledge graph embedding, Authority(D) represents the document authority weight, specifically a weight of 1.0 for judicial interpretations and 0.8 for local regulations, Freshness(D) represents the timeliness weight, which decays by 0.2 for every additional year of publication time, and the coefficients α, β, and γ are dynamically adjusted based on the user's identity. The dynamic semantic retrieval module further supports cross-regional legal comparison by mapping legal provisions from different jurisdictions to the "region" attribute node of the knowledge graph to generate a difference comparison matrix.

7. The big data-based legal inquiry system according to claim 1, characterized in that: The intelligent analysis engine module includes a similar case judgment prediction model unit and a legal conflict detection rule engine unit. The similar case judgment prediction model unit is provided with a similar case judgment prediction model. The similar case judgment prediction model uses a Siamese neural network based on an attention mechanism to calculate the similarity score between the case to be predicted and the historical case library. The specific formula for similarity calculation is as follows: Where: v c The case feature vector includes the cause of the case, the completeness of the chain of evidence, the occupation of the parties, the age of the parties, and the past criminal records of the parties. The similar case judgment prediction model provides a basis for similar case judgment prediction by comparing the feature vectors of the case to be predicted with historical cases and evaluating the similarity between them.

8. The big data-based legal inquiry system according to claim 7, characterized in that: The legal conflict detection rule engine unit is provided with a legal conflict detection rule engine, which constructs a propositional logic expression by parsing the logical operators in the legal provisions, and marks it as a high-risk conflict when a logical contradiction is detected.

9. The big data-based legal inquiry system according to claim 1, characterized in that: The security and compliance module includes a desensitizing unit, an authority control gateway and a query log audit unit. The desensitizing unit matches the ID number in the judgment through a regular expression and replaces it with an anonymous identifier. The authority control gateway generates a JWT token based on the OAuth2.0 protocol, verifies the user role, and restricts public users from accessing the full text of undisclosed cases. The query log audit unit is used to record the user's IP address, query time and content, and encrypts and stores them in a private chain.

10. The big data-based legal inquiry system according to claim 1, characterized in that: The query system also includes an incremental learning unit and a mobile adaptation module. The incremental learning unit receives user feedback on the retrieval results, updates the knowledge graph embedding vector through the gradient descent algorithm, and optimizes the model parameters. The mobile adaptation module integrates a lightweight knowledge graph cache and supports offline retrieval and voice input to text functions.

Citation Information

Cited By

  • Local knowledge base automatic construction system based on multi-source acquisition and distributed computing

    CN120723742A

  • Automatic construction system of local knowledge base based on multi-source collection and distributed calculation

    CN120723742B

  • LLM-based cross-border appeal text generation method, apparatus and device, and storage medium

    CN120975984A

  • Local legislation compliance intelligent detection system and method based on deep semantic analysis and multi-modal legal knowledge graph

    CN121145925A