GraphRAG-based legal knowledge graph analysis method, equipment and medium
By constructing a legal knowledge graph using GraphRAG, case knowledge can be dynamically organized and retrieved in multiple dimensions. This solves the problems of redundant retrieval results and insufficient intelligence in existing technologies, and achieves efficient and accurate legal knowledge analysis.
Patent Information
- Application Number
- CN202511684048.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies struggle to organize case knowledge dynamically and precisely, resulting in redundant and mixed retrieval results during legal knowledge graph analysis, and a lack of intelligent evolution capabilities.
A legal knowledge graph is constructed using GraphRAG. By parsing multimodal legal judgment case documents, a case graph set is generated, a case graph community is constructed, and a cross-community association graph is generated. The GraphRAG search engine is used for multi-dimensional retrieval, and the graph community and search strategy are updated based on user feedback.
It has achieved dynamic and precise organization of case knowledge, improving the intelligence level of legal knowledge graph analysis and the accuracy of retrieval services.
Smart Images

Figure CN121579699A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of knowledge graph, in particular to a legal knowledge graph analysis method and device based on GraphRAG and a medium. BACKGROUND
[0002] With the increasing complexity of legal system, more and more legal documents, and the continuous growth of legal judgment documents, how to realize efficient and accurate knowledge retrieval and intelligent analysis in the face of massive, multi-source and unstructured legal document data has become a key challenge in the field of legal technology.
[0003] At present, for the legal industry, traditional keyword retrieval and enhanced generation system based on vector retrieval are difficult to support normal legal reasoning and analysis. Therefore, the existing technology attempts to build a legal knowledge graph to support legal retrieval services, but the construction process is often static or semi-static, and cannot dynamically organize case knowledge according to business needs. When analyzing the knowledge graph, the search scope is easy to get out of control, and the knowledge range cannot be accurately defined, resulting in redundant and mixed search results. Secondly, the existing legal knowledge graph lacks the function of supporting intelligent evolution after construction, which makes the intelligence insufficient. SUMMARY
[0004] To solve the above problems, the embodiments of the present application provide a legal knowledge graph analysis method and device based on GraphRAG and a medium, thereby solving the technical problem of how to dynamically and accurately organize case knowledge and intelligently evolve to complete legal knowledge graph analysis.
[0005] In one aspect, the embodiments of the present application provide a legal knowledge graph analysis method based on GraphRAG, which comprises: analyzing and processing a multi-modal legal judgment case document to obtain a case graph element set; wherein the case graph element set at least includes entity graph elements, relationship graph elements and case attribute graph elements; Based on the case graph element set and the graph element community clustering rule, one or more case graph element communities are constructed, and based on each case graph element community and a preset cross-community association rule, a cross-community association graph is generated; Based on each case graph element community and the cross-community association graph, a dynamic legal knowledge graph is constructed; In response to a user query request, through a preset GraphRAG retrieval engine, multi-dimensional retrieval information corresponding to the user query intent is determined from the dynamic legal knowledge graph, and the multi-dimensional retrieval information is sent to the user terminal; updating the graph element community clustering rule, the preset cross-community association rule and / or the inference strategy of the preset GraphRAG retrieval engine based on feedback information from the user terminal.
[0006] In an implementation manner of the present application, the multi-modal legal judgment case document is parsed to obtain a case graph element set, specifically including: The multi-modal legal judgment case document is parsed to obtain corresponding original text and document structure information; The entity graph element, the relationship graph element and the case attribute graph element are determined according to the original text and the document structure information; The entity graph element, the relationship graph element and the case attribute graph element are standardized based on a preset standardization comparison list, so as to generate the case graph element set according to the standardized graph elements.
[0007] In an implementation manner of the present application, the entity graph element, the relationship graph element and the case attribute graph element are determined according to the original text and the document structure information, specifically including: The legal provisions, the party names and the case numbers are matched from the original text based on a preset regular expression and the document structure information to form the entity graph element; The semantic relationship between the entity graph elements in the original text is analyzed by a relationship extraction model based on legal text fine-tuning according to the document structure information to generate the relationship graph element; wherein the semantic relationship includes at least one or more of the following: citation relationship, hierarchical relationship, time sequence relationship and applicable relationship; The case type, the trial court and the judgment date information are extracted from the original text as the case attribute graph element according to a preset named entity recognition and classification model and the document structure information.
[0008] In an implementation manner of the present application, the one or more case graph element communities are constructed based on the case graph element set and the graph element community clustering rule, specifically including: Each graph element in the case graph element set is clustered according to a clustering attribute in the graph element community clustering rule; wherein the clustering attribute includes at least one or more of the following: dispute type, regional jurisdiction and judgment year; The mapping relationship between each graph element and its belonging clustering community is established according to the clustering result; The case graph element set is divided into one or more case graph element communities according to the mapping relationship.
[0009] In an implementation manner of the present application, the cross-community association graph is generated according to each case graph element community and a preset cross-community association rule, specifically including: calculate semantic vector similarities of the entity graph elements between different case graph element communities, and when the semantic vector similarities are greater than a first preset threshold, establish semantic association edges between the corresponding case graph element communities; detect whether the cited statute entity graph elements of the relationship graph elements in different case graph element communities are the same, and when the cited statute entity graph elements are the same, establish statute association edges between the corresponding case graph element communities; based on the semantic association edges and the statute association edges, construct the cross-community association graph connecting different case graph element communities; based on each case graph element community and the cross-community association graph, construct a dynamic legal knowledge graph, specifically including: all graph elements in each case graph element community are taken as initial nodes of the dynamic legal knowledge graph, and the relationships between the graph elements in each case graph element community are taken as edges of the dynamic legal knowledge graph, to obtain a community subgraph; the semantic association edges and the statute association edges in the cross-community association graph are taken as cross-community edges connecting different community subgraphs, and are added to the dynamic legal knowledge graph.
[0010] In an implementation manner of the present application, the multi-dimensional retrieval information corresponding to the user query intention is determined from the dynamic legal knowledge graph through a preset GraphRAG retrieval engine, specifically including: the user query request is parsed to determine the user query intention and a target case graph element community corresponding thereto; according to the user query text, relevant graph elements are matched from the target case graph element community as initial retrieval results; according to the cross-community association graph and the user query text, corresponding relevant graph elements are matched from other case graph element communities having association edges with the target case graph element community as extended retrieval results; the initial retrieval results and the extended retrieval results are fused and sorted to generate the multi-dimensional retrieval information.
[0011] In an implementation manner of the present application, the initial retrieval results and the extended retrieval results are fused and sorted to generate the multi-dimensional retrieval information, specifically including: based on a first weight list, a basic weight value corresponding to each relevant graph element in the initial retrieval results is determined; based on a second weight list, an association edge type and an association strength between a case graph element community corresponding to the extended retrieval results and the target case graph element community, a cross-community weight value corresponding to each relevant graph element in the extended retrieval results is determined; Based on the basic weight value, the cross-community weight value, and the matching score of each related graphic element, a weighted matching score is determined for each related graphic element. A sequence of related graphic elements is generated in descending order of the weighted matching scores to obtain the multi-dimensional retrieval information.
[0012] In one implementation of this application, updating the primitive community clustering rules, the preset cross-community association rules, and / or the inference strategy of the preset GraphRAG retrieval engine based on feedback information from the user terminal specifically includes: Based on the feedback information, determine whether the multi-dimensional search information can be adopted as search results; If so, based on the preset positive feedback correction rule, correct the clustering parameters in the primitive community clustering rule, the association parameters in the preset cross-community association rule, and / or the inference parameters of the preset GraphRAG retrieval engine's inference strategy; Otherwise, based on the preset negative feedback correction rule, the clustering parameters in the primitive community clustering rule, the association parameters of the preset cross-community association rule, and / or the inference parameters of the preset GraphRAG retrieval engine's inference strategy are corrected.
[0013] Secondly, embodiments of this application also provide a GraphRAG-based legal knowledge graph analysis device, the device comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the GraphRAG-based legal knowledge graph analysis method described above.
[0014] Thirdly, embodiments of this application also provide a non-volatile computer storage medium storing computer-executable instructions, which are capable of executing the aforementioned GraphRAG-based legal knowledge graph analysis method.
[0015] Compared with the prior art, the significant advantages of this application are as follows: Through the aforementioned technical solution, this application can perform refined analysis of legal documents to obtain case primitives, and construct a dynamic legal knowledge graph through these primitives and their communities. This allows for precise retrieval of legal knowledge based on the finely divided primitives and their communities, effectively achieving high-quality case knowledge organization. Furthermore, it enables the intelligent evolution of legal knowledge graph analysis, improving the user experience of legal knowledge graph analysis and retrieval services. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart illustrating a GraphRAG-based legal knowledge graph analysis method in an embodiment of this application. Figure 2 This is a schematic diagram of a community subgraph in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a GraphRAG-based legal knowledge graph analysis device in an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] For the legal industry, traditional keyword retrieval and vector-based augmented generation systems are insufficient to support normal legal reasoning and analysis. Therefore, existing technologies attempt to construct legal knowledge graphs to support legal retrieval services. However, their construction process is often static or semi-static, unable to dynamically organize case knowledge according to business needs. Furthermore, when analyzing the knowledge graph, the retrieval scope is easily out of control, making it difficult to accurately define the knowledge range, resulting in redundant and mixed search results. Secondly, existing legal knowledge graphs lack the functionality to support intelligent evolution after construction, resulting in insufficient intelligence.
[0019] Based on this, embodiments of this application provide a GraphRAG-based legal knowledge graph analysis method, device, and medium to solve the technical problem of how to dynamically and accurately organize case knowledge and intelligently evolve to complete legal knowledge graph analysis.
[0020] The various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0021] This application provides a GraphRAG-based legal knowledge graph analysis method, such as... Figure 1 As shown, the method may include steps S101-S105: S101, the server parses and processes the multimodal legal judgment case documents to obtain a set of case primitives.
[0022] The case element set includes at least entity elements, relationship elements, and case attribute elements.
[0023] Multimodal legal judgment case documents can be understood as legal documents in multiple formats, such as PDF, Word, HTML, Markdown, etc. This application does not specify the format of the legal documents to be parsed.
[0024] It should be noted that the server, as the executing entity of the GraphRAG-based legal knowledge graph analysis method, is merely an example, and the executing entity is not limited to the server; this application does not specifically limit it. This application uses the server as an example to illustrate various embodiments. The server runs a system capable of executing the GraphRAG-based legal knowledge graph analysis method. This system can receive multimodal legal judgment case documents uploaded from user terminals, and can also obtain multimodal legal judgment case documents from a pre-established network connection database or cloud platform; this application does not specifically limit it.
[0025] In this embodiment of the application, the above-mentioned parsing and processing of multimodal legal judgment case documents to obtain a case primitive set specifically includes: The process involves parsing multimodal legal judgment case documents to obtain the corresponding original text and document structure information. Based on the original text and document structure information, entity primitives, relationship primitives, and case attribute primitives are identified. Using a pre-defined standardized comparison list, the entity primitives, relationship primitives, and case attribute primitives are standardized to generate a case primitive set.
[0026] Specifically, this application can employ technologies such as OCR, NLP, and deep learning to parse multimodal legal judgment case documents such as PDF, Word, and HTML. It then uses a pre-trained deep learning model to extract the original text containing information such as legal provisions, cases, parties, institutions, amounts, and creation times, as well as document structure information including hierarchical information such as chapters, clauses, sub-items, and citation relationships. Furthermore, it extracts entity primitives, relationship primitives, and case attribute primitives from the original text and document structure information. Specifically, determining entity primitives, relationship primitives, and case attribute primitives based on the original text and document structure information includes: matching legal provisions, party names, and case numbers from the original text using pre-defined regular expressions and document structure information to form entity primitives. Based on the document structure information, a relationship extraction model fine-tuned based on legal text is used to analyze the semantic relationships between entity primitives in the original text, generating relationship primitives. The semantic relationships include at least one or more of the following: citation relationships, hierarchical relationships, temporal relationships, and applicability relationships. Based on the preset named entity recognition and classification model and document structure information, the case type, court of trial, and judgment date information are extracted from the original text and used as case attribute primitives.
[0027] Document structure information can locate document positions, such as title blocks, party information blocks, and judgment text blocks. The specific principles for dividing document structure information can be set based on actual usage scenarios, or machine learning models can be trained to assist in document structure information recognition; no specific limitations are made here. Combining document structure information, entity primitives are identified using pre-defined regular expression technology. Semantic relationships between entity primitives are identified using a relation extraction model to extract relation primitives. Furthermore, case attribute primitives are extracted within the document structure using named entity recognition and classification models. These case attribute primitives include, but are not limited to, case attributes corresponding to case type, court of trial, and judgment date information; no specific limitations are made in this application. The pre-defined named entity recognition and classification model can be a pre-trained neural network model or other models; no specific limitations are made here.
[0028] After obtaining entity primitives, relationship primitives, and case attribute primitives, the server will use a pre-set standardized comparison list to standardize each primitive. Standardization can be understood as unifying the format of the primitives; for example, entity primitives are uniformly labeled "Type-Name-Core Attribute," and relationship primitives are uniformly labeled "Source Primitive-Target Primitive-Relationship Type." Simultaneously, the descriptions of entity primitives, relationship primitives, and case attribute primitives will be standardized to ensure consistent primitive descriptions for the same entity across different documents. The pre-set standardized comparison list used for standardization can be set or updated according to actual usage scenarios, and this application does not impose specific limitations on it. After standardization, the document source metadata of each entity primitive, relationship primitive, and case attribute primitive in the same multimodal legal judgment case document is annotated, and then added to the case primitive set. Entity primitives such as {id:"Court_1", type:"Judicial Institution", standard_name:"Supreme People's Court"}, relation primitives such as {source:"Person_1", target:"Person_2", type:"Prosecution"}, attribute primitives such as {case_id:"Case_1", attribute:"Judgment Amount", value:50000.00, unit:"Yuan"}.
[0029] S102, the server constructs one or more case element communities based on the case element set and element community clustering rules, and generates a cross-community association map according to each case element community and the preset cross-community association rules.
[0030] In this embodiment of the application, one or more case element communities are constructed based on the case element set and element community clustering rules, specifically including: The elements in the case element set are clustered according to the clustering attributes in the element community clustering rules. These clustering attributes include at least one or more of the following: dispute type, territorial jurisdiction, and judgment year. Based on the clustering results, a mapping relationship is established between each element and its corresponding cluster community. Based on this mapping relationship, the case element set is divided into one or more case element communities.
[0031] In other words, this application pre-sets a clustering rule for graph elements, which can cluster graph elements using clustering algorithms such as DBSCAN and K-means to construct graph element communities. During clustering, dispute type, territorial jurisdiction, and judgment year can be used as clustering attributes to cluster various graph elements, establishing a relationship between different graph elements and a single graph element serving as the cluster center, thus obtaining the clustering result. Subsequently, the mapping relationship between each graph element in the clustering result and its resulting clustered community is recorded. Then, according to the clustering attributes, each graph element in the case graph element set is divided into one or more case graph element communities.
[0032] Once the case element community is obtained, the document has been broken down into its smallest information units, and the cases have been organized and categorized in an orderly manner. Furthermore, to achieve cross-community association, this application generates a cross-community association map based on each case element community and preset cross-community association rules, specifically including: The semantic vector similarity of entity graph elements between different case graph element communities is calculated. When the semantic vector similarity is greater than a first preset threshold, a semantic association edge is established between the corresponding case graph element communities. It is then checked whether the legal provision entity graph elements referenced by relation graph elements in different case graph element communities are the same. When the referenced legal provision entity graph elements are the same, a legal provision association edge is established between the corresponding case graph element communities. Based on the semantic association edges and the legal provision association edges, a cross-community association graph connecting different case graph element communities is constructed.
[0033] In other words, when there are multiple case element communities, the server will extract the semantic vectors corresponding to each entity element within each case element community. Then, it will calculate the similarity of the semantic vectors of each pair of entity elements between different case element communities to obtain the semantic vector similarity. The similarity can be obtained by calculating the reciprocal of the Euclidean distance or cosine similarity, which is not specifically limited here. If the semantic vector similarity of two elements is greater than a first preset threshold, the server will establish a semantic association edge between the two case element communities based on the semantic similarity type of the corresponding two entity elements. The semantic similarity type can be set by the user according to the actual usage scenario, such as similar legal provisions. Subsequently, when the server determines that the relationship element in the case element community is a reference relationship, it will determine the referenced legal provision entity element and compare the referenced legal provision entity elements corresponding to the same relationship element in different case element communities. If the referenced legal provision entity elements are the same, or the semantic similarity of the legal provision entity elements is greater than a second preset threshold, a legal provision association edge will be established between the two case element communities. The aforementioned first and second preset thresholds can be set by the user according to the actual usage scenario, which is not specifically limited here.
[0034] Subsequently, the server will further utilize semantic and legal provision-related edges to connect different case element communities, thereby constructing a cross-community association graph. Different case element communities may exhibit no association, semantic association, legal provision association, or both semantic and legal provision associations, as determined by the aforementioned steps; specific limitations are not specified here.
[0035] S103, the server constructs a dynamic legal knowledge graph based on the community of case elements and the cross-community association graph.
[0036] In this embodiment of the application, the above-mentioned construction of a dynamic legal knowledge graph based on the community of case elements and the cross-community association graph specifically includes: All graph elements in each case's graph element community are used as the initial nodes of the dynamic legal knowledge graph. The relationships between graph elements in each case's graph element community are used as edges of the dynamic legal knowledge graph, resulting in community subgraphs. Semantic association edges and legal provision association edges in the cross-community association graph are used as cross-community edges connecting different community subgraphs and added to the dynamic legal knowledge graph.
[0037] In other words, this application extracts each element from the case element community, then constructs initial nodes, and further analyzes the relationships between elements to obtain the edges of the dynamic legal knowledge graph. The relationships between elements can be obtained by pre-setting a relational analysis neural network model, which is not specifically limited here. Using the initial nodes and the edges between nodes, a community subgraph is constructed. This community subgraph is as follows: Figure 2 As shown. Subsequently, the server further extracts semantic and legal provision edges from the cross-community association graph, using them as cross-community edges to connect various community subgraphs, thus constructing a dynamic legal knowledge graph that spans documents and communities.
[0038] This dynamic legal knowledge graph can execute the above steps S101-S103 based on continuously updated or expanded multimodal legal judgment case documents, thus achieving continuous updates and preservation.
[0039] S104, in response to the user's query request, the server uses the preset GraphRAG retrieval engine to determine multi-dimensional retrieval information corresponding to the user's query intent from the dynamic legal knowledge graph, and sends the multi-dimensional retrieval information to the user terminal.
[0040] In this embodiment of the application, a preset GraphRAG retrieval engine is used to determine multi-dimensional retrieval information corresponding to the user's query intent from a dynamic legal knowledge graph, specifically including: The system analyzes user query requests to determine the user's query intent and its corresponding target case element community. Based on the user's query text, relevant elements are matched from the target case element community as initial search results. Based on the cross-community association graph and the user's query text, corresponding relevant elements are matched from other case element communities that have association edges with the target case element community as extended search results. The initial and extended search results are merged and sorted to generate multi-dimensional search information.
[0041] This application pre-configures a GraphRAG retrieval engine, enabling multi-granularity retrieval and reasoning regarding the user's legal query intent. Users can initiate query requests via their terminals, which can be understood as mobile phones, computers, smartwatches, or other devices, without specific limitations. Upon receiving the query request, the server parses the user's query intent, using technologies such as Natural Language Processing (NLP) to understand this intent. Based on the obtained query intent, the server matches the target case primitive community from a dynamic legal knowledge graph. Specifically, this application can train a neural network model for matching to calculate the degree of matching between the user's query intent and the case primitive community, thereby obtaining the target case primitive community.
[0042] Subsequently, the server will perform a retrieval based on the user query text obtained from parsing the user's query request. The user query request can be text, voice, or image information. The server can use preset parsing tools to identify the query purpose corresponding to the user's query request and use NLP tools to map the query purpose to the user query text. Using the user query text, the server matches graph elements in the target case graph element community. By calculating the cosine similarity with the user query text, relevant graph elements are filtered. When the cosine similarity is greater than a third preset threshold, the corresponding graph element is considered a relevant graph element, thus obtaining the initial retrieval results. Further, the server also performs relevant graph element matching from other case graph element communities associated with the target case graph element community through cross-community association graphs. Specifically, it can filter graph elements with a cosine similarity greater than a fourth preset threshold as relevant graph elements corresponding to the associated case graph element communities, obtaining expanded retrieval results. The aforementioned third and fourth preset thresholds can be set by the user according to the actual usage scenario and are not specifically limited here.
[0043] Furthermore, the server will merge the initial search results and the expanded search results, and sort the results to generate multi-dimensional search information. In this embodiment, merging and sorting the initial search results and the expanded search results to generate multi-dimensional search information specifically includes: Based on the first weight list, the basic weight values corresponding to each relevant element in the initial search results are determined. Based on the second weight list, the type and strength of the association edges between the case element communities corresponding to the extended search results and the target case element communities, the cross-community weight values corresponding to each relevant element in the extended search results are determined. Based on the basic weight values, cross-community weight values, and matching scores of each relevant element, the weighted matching scores corresponding to each relevant element are determined. A sequence of relevant elements is generated in descending order of weighted matching scores to obtain multi-dimensional search information.
[0044] In other words, a first weight list and a second weight list can be pre-stored on the server. The first weight list is used to weight the matching scores of relevant primitives in the initial search results, and the second weight list is used to weight the matching scores of relevant primitives in the extended search results. The first weight list contains a first correspondence between relevant primitives and basic weight values, while the second weight list contains a second correspondence between the type and strength of the associated edge and the cross-community weight value. The type of associated edge can include semantic associated edges and legal provision associated edges, or other user-preset associated edge types, identified based on the relationships between primitives; no specific limitation is made here. The association strength can be determined by a pre-trained association strength recognition model. Information about two related primitives is input into the association strength recognition model, which undergoes convolutional processing to output the association strength. The association strength recognition model can be a convolutional neural network model. Based on the associated edge type and association strength, the cross-community weight value of the corresponding relevant primitive can be matched from the second weight list. For the matching score of relevant graph elements, a pre-defined neural network model for matching analysis can be used to calculate the matching score between relevant graph elements and user query text. Alternatively, other models can be used to calculate the matching score; no specific limitation is made here. The matching score represents the degree to which the user query text and relevant graph elements achieve compliant logical reasoning.
[0045] Subsequently, the matching scores of relevant graphic elements in the initial search results are weighted using basic weight values, and the matching scores of relevant graphic elements in the extended search results are weighted using cross-community weight values to obtain the weighted matching scores of each relevant graphic element. Then, the relevant graphic elements are arranged in descending order of their weighted matching scores to obtain a sequence of relevant graphic elements, which is used as multi-dimensional search information.
[0046] The above approach enables refined analysis of legal documents and the construction of a dynamic legal knowledge graph. Based on the finely divided graph elements and their communities, legal knowledge can be accurately retrieved, effectively achieving high-quality case knowledge organization.
[0047] S105, the server updates the graph element community clustering rules, preset cross-community association rules and / or preset inference strategies of the GraphRAG retrieval engine based on feedback information from the user terminal.
[0048] In this embodiment of the application, based on feedback information from the user terminal, the graph element community clustering rules, preset cross-community association rules, and / or the preset inference strategy of the GraphRAG retrieval engine are updated, specifically including: Based on the feedback information, determine whether the multi-dimensional search information is acceptable. If it is determined that the multi-dimensional search information is acceptable, adjust the clustering parameters in the graph element community clustering rules, the association parameters in the preset cross-community association rules, and / or the inference parameters of the preset GraphRAG search engine's inference strategy based on preset positive feedback correction rules. Otherwise, adjust the clustering parameters in the graph element community clustering rules, the association parameters in the preset cross-community association rules, and / or the inference parameters of the preset GraphRAG search engine's inference strategy based on preset negative feedback correction rules.
[0049] Feedback information can be understood as the user's evaluation or accuracy feedback on the multi-dimensional search information generated based on the user's query request, sent to the user's terminal. Feedback information can be a rating score or text content; this application does not specifically limit this. The server analyzes the feedback information to determine whether the multi-dimensional search information is an acceptable search result adopted by the user. For example, if the feedback information corresponds to a rating score of 9 points, and this rating score is higher than a preset threshold of 7 points, then the user's evaluation is determined to be an acceptable search result. Subsequently, based on the determination of the acceptable search result, the server further matches preset positive feedback correction rules or preset negative feedback correction rules, thereby updating the graph community clustering rules, preset cross-community association rules, and / or preset GraphRAG search engine in the above steps. This achieves adaptive learning and continuous optimization of knowledge graph analysis.
[0050] Through the aforementioned technical solution, this application can perform refined analysis of legal documents to obtain case primitives, and construct a dynamic legal knowledge graph through these primitives and their communities. This allows for precise retrieval of legal knowledge based on the finely divided primitives and their communities, effectively achieving high-quality case knowledge organization. Furthermore, it enables the intelligent evolution of legal knowledge graph analysis, improving the user experience of legal knowledge graph analysis and retrieval services.
[0051] Figure 3 A schematic diagram of the structure of a GraphRAG-based legal knowledge graph analysis device provided in this application embodiment is shown below. Figure 3 As shown, the device includes: At least one processor; and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Multimodal legal judgment case documents are parsed and processed to obtain a case primitive set. This case primitive set includes at least entity primitives, relation primitives, and case attribute primitives. Based on the case primitive set and primitive community clustering rules, one or more case primitive communities are constructed, and a cross-community association graph is generated according to each case primitive community and preset cross-community association rules. A dynamic legal knowledge graph is constructed based on each case primitive community and the cross-community association graph. Responding to user query requests, a preset GraphRAG retrieval engine is used to determine multi-dimensional retrieval information corresponding to the user's query intent from the dynamic legal knowledge graph, and this multi-dimensional retrieval information is sent to the user's terminal. Based on feedback from the user's terminal, the primitive community clustering rules, preset cross-community association rules, and / or the inference strategy of the preset GraphRAG retrieval engine are updated.
[0052] This application embodiment also provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows: Multimodal legal judgment case documents are parsed and processed to obtain a case primitive set. This case primitive set includes at least entity primitives, relation primitives, and case attribute primitives. Based on the case primitive set and primitive community clustering rules, one or more case primitive communities are constructed, and a cross-community association graph is generated according to each case primitive community and preset cross-community association rules. A dynamic legal knowledge graph is constructed based on each case primitive community and the cross-community association graph. Responding to user query requests, a preset GraphRAG retrieval engine is used to determine multi-dimensional retrieval information corresponding to the user's query intent from the dynamic legal knowledge graph, and this multi-dimensional retrieval information is sent to the user's terminal. Based on feedback from the user's terminal, the primitive community clustering rules, preset cross-community association rules, and / or the inference strategy of the preset GraphRAG retrieval engine are updated.
[0053] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0054] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0055] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0056] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A legal knowledge graph analysis method based on GraphRAG, characterized in that, The method includes: The multimodal legal judgment case documents are parsed and processed to obtain a case primitive set; wherein, the case primitive set includes at least entity primitives, relation primitives, and case attribute primitives; Based on the case element set and element community clustering rules, one or more case element communities are constructed, and a cross-community association map is generated according to each case element community and preset cross-community association rules. Based on the case element communities and the cross-community association graphs, a dynamic legal knowledge graph is constructed. In response to a user's query request, the system uses a preset GraphRAG retrieval engine to determine multi-dimensional retrieval information corresponding to the user's query intent from the dynamic legal knowledge graph, and then sends the multi-dimensional retrieval information to the user's terminal. Based on feedback information from the user terminal, update the graph element community clustering rules, the preset cross-community association rules, and / or the inference strategy of the preset GraphRAG retrieval engine.
2. The method according to claim 1, characterized in that, The parsing and processing of multimodal legal judgment case documents yields a set of case primitives, specifically including: The multimodal legal judgment case documents are parsed to obtain the corresponding original text and document structure information; Based on the original text and the document structure information, the entity primitives, the relationship primitives, and the case attribute primitives are determined; Based on a preset standardized comparison list, the entity primitives, relationship primitives, and case attribute primitives are standardized to generate the case primitive set.
3. The method according to claim 2, characterized in that, The step of determining the entity primitives, relationship primitives, and case attribute primitives based on the original text and the document structure information specifically includes: Based on the preset regular expression and the document structure information, legal provisions, party names, and case numbers are matched from the original text to form the entity primitives; Based on the document structure information, the semantic relationships between entity primitives in the original text are analyzed using a relationship extraction model based on legal text fine-tuning, and the relationship primitives are generated; wherein, the semantic relationships include at least one or more of the following: reference relationship, hierarchical relationship, temporal relationship, and applicability relationship; Based on the preset named entity recognition and classification model and the document structure information, the case type, the court of trial, and the date of judgment are extracted from the original text and used as the case attribute primitives.
4. The method according to claim 1, characterized in that, The construction of one or more case element communities based on the case element set and element community clustering rules specifically includes: Each element in the case element set is clustered according to the clustering attributes in the element community clustering rules; wherein, the clustering attributes include at least one or more of the following: dispute type, territorial jurisdiction, and year of judgment; Based on the clustering results, establish a mapping relationship between each graph element and its corresponding cluster community; Based on the mapping relationship, the case element set is divided into one or more case element communities.
5. The method according to claim 1, characterized in that, The step of generating a cross-community association graph based on the case element communities and preset cross-community association rules specifically includes: Calculate the semantic vector similarity of the entity graph elements between different case graph element communities, and when the semantic vector similarity is greater than a first preset threshold, establish semantic association edges between the corresponding case graph element communities; Detect whether the legal provision entity elements referenced by the relational elements in different case element communities are the same. When the referenced legal provision entity elements are the same, establish legal provision association edges between the corresponding case element communities. Based on the semantic association edges and the legal provision association edges, a cross-community association graph is constructed that connects different case element communities; The construction of a dynamic legal knowledge graph based on the case element communities and the cross-community association graph specifically includes: All graph elements in each case graph element community are used as the initial nodes of the dynamic legal knowledge graph, and the relationships between graph elements in each case graph element community are used as the edges of the dynamic legal knowledge graph to obtain a community subgraph. The semantic association edges and legal provision association edges in the cross-community association graph are used as cross-community edges connecting different community subgraphs and added to the dynamic legal knowledge graph.
6. The method according to claim 5, characterized in that, The step of determining multi-dimensional retrieval information corresponding to the user's query intent from the dynamic legal knowledge graph using a preset GraphRAG retrieval engine specifically includes: Analyze the user query request to determine the user's query intent and its corresponding target case element community; Based on the user's query text, relevant elements are matched from the target case element community as the initial search results; Based on the cross-community association graph and the user query text, relevant graph elements are matched from other case graph element communities that have association edges with the target case graph element community, as extended search results; The initial search results and the extended search results are merged and sorted to generate the multi-dimensional search information.
7. The method according to claim 6, characterized in that, The step of fusing and sorting the initial search results and the expanded search results to generate the multi-dimensional search information specifically includes: Based on the first weight list, determine the basic weight value corresponding to each relevant graphic element in the initial search results; Based on the second weight list, the type and strength of the association edges between the case element community corresponding to the extended search results and the target case element community, the cross-community weight value corresponding to each relevant element in the extended search results is determined. Based on the basic weight value, the cross-community weight value, and the matching score of each related graphic element, a weighted matching score is determined for each related graphic element. A sequence of related graphic elements is generated in descending order of the weighted matching scores to obtain the multi-dimensional retrieval information.
8. The method according to claim 1, characterized in that, The step of updating the graph element community clustering rules, the preset cross-community association rules, and / or the inference strategy of the preset GraphRAG retrieval engine based on feedback information from the user terminal specifically includes: Based on the feedback information, determine whether the multi-dimensional search information can be adopted as search results; If so, based on the preset positive feedback correction rule, correct the clustering parameters in the graph community clustering rule, the association parameters in the preset cross-community association rule, and / or the inference parameters of the inference strategy of the preset GraphRAG retrieval engine; Otherwise, based on the preset negative feedback correction rule, the clustering parameters in the primitive community clustering rule, the association parameters of the preset cross-community association rule, and / or the inference parameters of the preset GraphRAG retrieval engine's inference strategy are corrected.
9. A legal knowledge graph analysis device based on GraphRAG, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a GraphRAG-based legal knowledge graph analysis method as described in any one of claims 1-8.
10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing the GraphRAG-based legal knowledge graph analysis method described in any one of claims 1-8.
Citation Information
Patent Citations
Construction method of RAG system based on Graph
CN118503407A
Knowledge graph query method and device, equipment and storage medium
CN118760775A
Question and answer processing method and device based on knowledge graph
CN118838988A
Legal affair information processing method and system fusing knowledge graph and large language model
CN119474257A
Knowledge base index construction optimization method and device based on large model
CN119760178A