Legal affair information processing method and system fusing knowledge graph and large language model

By integrating knowledge graphs and large language models, a knowledge graph in the legal field is constructed, which solves the problems of low efficiency of legal information retrieval and insufficient intelligence of case analysis, and achieves efficient and accurate legal information processing and intelligent analysis.

CN119474257APending Publication Date: 2025-02-18GUANGDONG UNIV OF FINANCE
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411531642.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, there are problems such as low efficiency in legal information retrieval, inaccurate relationship between legal entities, and insufficient intelligence in case analysis.

Method used

Legal information processing method that integrates knowledge graphs and large language models is adopted to collect and preprocess information in the legal field, entity identification and relationship extraction are carried out, knowledge graphs are constructed, and intention identification and result prediction are carried out based on user's legal information processing instructions.

Benefits of technology

It improves the accuracy and efficiency of legal information retrieval, enhances the understanding and analysis ability of legal entity relations, and improves the intelligence level of case analysis and the reliability of legal suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474257A_ABST
    Figure CN119474257A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a legal affair information processing method and system fusing a knowledge graph and a large language model, and belongs to the technical field of knowledge graphs. The method comprises the steps that existing information related to the legal field is collected, and data preprocessing is conducted on the existing information; entity recognition and relation extraction are carried out based on the preprocessed existing information, and a knowledge graph is constructed based on the relation between the entities; collecting a legal affair information processing instruction of a user, and performing user intention recognition based on the legal affair information processing instruction; and based on the identification intention and the legal affair information processing instruction, generating result prediction information through the knowledge graph, and pushing the result prediction information to a user side. According to the scheme, deep analysis and intelligent processing of legal problems can be achieved, the accuracy of information retrieval and the reliability of legal suggestions are improved, and therefore decision making of legal practitioners and legal problem solving of users are better supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and specifically to a legal information processing method integrating a knowledge graph and a large language model, and a legal information processing system integrating a knowledge graph and a large language model. Background Art

[0002] In the legal field, faced with a massive amount of legal texts, cases, and regulations, legal practitioners and ordinary users need to spend a lot of time to retrieve relevant information and analyze cases. With the continuous growth of legal texts and case data, how to efficiently extract useful information from them to assist legal practitioners in case analysis and decision-making has become an urgent problem to be solved. Traditional legal information retrieval systems mostly rely on keyword retrieval, which makes it difficult to understand and display the complex relationships between legal entities. This method usually cannot fully cover the needs of users, resulting in low relevance and accuracy of retrieval results, and users often need to manually screen a large number of irrelevant documents. Especially in complex legal cases, it is difficult to effectively capture contextual associations by keyword matching alone, and it is unable to fully support in-depth analysis of the case background.

[0003] At the same time, most existing legal intelligent assistants are question-answering systems based on rules or shallow machine learning models. The limitations of these systems are that they cannot deeply understand the contextual meaning of legal documents or provide accurate legal advice. Most of these systems rely on pre-set rules or simple semantic matching methods, resulting in their lack of ability to cope with complex legal issues. In addition, due to the lack of sufficient modeling of the relationship between legal entities, existing systems often cannot effectively analyze multi-level legal logical relationships, which makes their performance in legal analysis and advice generation less than ideal.

[0004] In view of the problems of low efficiency of legal information retrieval, inaccurate legal entity association and insufficient intelligence of case analysis in the existing technology, a new legal information processing solution needs to be proposed. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a legal information processing method and system that integrates knowledge graphs and large language models, so as to at least solve the problems in the prior art of low efficiency in legal information retrieval, inaccurate association of legal entities, and insufficient intelligence in case analysis.

[0006] In order to achieve the above-mentioned objectives, the first aspect of the present invention provides a legal information processing method that integrates a knowledge graph and a large language model, the method comprising: collecting existing information related to the legal field, and performing data preprocessing on the existing information; performing entity recognition and relationship extraction based on the preprocessed existing information, and constructing a knowledge graph based on entities and the relationships between entities; collecting users' legal information processing instructions, and performing user intent recognition based on the legal information processing instructions; based on the recognition intent and the legal information processing instructions, generating result prediction information through the knowledge graph, and pushing the result prediction information to the user end.

[0007] Optionally, the existing information related to the legal field includes: any one or more of legal provisions, judicial interpretations and historical precedents; the data preprocessing of the existing information includes: performing data cleaning processing and data standardization processing on the existing information in sequence.

[0008] Optionally, the rules for entity recognition based on preprocessed existing information include: in the preprocessed existing information, performing entity labeling based on a conditional random field model to obtain entity labeling results; based on the entity labeling results, determining the occurrence probability of each entity, and taking entities whose occurrence probability is greater than a preset occurrence probability threshold as identified entities.

[0009] Optionally, the conditional random field model is:

[0010]

[0011] Among them, p(E i |context) is entity E i The probability of occurrence of score(E i ,context) is entity E i The relevance score with the context; ∑E j ∈Possible Entitiesexp(score(E i ,context)) is the sum of the indexed scores of all candidate entities.

[0012] Optionally, the rule for performing relation extraction based on the preprocessed existing information is: performing relation extraction from the preprocessed existing information based on a relation extraction model constructed based on dependency syntactic analysis and a convolutional neural network; wherein the relation extraction model is expressed as:

[0013] r ij =CNN(E i ,E j )CNN()

[0014] Among them, r ij For entity Ei With entity E j The relationship between; CNN() is a convolutional neural network model.

[0015] Optionally, the construction of a knowledge graph based on entities and the relationships between entities includes: using entities as nodes of the implementation graph, using the relationships between entities as edges between corresponding connecting nodes, and constructing a corresponding knowledge graph.

[0016] Optionally, after constructing the knowledge graph based on entities and the relationships between entities, the method further includes: storing the knowledge graph based on the Neo4j graph database; visualizing the stored knowledge graph based on the Neovis.js library, so as to push the visualized knowledge graph in response to the knowledge graph query demand triggered by the user.

[0017] Optionally, the user intention identification based on the legal information processing instructions includes: processing the legal information processing instructions into corresponding text information, and removing noise in the text information based on the GLM-4 model; identifying the intention of the text information after noise removal based on the natural language processing model to obtain a prediction target; based on the identification of intention and legal information processing instructions, generating result prediction information through the knowledge graph, and pushing the result prediction information to the user end, includes: based on the prediction target, performing classification prediction through a support vector machine model, and pushing the obtained prediction information to the user end.

[0018] The second aspect of the present invention provides a legal information processing system that integrates a knowledge graph and a large language model, the system comprising: a collection unit, used to collect existing information related to the legal field and perform data preprocessing on the existing information; a graph construction unit, used to perform entity recognition and relationship extraction based on the preprocessed existing information, and to construct a knowledge graph based on entities and the relationships between entities; a trigger unit, used to collect the user's legal information processing instructions, and to identify the user's intention based on the legal information processing instructions; a prediction unit, used to generate result prediction information through the knowledge graph based on the identification intention and the legal information processing instructions, and push the result prediction information to the user end.

[0019] On the other hand, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, enables the computer to execute the above-mentioned legal information processing method integrating the knowledge graph and the large language model.

[0020] Through the above technical solution, the solution of the present invention first collects existing information in the legal field and performs data preprocessing for subsequent analysis. Then, entity recognition and relationship extraction are performed based on the preprocessed data to extract legal entities and their relationships, and this information is used to construct a knowledge graph in the legal field. This knowledge graph intuitively represents the relationship between legal concepts and entities, which helps to understand complex legal logical relationships. Next, the system collects the user's legal information processing instructions and performs user intent recognition to determine the user's needs. Finally, based on the user's intentions and instructions, the corresponding result prediction information is generated through the knowledge graph, and the prediction results are pushed to the user end. This method can achieve in-depth analysis and intelligent processing of legal issues, improve the accuracy of information retrieval and the reliability of legal advice, thereby better supporting the decision-making of legal practitioners and the resolution of users' legal problems.

[0021] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0023] Figure 1 It is a flowchart of the steps of a legal information processing method integrating a knowledge graph and a large language model provided by an embodiment of the present invention;

[0024] Figure 2 It is a system structure diagram of a legal information processing system that integrates a knowledge graph and a large language model, provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0026] Figure 1 This is a flowchart of a method for processing legal information that integrates a knowledge graph and a large language model, provided by an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a legal information processing method integrating a knowledge graph and a large language model, the method comprising:

[0027] Step S10: Collect existing information related to the legal field and perform data preprocessing on the existing information.

[0028] Specifically, the existing information related to the legal field includes: any one or more of legal provisions, judicial interpretations and historical precedents; the data preprocessing of the existing information includes: performing data cleaning processing and data standardization processing on the existing information in sequence.

[0029] In the embodiment of the present invention, the existing information related to the legal field includes but is not limited to different types of data sources such as legal provisions, judicial interpretations, and historical precedents. Due to the diversity of these data in terms of source, format, and content, directly using unprocessed data for analysis may result in large data noise, low accuracy, and consistency issues. Therefore, it is necessary to perform systematic preprocessing on these data.

[0030] Furthermore, data cleaning is performed on the existing information in the legal field. The purpose of this step is to remove redundant information, noise data, and incomplete records in the data. Specific operations of data cleaning may include: removing irrelevant spaces, punctuation marks, or formatting characters, correcting spelling errors, filtering out irrelevant text information (such as advertising content or invalid references), etc. Through these operations, the quality of the data can be improved, laying the foundation for subsequent analysis steps. Standardize the cleaned data. The purpose of data standardization is to convert data of different formats and structures into a unified format to ensure the consistency of various data sources. For example, standardize different date formats into a unified format, convert the chapter numbers in legal texts into a parsable format, or perform unified term conversion on legal terms. Through data standardization, differences in data formats are eliminated, making the data more compatible during processing and analysis.

[0031] In a possible implementation, data processing can be completed by the following formula:

[0032] D clean =f standardize (f clean (D raw ))

[0033] Among them, D clean is the cleaned and standardized dataset; f standardize is the data normalization function; f clean represents the data cleaning function; D raw Represents the original dataset.

[0034] Based on the scheme of the present invention, data preprocessing can greatly improve the accuracy and consistency of data, providing a reliable data foundation for subsequent entity recognition, relationship extraction and knowledge graph construction. This processing method can significantly improve the legal information retrieval and analysis effect of the system, enabling it to better support legal practitioners' decision-making and case analysis.

[0035] Step S20: Perform entity recognition and relationship extraction based on the preprocessed existing information, and construct a knowledge graph based on the entities and the relationships between entities.

[0036] Specifically, the rules for entity recognition based on the preprocessed existing information include: in the preprocessed existing information, entity labeling is performed based on the conditional random field model to obtain entity labeling results; based on the entity labeling results, the occurrence probability of each entity is determined, and entities with an occurrence probability greater than a preset occurrence probability threshold are regarded as recognized entities.

[0037] The conditional random field model is:

[0038]

[0039] Among them, p(E i |context) is entity E i The probability of occurrence of score(E i ,context) is entity E i Relevance score with context; ΣE j ∈Possible Entitiesexp(score(E i ,context)) is the sum of the indexed scores of all candidate entities.

[0040] In an embodiment of the present invention, the entity recognition process first performs entity annotation on the preprocessed text based on the conditional random field (CRF) model. CRF is a probabilistic graphical model widely used in sequence annotation tasks, which can accurately classify and annotate entities in text according to contextual information. Compared with the traditional hidden Markov model (HMM), CRF does not assume independence between observation sequences, but directly models the conditional probability distribution between the input sequence and the annotation sequence, so it has better performance when processing natural language text. In the process of entity annotation, the CRF model calculates the probability of occurrence of each candidate entity in a specific context, and this probability reflects the correlation between the entity and the context.

[0041] Furthermore, these scores can be converted into probability distributions through the conditional random field model, thereby achieving probability normalization for all candidate entities. Based on the results of entity labeling, the system will screen the probability of occurrence of each entity and use entities with a probability greater than a preset threshold as the final identified entity. This method can not only improve the accuracy of entity recognition, but also reduce the interference of noise data. By setting a reasonable probability threshold, entities that may be misidentified can be effectively filtered out, ensuring that the system only identifies those legal entities with a high degree of confidence, thereby improving the reliability of the system in practical applications.

[0042] Based on the scheme of the present invention, this CRF-based entity recognition method can better handle complex semantic relationships in legal texts, enhance the ability to understand context, and thus improve the accuracy of information extraction. Combined with the preprocessing steps, this method helps to establish a high-quality legal knowledge graph and provide reliable data support for subsequent relationship extraction and legal reasoning.

[0043] Preferably, the rule for performing relation extraction based on the preprocessed existing information is: a relation extraction model based on dependency syntactic analysis and convolutional neural network is used to perform relation extraction in the preprocessed existing information; wherein the relation extraction model is expressed as:

[0044] r ij =CNN(E i ,E j )CNN()

[0045] Among them, r ij For entity E i With entity E j The relationship between; CNN() is a convolutional neural network model.

[0046] In an embodiment of the present invention, the scheme of the present invention combines a relationship extraction model of dependency syntactic analysis and a convolutional neural network (CNN). In practical applications, dependency syntactic analysis is used to identify the dependency relationships of words in a sentence, thereby constructing a syntactic structure tree. This analysis method can help determine potential grammatical relationships, enabling the system to understand the deep information of the syntactic structure and semantic relationships of the text. In the relationship extraction task, dependency syntactic analysis plays a role in identifying potential dependencies between related entities in a sentence, and this information can provide valuable feature inputs for the convolutional neural network. As a deep learning model, the convolutional neural network can extract local features through successful applications in text feature extraction and relationship classification, and gradually reduce the feature dimensions through the operations of convolution and pooling layers, so that the model can focus on the key semantic features in the text. When using a convolutional neural network for relationship extraction, the model will classify and label the relationships between entities based on the input syntactic features and text features.

[0047] Furthermore, through the relationship extraction model, the preprocessed text can be input into the convolutional neural network to automatically extract the semantic features between entities and classify the relationships based on these features. For example, in legal texts, the model can automatically identify the reference relationship between different clauses in legal texts, the causal relationship between different events in case law, etc., thereby providing support for building a more complex legal knowledge graph.

[0048] Based on the solution of the present invention, the method of combining dependency syntactic analysis and convolutional neural network improves the accuracy and robustness of relation extraction, especially when dealing with complex legal texts. Through this method, the system can better understand the structure and intrinsic semantic relationship of legal texts, thereby improving the effects of applications such as legal information retrieval, knowledge graph construction and legal reasoning. This provides legal practitioners with more efficient tools to support them in conducting more in-depth case analysis and legal decision-making.

[0049] Preferably, the construction of a knowledge graph based on entities and the relationships between entities includes: using entities as nodes of the implementation graph, using the relationships between entities as edges between corresponding connecting nodes, and constructing a corresponding knowledge graph.

[0050] In an embodiment of the present invention, the process of constructing a knowledge graph can be represented as a graph structure G=(V,E).

[0051] Among them, V represents a node set, which represents the entities in the knowledge graph, and E represents an edge set, which represents the relationship between entities. Each node corresponds to a legal entity, such as a legal provision, a case, or a legal concept; each edge represents the semantic association between these entities, such as a reference relationship, a causal relationship, or a hierarchical relationship. In the construction process, the identified entities need to be used as nodes of the knowledge graph, and the extracted relationships need to be used as edges connecting the nodes to form a complete graph structure. The knowledge graph not only stores structured information of entities and relationships, but also supports efficient retrieval through query languages ​​in the storage database. For example, using graph databases such as Neo4j for storage, complex semantic retrieval and analysis of the knowledge graph can be performed through the Cypher query language. This structured storage method can not only intuitively represent knowledge in the legal field, but also achieve fast query and reasoning.

[0052] Furthermore, the storage of entities and relationships enables knowledge graphs to support rich semantic analysis. For example, in the automatic processing of legal documents, the reference relationship between related laws can be found through the graph, or the basis for the judgment of different cases can be analyzed during case reasoning. Compared with traditional keyword matching methods, knowledge graphs can better reflect the deep-level associations in legal information, thereby improving the accuracy of information retrieval and legal reasoning.

[0053] Based on the solution of the present invention, through the graph, the system can connect isolated pieces of information to form a more complete knowledge network, thereby better supporting legal analysis and decision-making. The graph structure of the knowledge graph is also easy to expand and update. When adding new legal provisions or cases, you only need to add corresponding nodes and edges. The legal knowledge graph constructed in this way has significant advantages in applications such as case analysis, legal advice generation, and regulatory retrieval, making the system more intelligent and more practical.

[0054] Preferably, after constructing the knowledge graph based on entities and the relationships between entities, the method further includes: storing the knowledge graph based on the Neo4j graph database; visualizing the stored knowledge graph based on the Neovis.js library, so as to push the visualized knowledge graph in response to the knowledge graph query demand triggered by the user.

[0055] In an embodiment of the present invention, the knowledge graph is stored using the Neo4j graph database, which is a database system specifically used to store and process graph data. Neo4j can efficiently manage complex graph data structures, and provides a powerful query language Cypher for adding, deleting, searching, and modifying graph data. The knowledge graph is stored in the form of a graph structure, in which entities are nodes and the relationships between entities are edges. For example, in a knowledge graph in the legal field, nodes can represent legal provisions, precedents, legal concepts, etc., and edges represent the relationships between these entities (such as reference relationships or causal relationships). By using Neo4j for storage, the query efficiency and storage flexibility of the data can be significantly improved, especially when processing complex legal information. This method can quickly obtain relevant entities and their relationships, greatly improving the level of intelligence in legal knowledge management.

[0056] Furthermore, in order to realize the visualization of knowledge graph, Neovis.js library is used to display the node and edge relationships in the graph. Neovis.js is a JavaScript-based front-end library specifically used to visualize Neo4j graph data. It can obtain graph data and present it on the visualization interface through interaction with the Neo4j database. The specific process is as follows:

[0057] 1) Data acquisition and display: First, get the graph data from the Neo4j database through Neo4j.getData(). This step actually executes a Cypher query and passes the query results to the Neovis.js library. Then, use the Neovis.render(Data) method to render the acquired data into a visual graph to intuitively display the structure of the knowledge graph.

[0058] 2) Node interaction function: In the visual interface, users can click on a node to view detailed information, such as the node’s name, attributes, relationships, and other associated nodes. This interactive function enables users to more conveniently browse the content of the knowledge graph and gain a deeper understanding of the connections between legal entities.

[0059] 3) Node dragging and layout updating: Users can also adjust the layout of the graph by dragging nodes. When a user moves a node, the system will recalculate the layout of the graph to keep the graph structure clear and orderly. This dynamic layout adjustment function is achieved through the "Force-Directed Layout" algorithm, which automatically optimizes the layout based on the distance and force between nodes.

[0060] Furthermore, the force-directed layout algorithm is an algorithm commonly used for graph drawing, which simulates the forces in physical systems to arrange nodes. The algorithm calculates the forces based on the distance between nodes and the ideal distance, so that the positions of nodes in the graph maintain appropriate spacing and clarity. For example:

[0061]

[0062] Among them, F ij is the force between point i and point j. K is a constant, which may be a spring constant or other proportional coefficient, depending on the actual physical scenario. ij is the distance between point i and point j. r is a reference distance, which may be the initial length of the system or the natural length of the spring, used to compare with d ij By using the force-directed layout algorithm, the nodes in the knowledge graph can be arranged reasonably according to the strength of the entity relationship, reducing node overlap and edge crossing, which greatly improves the readability of the graph. This layout optimization not only improves the visual effect, but also makes it easier for users to discover important information and hidden knowledge associations during the interaction process.

[0063] Based on the solution of the present invention, Neovis.js is used to visualize the knowledge graph, so that the complex legal knowledge graph can be presented in an intuitive way. Its technical effects are reflected in the following aspects:

[0064] 1) Enhanced user experience: Users can freely explore the knowledge graph through interactive operations (such as clicking and dragging), thereby improving their understanding and analysis of legal data.

[0065] 2) Improve information retrieval efficiency: Visual maps can quickly locate legal entities and their related information, and users do not need to search through tedious text to find relevant content. This graphical approach greatly improves the efficiency of information acquisition.

[0066] 3) Supporting legal decision analysis: By displaying the multi-level relationships and association strengths between entities, knowledge graphs can help legal practitioners conduct background analysis and decision support for complex cases, especially in the analysis of multi-entity relationships.

[0067] The solution of the present invention combines Neo4j and Neovis.js, which not only realizes the structured storage and intuitive display of legal knowledge, but also provides an efficient legal information management and analysis tool. Users can conduct in-depth analysis and visual reasoning on a large amount of legal data through simple interactive operations, which helps to explore hidden legal connections and support more intelligent legal research and practice.

[0068] Step S30: Collect the user's legal information processing instructions, and identify the user's intention based on the legal information processing instructions.

[0069] Specifically, the legal information processing instructions are processed into corresponding text information, and the noise in the text information is removed based on the GLM-4 model; the intention of the text information after noise removal is identified based on the natural language processing model to obtain the prediction target.

[0070] Specifically, the legal information processing instructions are processed in text form, that is, the instructions are converted into a parsable text format so that the system can further process the information. To ensure the quality of the text information, the GLM-4 (General Language Model 4) model is needed to remove noise. GLM-4 is an advanced language model that can automatically detect and filter out redundant information, erroneous information or other noise in the text to ensure that the processed text is clearer and more accurate. This noise removal process can improve the system's understanding of text information and avoid misjudgments and processing errors caused by noise interference.

[0071] Furthermore, based on the text information after noise removal, the system uses the natural language processing (NLP) model to identify its intent. This step identifies the goals or needs behind the user's intention through semantic analysis of the text content. For example, legal information may contain instructions to request the query of relevant legal provisions, analyze case precedents, or provide legal advice. The NLP model will extract the user's actual needs based on the semantic features of the text. Through this intent recognition, complex instructions can be simplified into operational goals that the system can handle, thus laying the foundation for subsequent legal information retrieval and reasoning.

[0072] In a possible implementation, efficiently processing the case descriptions input by users and classifying and predicting them is a key task of the system. The case descriptions input by users may contain noise, such as irrelevant information, repeated words, and colloquial expressions, so preprocessing is required. We use the GLM-4 (Generative Language Model-4) model to remove noise. The processing steps are as follows:

[0073] 1) Input: The original case description (Raw Description) entered by the user.

[0074] 2) Model processing: The original description is input into the GLM-4 model. GLM-4 is a powerful generative language model that can understand context and generate more precise text. By analyzing and understanding the input, GLM-4 can remove noise information while retaining the key content in the case description.

[0075] 3) Output: Cleaned Description text after processing, the formula is:

[0076] Cleaned Description=GLM-4 (Raw Description).

[0077] This means that the raw description data are processed by the “GLM-4” method to obtain a cleaned and optimized description.

[0078] Step S40: Based on the recognition intention and the legal information processing instructions, the result prediction information is generated through the knowledge graph, and the result prediction information is pushed to the user end.

[0079] Specifically, based on the prediction target, classification prediction is performed through the support vector machine model, and the obtained prediction information is pushed to the user end.

[0080] In one possible implementation, the system processes the case description through Jieba and Word2Vec and converts it into a vector; uses the SVM classifier to classify the crime, and after denoising through GLM-4, the prediction results are displayed in real time through the Flask framework. Jieba word segmentation and Word2Vec are used to convert text into a vector.

[0081] Vec(ω)=Word2Vec(ω)

[0082] Among them, ω is the word in the case description, and Vec(ω) is the word vector.

[0083] In SVM, the goal is to classify the data by constructing a hyperplane. The SVM model constructs the classification hyperplane:

[0084] f(x)=ω T x+b

[0085] Among them, x is the input feature vector, ω is the weight vector, and b is the bias. The optimization goal of SVM is to find the best hyperplane by minimizing a specific objective function. For classification problems, this objective function can be expressed as:

[0086]

[0087] Among them, ξi is a slack variable and C is a penalty parameter. SVM optimizes an objective function to find the best classification hyperplane that maximizes the interval between categories. By introducing slack variables and penalty parameters, SVM can handle linear inseparable problems and show good classification ability in high-dimensional data and complex data relationships. For the crime classification task, these characteristics of SVM make it a powerful classification tool.

[0088] Furthermore, after obtaining the cleaned case description, the support vector machine (SVM) model is used for classification prediction. The processing steps are as follows:

[0089] 1) Input: Case description text (Cleaned Description) cleaned by GLM-4.

[0090] 2) Feature extraction: The cleaned text is converted into feature vectors, usually using methods such as Bag of Words and TF-IDF for vectorization.

[0091] 3) Model processing: The feature vector is input into the pre-trained SVM classification model. The SVM classifies the input text into specific case categories based on the hyperplane learned during training.

[0092] 4) Output: Case classification prediction results (Prediction). Use the support vector machine (SVM) algorithm to classify or predict the cleaned description data.

[0093] In order to display the classification results to users in real time, a lightweight Web API service is developed using the Flask framework. The processing steps are as follows:

[0094] 1) API interface design: Define a Flask API interface that receives user case description requests.

[0095] 2) Call the model: Call the GLM-4 model in the API interface to remove noise, and then input the cleaned description into the SVM model for classification prediction.

[0096] 3) Generate response: Encapsulate the prediction result into response data in JSON format and send it back to the front end through Flask's send method.

[0097] 4) Front-end display: The front-end application receives the response results of the API and displays the case classification prediction results to the user in real time. The API response format is expressed as:

[0098] API Response=Flask.send(Prediction)

[0099] The prediction results are sent back to the client through the Flask framework as API responses.

[0100] Based on the solution of the present invention, the solution of the present invention is based on the processing and prediction technology of GLM-4 and SVM, and has the following advantages:

[0101] 1) Efficient text processing: The GLM-4 model can intelligently remove noise information, improve the readability of the text and the efficiency of extracting key information.

[0102] 2) Accurate classification prediction: The SVM model shows high classification accuracy when processing high-dimensional text features and can effectively classify cases.

[0103] 3) Real-time feedback: The Flask framework is used to achieve real-time interaction, so that users can quickly obtain prediction results, thereby improving the user experience.

[0104] This system design is not only suitable for case classification tasks in legal information systems, but can also be extended to other application scenarios that require processing complex text inputs and performing classification predictions.

[0105] In one possible implementation, the system front-end interacts with the back-end API interface through HTML / CSS / JavaScript; the system architecture adopts modular design and plug-in support to ensure the extensibility of future functions. The front-end uses HTML / CSS / JavaScript, combined with graph visualization and smart dialog technology, to interact with the back-end through the API interface. The system architecture is designed to be flexible and supports the expansion of future functions, such as adding new knowledge graph node types or integrating new machine learning models.

[0106] Based on the solution of the present invention, compared with the traditional legal information system and intelligent assistant, the present invention has achieved significant technical breakthroughs in the following aspects:

[0107] 1) Efficient legal knowledge retrieval and display: Knowledge graph technology combined with graph embedding technology improves retrieval efficiency and accuracy, and users can quickly obtain the relationship between legal entities through a visual interface.

[0108] 2) Intelligent case analysis and prediction: The intelligent assistant model that combines word embedding and SVM can accurately analyze case descriptions and give reasonable crime predictions. Compared with traditional rule-based systems, word embedding technology can better understand the semantic information in case descriptions.

[0109] 3) Enhanced user interaction experience: The front-end design of the system focuses on user experience. Combining graph display with intelligent dialogue technology, users can quickly perform queries and interactive operations to improve the user experience.

[0110] 4) Foresight and scalability of technology: It adopts advanced technologies such as Word2Vec, SVM, GLM, etc. The system architecture is flexible and supports future functional expansion and scenario adaptation.

[0111] Figure 2 1 is a system structure diagram of a legal information processing system integrating a knowledge graph and a large language model provided by an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention provides a legal information processing system that integrates a knowledge graph and a large language model, and the system includes: a collection unit, which is used to collect existing information related to the legal field and perform data preprocessing on the existing information; a graph construction unit, which is used to perform entity recognition and relationship extraction based on the preprocessed existing information, and to construct a knowledge graph based on entities and the relationships between entities; a trigger unit, which is used to collect the user's legal information processing instructions and perform user intention recognition based on the legal information processing instructions; a prediction unit, which is used to generate result prediction information through the knowledge graph based on the recognition intention and the legal information processing instructions, and push the result prediction information to the user end.

[0112] An embodiment of the present invention also provides a computer-readable storage medium, which stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned legal information processing method integrating the knowledge graph and the large language model.

[0113] Those skilled in the art will understand that all or part of the steps in the method for implementing the above-mentioned embodiments can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions for making a single-chip microcomputer, a chip or a processor (processor) perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0114] The optional embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the technical concept of the embodiments of the present invention, the technical scheme of the embodiments of the present invention can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.

[0115] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.

Claims

1. A legal information processing method integrating knowledge graph and large language model, characterized in that: The method comprises: Collect existing information related to the legal field and perform data preprocessing on the existing information; Perform entity recognition and relationship extraction based on the preprocessed existing information, and build a knowledge graph based on the entities and the relationships between them; Collecting the user's legal information processing instructions, and identifying the user's intention based on the legal information processing instructions; Based on the recognition intention and legal information processing instructions, result prediction information is generated through the knowledge graph and pushed to the user end.

2. The method according to claim 1, characterized in that Available information related to the legal area in question includes: Any one or more of legal provisions, judicial interpretations and historical precedents; The data preprocessing of the existing information includes: The existing information is sequentially subjected to data cleaning and data standardization processing.

3. The method according to claim 1, characterized in that The rules for entity recognition based on preprocessed existing information include: In the existing information after preprocessing, entity labeling is performed based on the conditional random field model to obtain entity labeling results; Based on the entity labeling results, the occurrence probability of each entity is determined, and entities with an occurrence probability greater than a preset occurrence probability threshold are regarded as recognized entities.

4. The method according to claim 3, characterized in that: The conditional random field model is: Among them, p(E i |context) is entity E i The probability of occurrence; score(E i ,context) is entity E i relevance score to the context; ∑E j ∈Possible Entities exp(score(E i ,context)) is the sum of the indexed scores of all candidate entities.

5. The method according to claim 1, characterized in that The rules for relation extraction based on the existing preprocessed information are: The relation extraction model based on dependency syntactic analysis and convolutional neural network extracts relations from the existing information after preprocessing; The relation extraction model is expressed as: r ij =CNN(E i ,E j )CNN( ) Among them, r ij For entity E i With entity E j the relationship between; CNN ( ) is a convolutional neural network model.

6. The method according to claim 1, characterized in that The construction of a knowledge graph based on entities and the relationships between entities includes: The entities are used as nodes of the implementation graph, and the relationships between entities are used as edges between corresponding connecting nodes to construct the corresponding knowledge graph.

7. The method according to claim 6, characterized in that After constructing the knowledge graph based on the entities and the relationships between the entities, the method further includes: Knowledge graph storage based on Neo4j graph database; The stored knowledge graph is visualized based on the Neovis.js library to push the visualized knowledge graph in response to the knowledge graph query requirements triggered by the user.

8. The method according to claim 1, characterized in that The identifying of user intention based on the legal information processing instruction includes: Processing the legal information processing instructions into corresponding text information, and removing noise from the text information based on the GLM-4 model; Based on the natural language processing model, the intention of the text information after noise removal is recognized to obtain the prediction target; The method of generating result prediction information based on the recognition intention and the legal information processing instruction through the knowledge graph and pushing the result prediction information to the user end includes: Based on the prediction target, classification prediction is performed through the support vector machine model, and the obtained prediction information is pushed to the user end.

9. A legal information processing system integrating knowledge graph and large language model, characterized in that: The system comprises: A collection unit, used to collect existing information related to the legal field and perform data preprocessing on the existing information; A graph construction unit is used to perform entity recognition and relationship extraction based on the preprocessed existing information, and to construct a knowledge graph based on entities and the relationships between entities; A trigger unit, used to collect the user's legal information processing instructions and identify the user's intention based on the legal information processing instructions; The prediction unit is used to generate result prediction information through the knowledge graph based on the recognition intention and the legal information processing instructions, and push the result prediction information to the user end.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the legal information processing method integrating a knowledge graph and a large language model as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Legal information processing method fusing knowledge graph and large language model

    CN121257698A

  • GraphRAG-based legal knowledge graph analysis method, equipment and medium

    CN121579699A

  • CAD operation prediction method and device based on artificial intelligence and electronic equipment

    CN121580771A

  • Artificial intelligence-based cad operation prediction method, device and electronic equipment

    CN121580771B