Timing sequence knowledge graph multi-hop reasoning method and system oriented to legal field
Through the multi-hop reasoning method of temporal knowledge graph for the legal field, the problem of effectiveness conflict identification when traditional systems deal with legal provisions with high timeliness requirements is solved, and accurate representation of the entire life cycle status of legal provisions and efficient multi-hop path reasoning are achieved, thereby improving the accuracy and efficiency of responses.
Patent Information
- Application Number
- CN202510763352.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-19
AI Technical Summary
When dealing with scenarios where the timeliness of legal provisions is highly demanding, traditional legal knowledge question-answering systems have difficulty identifying conflicts of effectiveness under different time slices, cannot adapt to the spatiotemporal sparseness of the legal field, and are prone to local optimal traps under multiple constraints, resulting in low answer accuracy.
A multi-hop reasoning method based on temporal knowledge graph for the legal field is adopted. A dynamic mapping relationship between legal data and entities is established through semantic association technology. Multi-granularity time parsing and legal conflict detection algorithms are introduced. An abolition propagation function is constructed. Graph attention networks and long short-term memory networks are combined for path completion. A collaborative arbitration mechanism is designed for multi-hop reasoning.
It achieves accurate representation of the entire life cycle status of legal provisions, improves path reasoning capabilities, optimizes the decision-making quality of cross-period legal conflicts, and ensures the accuracy and efficiency of responses.
Smart Images

Figure CN120671831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of legal intelligent question-answering systems, and in particular to a multi-hop reasoning method and system for temporal knowledge graphs in the legal field. Background Art
[0002] Popularizing legal knowledge is a crucial foundation for building a modern society ruled by law and holds far-reaching significance. First, promoting legal knowledge is a core means of advancing the rule of law. It strengthens citizens' recognition of the authority of the law, encourages members of society to consciously abide by the law, and reduces illegal and criminal behavior. Furthermore, the popularization of legal knowledge can improve the efficiency of national governance, safeguard the legitimate rights and interests of vulnerable groups, and promote social fairness and justice. Furthermore, popularizing legal knowledge strengthens members' faith in the law, making it the fundamental norm for the functioning of society. Mastering legal knowledge enhances individuals' social competitiveness, enabling them to make more informed decisions in the workplace, consumption, and daily life, thereby improving their quality of life. In today's information age, legal knowledge question-and-answer systems have become a crucial tool for popularizing legal knowledge. These systems can provide the public with convenient and efficient legal consultation services, helping to quickly resolve legal questions. Temporal knowledge graph reasoning, a core component of knowledge question-and-answer systems, plays a crucial role in enabling them to accurately answer users' legal inquiries.
[0003] Traditional legal knowledge question-answering systems primarily employ a static knowledge graph architecture, using entity relationship extraction techniques to construct a network of connections between legal provisions, judicial interpretations, and typical cases. A typical system architecture typically comprises three core modules: a natural language understanding component based on deep learning, a knowledge storage engine based on a graph database, and a query parser based on rule-based reasoning or neural networks. Such systems enable rapid retrieval of basic legal provisions and provide simple case-related analysis through path reasoning. With the acceleration of legal digitization, some advanced systems are beginning to incorporate time series feature processing modules, attempting to record the promulgation and revision of legal provisions through timestamp annotation. These improved systems utilize classic graph embedding algorithms such as TransE and RotatE, combined with LSTM time series modeling, to initially achieve a discretized representation of legal validity status. They can achieve basic usable reasoning accuracy in legal consulting scenarios with less time-sensitive requirements, such as parsing routine contract terms.
[0004] However, traditional legal knowledge question-answering systems use discrete timestamps to represent the timeliness attributes of legal provisions, lack the ability to model the ternary state of the dynamic process of legislation, and have difficulty identifying conflicts of effectiveness under different time slices; and are limited by the static space assumption, making it difficult to adapt to the unique spatiotemporal sparseness of the legal field; when faced with multiple constraints, they are prone to local optimal traps, resulting in a decrease in the self-consistency of decision-making logic; it is difficult to accurately identify the optimal solution in cross-level legal conflict scenarios; when dealing with legal clauses with derivative relationships, it is impossible to effectively trace the constraining effect of the parent law status on the child clauses; when faced with multi-constraint legal reasoning scenarios, it is difficult to detect conflicts in the effectiveness hierarchy and contradictions in time legitimacy in the path in real time.
[0005] Therefore, due to problems such as static time-limited modeling, heterogeneous path breaks, and cross-level decision-making conflicts, traditional methods often find it difficult to accurately capture the dynamic effectiveness evolution characteristics of legal provisions, resulting in low accuracy of responses given by question-answering systems. Summary of the Invention
[0006] Based on this, in order to solve the above technical problems, a temporal knowledge graph multi-hop reasoning method and system for the legal field is provided, which can accurately and efficiently complete complex legal knowledge multi-hop path reasoning tasks.
[0007] A multi-hop reasoning method for temporal knowledge graphs in the legal field, comprising:
[0008] Collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between the legal data and the legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system;
[0009] Based on the legal data knowledge system, multi-granularity time analysis is performed to extract the life cycle status of each legal provision, and a legal conflict detection algorithm is introduced to obtain a set of legal entities with time-limit annotations;
[0010] A revocation propagation function is constructed using a reverse citation tracking mechanism and a time validity verification algorithm. Based on the revocation propagation function, a legal application relationship graph is traversed, and a revocation impact factor is set to obtain a set of laws with revocation annotations.
[0011] Determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals, fuse them, and obtain a time embedding representation. This time embedding representation is then embedded into the nodes and relationships of the knowledge graph, and the elements of the clause conflict matrix are introduced to construct a temporal knowledge graph.
[0012] A path completion mechanism is adopted to build a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network. The spatiotemporal features are integrated through the completion model to complete the path of the temporal knowledge graph.
[0013] Determine the time selection agent, relationship selection agent, and entity selection agent, use reinforcement learning methods to select the corresponding time, relationship, and entity, and design reward functions for each agent respectively. Combined with dynamic priority strategy and weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
[0014] In one embodiment, multi-source legal data is collected to obtain various legal entities. A dynamic mapping relationship between the legal data and the legal entities is established using semantic association technology. A weight table is constructed for each legal term to obtain a legal data knowledge system, including:
[0015] Determine the type of legal data. If the legal data type is structured data, retrieve it through the API interface; if the legal data type is unstructured data, retrieve it using the BERT-Legal model; if the legal data type is semi-structured data, retrieve it based on XPath parsing;
[0016] Based on the retrieved multi-source legal data, each legal entity is identified, a legal entity link matrix is constructed, and a dynamic mapping relationship between the legal data and the legal entity is established through an improved TF-IDF algorithm and semantic similarity calculation;
[0017] A weight matrix is defined, a weight table is constructed for each legal term based on the weight matrix, and a priority of each legal term is calculated according to the weight table.
[0018] In one embodiment, multi-granularity time parsing is performed based on the legal data knowledge system to extract the lifecycle status of each legal provision. A legal conflict detection algorithm is then introduced to obtain a set of legal entities with timeliness annotations, including:
[0019] Based on the legal data knowledge system, multi-granularity time analysis is performed to determine the promulgation time, effective time, and abolition mark of each legal provision, and a legal time regular expression is designed;
[0020] Defining a clause validity status triple based on the legal time regular expression;
[0021] Setting up a dynamic legal provisions repeal mechanism based on the provisions’ validity status triples;
[0022] Set up legal status transfer rules and introduce legal conflict detection algorithms to perform time logic verification on legal provisions to obtain verification results;
[0023] According to the dynamic legal article abolition mechanism and the verification result, the legal entities are marked with time limits to obtain a set of legal entities with time limit marks.
[0024] In one embodiment, a backreference tracking mechanism and a time validity verification algorithm are used to construct a revocation propagation function. Based on the revocation propagation function, a legal application relationship graph is traversed, and a revocation impact factor is set to obtain a set of laws with revocation annotations, including:
[0025] Using a backreference tracking mechanism and a time validity verification algorithm to construct a revocation propagation function, and determining the legal provisions association impact rules based on the revocation propagation function;
[0026] Using breadth-first search to traverse the legal application relationship graph, identifying and updating the abolished legal provisions based on the association and impact rules of the legal provisions;
[0027] An abolition impact factor is set according to the abolition legal clause, and the legal clauses are marked as abolition based on the abolition impact factor to obtain a set of laws with abolition marks.
[0028] In one embodiment, determining one-hot encoding vectors of a set of legal entities with timeliness labels and a set of laws with repeal labels and fusing them to obtain a time embedding representation includes:
[0029] Determine a one-hot encoding vector of a set of legal entities with expiration marks and a set of laws with revocation marks, and generate a time vector for each time point based on the set of legal entities with expiration marks;
[0030] The time vector is mapped through a time embedding matrix, and the state attributes of the legal provisions are integrated into the time vector to obtain a time embedding representation.
[0031] In one embodiment, the time embedding representation is embedded into the nodes and relationships of the knowledge graph, and the clause conflict matrix elements are introduced to construct a temporal knowledge graph, including:
[0032] Embed the time embedding representation into the nodes and relationships of the knowledge graph, and generate a temporal relationship vector for each relationship;
[0033] The clause conflict matrix elements are introduced into the temporal relationship vector and the time embedding representation to construct a temporal knowledge graph.
[0034] In one embodiment, a path completion mechanism is adopted to construct a spatiotemporal coupled completion model based on a graph attention network and a long short-term memory network. The spatiotemporal features are integrated through the completion model to complete the path of the temporal knowledge graph, including:
[0035] Based on the long short-term memory network, an embedding representation of the temporal state is learned for each node and relationship in the temporal knowledge graph;
[0036] Based on the graph attention network, legal conflict modulation is performed on the relations in the temporal knowledge graph;
[0037] Setting a dynamic mask function to filter the association of abolished legal provisions in the temporal knowledge graph, and constructing a spatiotemporal coupling completion model;
[0038] Based on the completion model, the completion probability and similarity weighted probability of the temporal knowledge graph are dynamically adjusted through the balance coefficient to complete the path completion.
[0039] In one embodiment, a dynamic priority strategy and a weight adaptive algorithm are combined to build a collaborative arbitration mechanism for three agents, including:
[0040] Use reinforcement learning strategies to build a three-agent three-dimensional game framework;
[0041] Combining a dynamic priority strategy and a weighted adaptive algorithm, the optimal action is calculated according to each of the established functions, and based on the optimal action, it is determined whether there is a decision conflict among the three intelligent agents;
[0042] If there is a decision conflict, the coordination degree, time similarity and relationship similarity are calculated, and a collaborative arbitration mechanism is constructed to arbitrate the conflict.
[0043] In one embodiment, the method further comprises:
[0044] Obtain multi-hop reasoning results, interpret path legitimacy and mark conflict points based on the multi-hop reasoning results, and perform visual display.
[0045] A multi-hop reasoning system for temporal knowledge graphs in the legal field, comprising:
[0046] A multi-source data acquisition module is used to collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between the legal data and the legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system;
[0047] A timeliness factor extraction module is used to perform multi-granularity time analysis based on the legal data knowledge system, extract the life cycle status of each legal provision, and introduce a legal conflict detection algorithm to obtain a set of legal entities with timeliness annotations;
[0048] A dynamic revocation propagation module is used to construct a revocation propagation function using a backreference tracking mechanism and a time validity verification algorithm, traverse the legal application relationship graph based on the revocation propagation function, set revocation impact factors, and obtain a set of laws with revocation annotations;
[0049] The legal effect determination module is used to determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals, and fuse them to obtain a time embedding representation. The time embedding representation is then embedded into the nodes and relationships of the knowledge graph, and the elements of the clause conflict matrix are introduced to construct a time series knowledge graph.
[0050] A path completion module is used to adopt a path completion mechanism, build a spatiotemporal coupled completion model based on a graph attention network and a long short-term memory network, and perform path completion on the temporal knowledge graph by fusing spatiotemporal features through the completion model;
[0051] The collaborative strategy and multi-hop reasoning module is used to determine the time selection agent, relationship selection agent, and entity selection agent, use the reinforcement learning method to select the corresponding time, relationship, and entity, and design a reward function for each agent respectively. Combined with the dynamic priority strategy and weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
[0052] The above-mentioned temporal knowledge graph multi-hop reasoning method and system for the legal field can cover multi-dimensional data systems by collecting multi-source legal data, and realize dynamic mapping in combination with semantic association technology to ensure the authority, real-time and relevance of data, thereby providing high-quality input; through multi-granularity actual analysis, it can accurately represent the full life cycle status of legal provisions, and combine with the dynamic abolition propagation mechanism to annotate legal entities; the integration of time-limited and abolition-annotated legal sets can effectively improve the path reasoning ability in low-coverage scenarios; the use of three intelligent agents to build a collaborative arbitration mechanism can optimize the decision-making quality of cross-period legal conflicts, thereby accurately and efficiently completing complex legal knowledge multi-hop path reasoning tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 This is a diagram of the application environment of a multi-hop reasoning method of a temporal knowledge graph for the legal field in one embodiment;
[0054] Figure 2 Schematic diagram of a multi-hop reasoning method for a temporal knowledge graph in the legal field in one embodiment;
[0055] Figure 3 A schematic diagram of the working process of three intelligent agents in one embodiment;
[0056] Figure 4A schematic diagram of a process for arbitrating decision conflicts in a three-agent collaborative mechanism architecture according to one embodiment;
[0057] Figure 5 This is a structural block diagram of a multi-hop reasoning system of a temporal knowledge graph for the legal field in one embodiment;
[0058] Figure 6 This is an application architecture diagram of a temporal knowledge graph multi-hop reasoning system for the legal field in one embodiment;
[0059] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0061] The multi-hop reasoning method of temporal knowledge graph for the legal field provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Figure 1As shown, the application environment includes a computer device 110. The computer device 110 can collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between legal data and legal entities through semantic association technology, and build a weight table for each legal term to obtain a legal data knowledge system; the computer device 110 can perform multi-granularity time analysis based on the legal data knowledge system, extract the life cycle status of each legal provision, and introduce a legal conflict detection algorithm to obtain a set of legal entities with time limit annotations; the computer device 110 can use a reverse reference tracking mechanism and a time limit verification algorithm to construct an abolition propagation function, traverse the legal application relationship graph based on the abolition propagation function, set an abolition impact factor, and obtain a set of laws with abolition annotations; the computer device 110 can determine the uniqueness of the set of legal entities with time limit annotations and the set of laws with abolition annotations. The hot encoding vectors are fused to obtain a time embedding representation, and the time embedding representation is embedded into the nodes and relationships of the knowledge graph, and the elements of the clause conflict matrix are introduced to construct a temporal knowledge graph; the computer device 110 can adopt a path completion mechanism, build a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network, and integrate spatiotemporal features through the completion model to complete the path of the temporal knowledge graph; the computer device 110 can determine a time selection agent, a relationship selection agent, and an entity selection agent, use a reinforcement learning method to select the corresponding time, relationship, and entity, and design a reward function for each agent respectively, combine a dynamic priority strategy and a weight adaptive algorithm to build a collaborative arbitration mechanism for the three agents, and perform multi-hop reasoning based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion. Among them, the computer device 110 can be, but is not limited to, various personal computers, laptops, smart phones, robots, tablets and other devices.
[0062] In one embodiment, Figure 2 As shown in the figure, a multi-hop reasoning method for temporal knowledge graph in the legal field is provided, which includes the following steps:
[0063] Step 202 is to collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between legal data and legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system.
[0064] Computers can collect multi-source legal data to build a dynamically updated, multi-source, heterogeneous data collection system for the legal field. This multi-source legal data can include legal texts, judicial interpretations, government policies, typical cases, and related news. Using semantic association technology, dynamic mappings are established with the legal entities being queried by users, ensuring that the knowledge graph covers the latest legal developments.
[0065] The input data can be a set of data source URLs, API access credentials, or a user query entity list. After the data is input, the computer device performs a multi-source legal data collection operation. Next, the data source weight matrix W can be defined by the computer device. s ∈R n×3 ,The dimensions of the data source weight matrix represent authority (legislative level), update frequency (revision cycle), and association density (number of citations).
[0066] In this embodiment, the computer device can utilize a multi-source heterogeneous data fusion mechanism and build a dynamically updated legal data collection system based on semantic parsing technology enhanced by legal domain characteristics. This system uses a priority weight matrix to intelligently schedule data sources, and combines this with a hybrid architecture collection engine to uniformly acquire structured, semi-structured, and unstructured legal data.
[0067] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process for constructing a legal data knowledge system. The specific process includes: determining each legal data type; if the legal data type is structured data, it is retrieved through an API interface; if the legal data type is unstructured data, it is retrieved using a BERT-Legal model; if the legal data type is semi-structured data, it is retrieved based on XPath parsing; determining each legal entity based on the retrieved multi-source legal data, constructing a legal entity link matrix, and establishing a dynamic mapping relationship between legal data and legal entities through an improved TF-IDF algorithm and semantic similarity calculation; defining a weight matrix, constructing a weight table for each legal term based on the weight matrix, and calculating the priority of each legal term according to the weight table.
[0068] In this embodiment, the computer device can introduce legal entity association modeling technology, establishing a dynamic mapping relationship between the user's query legal entity and multi-source legal data through an improved TF-IDF algorithm and semantic similarity calculation. Simultaneously, the computer device can construct a legal term weight table, using α = 0.5, β = 0.3, and γ = 0.2 trained on judicial big data as domain-specific weight coefficients to ensure the authority, timeliness, and relevance of data collection. Ultimately, a multi-dimensional legal knowledge system covering legal provisions, judicial interpretations, government policies, typical cases, and related news is formed, providing high-quality data support for subsequent extraction of timeliness elements and dynamic abolition and dissemination.
[0069] Specifically, in this embodiment, when calculating the priority of each legal term, the calculation formula of the priority can be expressed as: Among them, α, β, and γ are weight coefficients trained by judicial big data, for example: α = 0.5, β = 0.3, γ = 0.2; s iRepresents the i-th data source, such as legal text database (such as Peking University Law Treasure), government policy website, judicial case database and other specific data sources; Authority (s i ) indicates the data source s i The authority of an organization is usually determined by the legislative level. For example, the legislative level of the Constitution and laws is higher than that of administrative regulations, and their authority scores are higher. i ) refers to the data source s i The update cycle, that is, the frequency of data update (such as daily, weekly, monthly, etc.). The reciprocal in the formula means that the shorter the update cycle (the higher the update frequency), the larger the corresponding value, and the higher the data source priority; CitationDensity(s i ) indicates the data source s i The association density is the number of times the legal provisions, cases, etc. in the data source are cited by other data. The more times the data source is cited, the higher the relevance and importance of the data source, and the higher the priority. The computer device can calculate the priority and use a dynamic crawling engine at the same time, using a hybrid architecture to achieve multimodal data collection. The computer device can determine the type of each legal data and determine whether the legal data type is structured data, semi-structured data or unstructured data. Among them, for structured data, JSON format provisions can be obtained through legal API interface calls, such as Peking University Law Treasure; for semi-structured data, government website announcements are parsed based on XPath; for unstructured data, the improved BERT-Legal model is used to parse news texts. After the crawling is completed, the target entity will be modeled for entity association. First, the legal entity link matrix M is constructed. e ∈R ∣V∣×∣D∣ , where V is the entity library and D is the document set.
[0070] When performing correlation or similarity calculations, the improved TF-IDF algorithm can be used. Compared with the standard TF-IDE algorithm, the improved TF-IDE algorithm adds a legal term weight table (LegalWeight) to give legal professional terms a higher weight. The formula is expressed as follows: Among them, LegalWeight(t) is the weight table of legal terms, for example, the weight of "judicial interpretation" is 1.2. After the correlation or similarity calculation, the final output is the structured legal document set D = {d1,...,d n}, with metadata (source, collection time, associated entities).
[0071] In step 204, multi-granularity time analysis is performed based on the legal data knowledge system to extract the life cycle status of each legal provision, and a legal conflict detection algorithm is introduced to obtain a set of legal entities with time-limit annotations.
[0072] In order to accurately extract the full life cycle status of legal provisions (promulgation / revision / repeal time) and establish a dynamic mapping of the time limit status and entity relationship, computer equipment can build a legal time limit feature parsing pipeline.
[0073] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process for extracting timeliness elements. The specific process includes: performing multi-granularity time analysis based on the legal data knowledge system, determining the promulgation time, effective time, and abolition mark of each legal article, and designing a legal time regular expression; defining the article timeliness status triple based on the legal time regular expression; setting a dynamic legal article abolition mechanism according to the article timeliness status triple; setting legal status transfer rules, and introducing a legal conflict detection algorithm to perform time logic verification on the legal articles to obtain verification results; marking the legal entities with timeliness according to the dynamic legal article abolition mechanism and the verification results to obtain a set of legal entities with timeliness markings.
[0074] Computer devices can use legal time-limit feature parsing technology to construct a multi-granularity time regular expression set based on the legal text representation paradigm to accurately extract the full life cycle status of legal provisions from "enactment-effectiveness-repeal". In this embodiment, the computer device defines the time-limit status triple of the provision (enactment time, revision time, and revocation flag) and combines it with a dynamic revocation propagation mechanism to achieve spatiotemporal continuity modeling of the legal effectiveness status. Next, the computer device can introduce a conflict detection algorithm to automatically verify the time logic of different versions of the legal provision (for example, the revision time cannot be earlier than the enactment time) to avoid logical contradictions in the time-limit status modeling. At the same time, the computer device can design a reverse propagation rule for the revocation effect. When the provision revocation flag δ = 1, it automatically traces back to all sub-clauses that reference the provision and updates the status of the related clauses based on the temporal relationship between the revocation time and the enactment time of the sub-clause. This effectively solves the problem of residual "zombie clauses" in the legal system and provides accurate time-limit feature annotation for subsequent knowledge graph reasoning.
[0075] Specifically, the computer device can perform multi-granularity time parsing on the input structured / semi-structured legal documents, design a legal time regular expression set RT, and cover the legal time expression paradigm:
[0076] Among them, R TThis is a set of multi-granularity time regular expressions for parsing time information in structured and semi-structured legal documents, covering common time representations in Chinese legal texts. The promulgation time matching rules are: \d{4} matches four digits (indicating the year, such as "2023"), \d{1,2} matches one to two digits (indicating the month or day, such as "5" or "05"), and (?:announce|release|publish) represents a non-capturing group, matching promulgation action keywords such as "announce" and "publish." For example, "Published on May 1, 2023" extracts the promulgation time as "2023-05-01."
[0077] The matching rules for effective time are as follows: "From the date of (?:announcement|publication)" matches "from the date of announcement" or "from the date of publication" (indicating that the effective time is the same as the promulgation date); "From\dyear\d{1,2}month\d{1,2}": matches situations where the effective date is explicitly specified (e.g., "from June 1, 2023"). The matching rules for revocation mark are as follows: (?:revocation|expiration): matches the keywords "revocation" or "expiration"; (?:from\d{4}year\d{1,2}month\d{1,2})?: an optional match used to capture the specific time of revocation (e.g., "revocation from December 31, 2023").
[0078] Then, the aging state model is carried out and the aging state triple S of the clause is defined as the set of si, s i =(t enact ,t revise ,δ), where tenact is the promulgation time, trevise is the last revision time, and δ∈{0,1} is the abolition flag (0 is valid, 1 is abolition). In addition, based on the three-state time attribute of legal provisions, computer equipment can design a dynamic abolition propagation mechanism and define the associated impact rules for the abolition of legal provisions. That is, when δ=1, the provision is abolitioned, and then all sub-clauses that reference the provision are searched. If the sub-clause is promulgated earlier than the abolition time, the sub-clause is automatically abolitioned, thereby solving the problem of invalidation of associated clauses caused by the abolition of legal provisions. Among them, the set state transition rules can be expressed as:
[0079]
[0080] To avoid logical errors such as "the revision time is earlier than the promulgation time", this embodiment designs a conflict detection method to perform time logic verification on different versions of the same law:
[0081]
[0082] Among them, S j Represents the validity status triple of the jth version of the same law. The final output is the legal entity set V with validity labelT ={(v i ,t ei ,t ri ,δ i )}.
[0083] Step 206: Use the reverse reference tracking mechanism and the time validity verification algorithm to construct a revocation propagation function, traverse the legal application relationship graph based on the revocation propagation function, set the revocation impact factor, and obtain a set of laws with revocation marks.
[0084] Computer equipment can build a transmission model for the effect of legal repeal, automatically update the repeal status of related clauses through reverse reference tracking and time verification, and solve the problem of "zombie clauses" in the legal system.
[0085] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process for marking the abolition of legal provisions. The specific process includes: using a reverse reference tracking mechanism and a time verification algorithm to construct an abolition propagation function, and determining the legal provision association impact rules based on the abolition propagation function; using breadth-first search to traverse the legal application relationship graph, identifying and updating the repealed legal provisions based on the legal provision association impact rules; setting a repeal impact factor according to the repealed legal provisions, and marking the legal provisions as repealed based on the abolition impact factor to obtain a set of laws with repeal annotations.
[0086] Computer equipment can build a dynamic propagation system for the abolition status of legal provisions based on the reverse reference tracking mechanism and time verification algorithm. Specifically, computer equipment can realize the multi-level transmission of the abolition effect of legal provisions by defining the abolition propagation function and the association influence rules, and automatically identify and update the status of sub-clauses that reference the abolition clauses. The dynamic mask mechanism and the abolition threshold trained by judicial big data are introduced (such as the correlation threshold > 0.6 triggers the abolition of all clauses), combined with the time window constraint condition (the promulgation time of the sub-clause is earlier than the abolition time), to accurately block the invalid legal path. At the same time, the termination conditions of the abolition propagation and the status update rules can also be designed to ensure the integrity and logical consistency of the transmission of the abolition effect, effectively solve the problem of residual "zombie clauses" in the legal system, and provide real-time updated abolition status annotations for knowledge graph reasoning.
[0087] Specifically, the computer device may first define an abolition propagation function, the expression of which is: in, v i The abolition time, e(v j →v i ) means v j Citation v i ; Then, the computer device can use breadth-first search (BFS) to traverse the legal reference relationship graph GR : For some of the abolition situations in the clauses, the abolition impact factors are designed: When ρ>0.6, all clauses are triggered to be abolished, otherwise the valid entries are retained, and the final output is the updated abolished state set E δ ′.
[0088] Step 208: Determine the one-hot encoding vectors of the legal entity set with time limit annotations and the legal set with repeal annotations and fuse them to obtain a time embedding representation, and embed the time embedding representation into the nodes and relationships of the knowledge graph, and introduce the clause conflict matrix elements to construct a temporal knowledge graph.
[0089] In order to effectively capture the impact of time information on the relationship between entities in the time series graph, and based on the characteristics of the legal knowledge graph, in this embodiment, legal timeliness-aware time embedding is proposed, which not only embeds time information into the nodes and relationships of the graph, but also integrates the three-state attributes of the legal provisions into the time vector, enhancing the time series perception ability of graph reasoning. Compared with the traditional single timestamp embedding, legal timeliness-aware time embedding can better improve the accuracy of legal provision update recognition.
[0090] The legal temporal knowledge graph is defined as a graph G = (V, E, T, S), where V is the entity set in the graph (legal subject, legal event, legal document, etc.), V = {v1, v2, ... v n}, each entity v i Corresponding to a node; E is the relationship set in the graph (rights and obligations, litigation relations, reference relations, etc.), E={e1,e2,...,e m}, each relation e j Indicates a semantic association between two entities; T is a time set, T = {t1, t2, ..., t k}, at each time point t i Used to represent the time information in the legal knowledge graph; S is the set of legal provisions’ time limit status, defining each entity v i The three-state property.
[0091] The computer device can construct a three-state time vector space that is aware of legal timeliness. By integrating the unique hot encoding vectors of the promulgation time, revision time, and abolition mark of the legal provisions, a time embedding representation with legal domain characteristics is generated. Specifically, the computer device can use the time embedding matrix W tContinuous modeling of the entire lifecycle of legal provisions is performed, incorporating a time decay function to quantify the strength of the provisions. Compared to traditional discrete timestamp methods, a dynamic repeal propagation mechanism enables a gradual representation of the legal effectiveness state, effectively capturing the effectiveness conflicts during the transition period between old and new laws. In sparse graph scenarios, the introduction of LSTM time series modeling technology to compensate for the time dimension of low-frequency entities (such as local regulations) can significantly improve the accuracy of cross-period legal retroactivity reasoning.
[0092] Specifically, in one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process of obtaining a time embedding representation. The specific process includes: determining a set of legal entities with time limits and a set of laws with repeal marks, and generating a time vector for each time point based on the set of legal entities with time limits; mapping the time vector through a time embedding matrix, and integrating the state attributes of the legal provisions into the time vector to obtain a time embedding representation.
[0093] The computer device can firstly i ∈T generates a time vector Through a time embedding matrix After mapping, the three-state attributes of the legal text are integrated into the time vector: t i =W t ·[OneHot(t enact );OneHot(t revise );δ]+b t ; Among them, OneHot(t i ) is t i The one-hot encoding vector of , d is the dimension of time embedding, W t ∈R 3d×d is the temporal embedding matrix, which is optimized through training; b t It is a bias vector used to introduce a learnable offset in the linear transformation of the time vector to improve the expressiveness of the model.
[0094] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process of introducing article conflicts. The specific process includes: embedding the time embedding representation into the nodes and relationships of the knowledge graph, generating a temporal relationship vector for each relationship; introducing article conflict matrix elements into the temporal relationship vector and the time embedding representation to construct a temporal knowledge graph.
[0095] In order to automatically avoid legal conflict scenarios such as "new common law and old special law", in this embodiment, legal conflict-aware relationship modeling can be introduced. For each relationship e j ∈E, generate a time series relationship vector for it This vector represents the temporal characteristics of the relationship within a specific time range; the temporal information of the relationship is modeled as a function f r , function f r It can be a mapping based on a deep neural network, learning how to fuse time information with relationship information, and then adjust the performance of the relationship at a specific time point; the input is the time vector t i and the relationship vector r j , and introduced the clause conflict matrix element C jk To perform legal conflict perception, we add a conflict detection factor to the relation embedding and output the enhanced temporal relation vector: r j (t i )=f r (r j ,t i )⊙(1-C jk ); among them, C jk The calculation method is: C jk =σ(MLP([v j ;v k ])·TimeDecay(|t j -t k ∣)), TimeDecay function is λ×e -γ|Δt| (γ=0.83 is the optimization parameter for the legal field). Through the above operations, legal conflict scenarios such as "new common law and old special law" can be automatically avoided.
[0096] Step 210, adopting the path completion mechanism, constructing a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network, and fusing spatiotemporal features through the completion model to complete the path of the temporal knowledge graph.
[0097] In the legal field, there are some missing paths in the temporal knowledge graph, which is mainly manifested as a sparsity problem. The sparsity is reflected in the fact that not all legal entities, legal events, and legal documents have direct relationship connections. However, the connection relationships or missing entities may be used when reasoning, and these relationships may change over time. Traditional graph reasoning methods ignore time information or cannot effectively process sparse temporal information, which affects the accuracy of the reasoning results. Therefore, in this embodiment, a path completion mechanism based on long short-term memory network (LSTM) and graph attention network (GAT) is designed, and an abolition-aware path gating mechanism and legal conflict attention modulation are introduced to automatically avoid the contradiction between the path of the abolished legal provisions and the application of the law.
[0098] Specifically, a path completion mechanism enhanced by legal characteristics can be adopted, and a spatiotemporal coupling completion model can be constructed based on the abolition-aware graph attention network (GAT) and long short-term memory network (LSTM). The dynamic mask function can automatically filter the association of invalid articles, and the case-driven joint probability model can be combined to achieve missing path prediction. Tongno introduced a legal effect attenuation function, using γ = 0.57 trained with judicial big data as a domain-specific attenuation coefficient, so that the probability of the relationship between the old articles after the promulgation of the new law decays exponentially. At the same time, a collaborative article-case completion mechanism is constructed, and the balance coefficient β is used to automatically filter the association between invalid articles and the old articles. b =0.68 Dynamically adjust the probability of knowledge graph completion and the weighted probability of case similarity to ensure the dual satisfaction of the "similar cases, same judgment" principle and the legal time limit characteristics.
[0099] Specifically, in one embodiment, a multi-hop reasoning method for a temporal knowledge graph oriented to the legal field is provided, which can also include a path completion process, the specific process including: based on a long short-term memory network, learning an embedded representation of the time status of each node and relationship in the temporal knowledge graph; based on a graph attention network, performing legal conflict modulation on the relationships in the temporal knowledge graph; setting a dynamic mask function to filter the associations of repealed legal provisions in the temporal knowledge graph, and constructing a spatiotemporal coupling completion model; based on the completion model, dynamically adjusting the completion probability and similarity weighted probability of the temporal knowledge graph through a balance coefficient to complete the path completion.
[0100] In order to perform multi-hop path reasoning, in this embodiment, we can first calculate the path of each node v in the graph. i ∈V and relation e j ∈E respectively learn the embedding representation. Assume that node v i The embedding representation is v i , relation e j The embedding representation is r j , we can first learn an embedding representation containing the timeliness status for each legal entity node vi: i =LSTM([e i base ;t i enact ;t i revise ; δ i ]); where e i base is the basic semantic embedding, t i enact To enact time embedding (through the time matrix W enact ∈R ∣T∣×d coding), t i revise is the last revision time embedding, δ i∈{0,1} is the abolished state indicator. Then, the relationship r j Legal conflict modulation is performed to perform conflict-aware relational embedding, the formula is: j (t) = GAT(r j base ,t)⊙(1-C jk ); for the relationship r j After embedding the legal conflict modulation, the triple representation of dynamic revocation propagation is further constructed. In this embodiment, a mask function mechanism is designed to accurately handle the effectiveness status of legal provisions. h and tail entity v t , whose triple represents c htr By linear transformation W c For the concatenated vector [v h ;v t ;Mask(r(t),δ h ,δ t )] to encode, that is: c htr =W c [v h ;v t ;Mask(r(t),δ h ,δ t )]; where the mask function is defined as: if and only if δ h = 0 (header entity is valid) and δ t = 0 (the tail entity is valid), retain the relation embedding r(t), otherwise set it to zero, that is: The function of the mask function is to automatically filter out invalid associations involving repealed provisions. Furthermore, the legal compliance attention mechanism introduces the compliance scoring function of the legislative law and improves the attention weight calculation. The calculation formula is: α htr =softmax(LeakyReLU(W b c htr )+0.83·ComplianceScore(h,t,r)); Among them, the compliance score is generated by quantifying the proportion of paths in the judicial case database that comply with the applicable legal rules, which significantly enhances the probability of generating a compliant path. Finally, in the node update stage, the abolition state gating technology is used to gradually decay the node embedding. The update formula is v i ′=σ(∑α htr c htr )·(1-δ i ), when the article is repealed (δ i =1), its embedded value will decay, which can preserve historical association information and avoid interference with current reasoning.
[0101] In this embodiment, the core of the path completion problem is to infer missing relations and paths. Assume that a partial known path P = (v1, e1, v2, e2, v3, ...) is given, where some relations e j and node v i The missing elements are unknown and need to be completed based on the existing information in the graph and the temporal reasoning model. In combination with the characteristics of the legal knowledge graph, this embodiment provides a case-driven joint probability model to build a completion mechanism that coordinates legal provisions and judicial cases, and completes the path by maximizing the joint probability of the path: Dynamically balanced knowledge graph completion probability P kg Weighted probability P of similarity with the case case , where β b Set to 0.68 to ensure that the completion accuracy is improved in scenarios such as labor contract disputes. At the same time, the legal effect attenuation function exp(-γ d (t-trevise)), with γ d =0.57 as a special attenuation coefficient in the legal field, so that the probability of the relationship between the old provisions will decay exponentially after the new law is promulgated, and the reinforcement factor λ = 0.83 is used to dynamically adjust the attenuation intensity. That is, Through the synergistic effect of the two technologies, the judicial principle of "similar cases, similar judgments" is guaranteed, and the timeliness characteristics of the legal system are accurately reflected.
[0102] Step 212: Determine the time selection agent, relationship selection agent, and entity selection agent, use the reinforcement learning method to select the corresponding time, relationship, and entity, and design a reward function for each agent respectively. Combined with the dynamic priority strategy and weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
[0103] When performing multi-hop path reasoning, the system must start from the current node and gradually reason towards the target node. Traditional graph reasoning methods are based on static path calculations, but in sparse time-series graphs, path selection and reasoning processes are highly uncertain. Therefore, this embodiment introduces reinforcement learning to dynamically adjust the path reasoning strategy.
[0104] Specifically, we can select a time selection agent, a relationship selection agent, and an entity selection agent to build a three-agent collaborative decision-making framework, which are responsible for time compliance verification, relationship confidence assessment, and entity attribute matching respectively. Through a three-dimensional reward function system, we can dynamically balance path diversity, temporal consistency, and semantic matching, and implant legal effectiveness hierarchical rules to optimize decision weights. Setting up a conflict arbitration mechanism can dynamically resolve decision-making contradictions through collaborative calculation (integrating time legitimacy, relationship logic, and entity matching), successfully resolve the vast majority of typical legal conflict scenarios, and ensure the unity of judicial decision-making in timeliness, logical consistency, and substantive fairness.
[0105] Computer devices can use a three-agent reinforcement learning method to optimize path selection strategies. The three agents are time selection agent, relationship selection agent, and entity selection agent. The roles of the agents are to select appropriate time, relationship, and entity respectively. Among them, the time selection agent and the relationship selection agent are unified into the attribute selection agent AS-Agent. The three-agent workflow is as follows: Figure 3 As shown, the temporal selection agent TS-Agent is represented as a quintuple (TS-S, TS-A, TS-P, TS-R, TS-π), representing the state, action, reward, and policy of the temporal selection agent, respectively. The reinforcement learning strategy used is a softmax strategy. This means that the agent uses a softmax function to calculate the probability of selecting each action based on the Q-value of the action, and then selects actions based on these probabilities. This allows for more balanced exploration and exploitation based on the relative magnitude of the Q-value. Similar to the temporal selection agent, the relation selection agent RS-Agent is represented as a quintuple (RS-S, RS-A, RS-P, RS-R, RS-π), representing the state, action, reward, and policy of the relation selection agent, respectively. Similarly, the entity selection agent ES-Agent is represented as (ES-S, ES-A, ES-P, ES-R, ES-π).
[0106] After determining the three agents, a reward function can be designed for each agent. First, the computer device can design a reward function for the time selection agent. Specifically, the computer device can design a basic reward for the time selection agent. When the agent successfully locates an entity directly related to the legal issue (such as a specific legal provision, judicial interpretation, etc.), it will be given a +1 reward. If it does not reach the target entity, it will still receive a certain reward to prevent the reward sparsity problem. The basic reward is: Among them, ComplianceScore is the compliance score based on legislative law (0-1), Similarity is the current entity e cThe semantic similarity with the query q (BERT + legal terminology library), StepPenalty is the path length penalty (linearly increasing when the number of steps > 5).
[0107] In order to prevent the agent from falling into a fixed reasoning mode, a diversity reward is set. It not only promotes the discovery of unpopular but relevant legal provisions, such as local regulations, but also enhances the adaptability to new cases. The formula is: Among them, Novelty(p i ) is the path novelty score, and the calculation formula is: By setting up path rewards to encourage concise and effective legal reasoning paths, avoid excessive citation of auxiliary provisions, and prioritize the formation of a golden path of "core provisions → judicial interpretations → guiding cases", the path rewards are: in, CoreLaws is the core legal library. For each core legal provision included, the path weight will increase by 0.3. It also has an abolition status gate: The total reward function of the time selection agent is: R TOTAL1 =λ1R BASE +λ2R PATH +λ3R DIVERSITY +λ4Valid(t).
[0108] Computer devices can design reward functions for relation selection agents. Among them, relation selection agents still have basic rewards, diversified rewards, and path rewards, which are consistent with the reward functions of time selection agents. When constructing entity rewards, first, for each entity e in the time knowledge graph, define its influence factor lable e ; When constructing the impact factor, the head entity e is found through the path-finding process h and tail entity e t All paths p between them are within a certain length limit and the number does not exceed the set maximum value N; then, the path confidence (such as compliance score) is introduced as a weight when calculating the impact factor to ensure that important paths contribute more to the reward; for each entity e, its impact factor lable e The specific calculation formula is: Then, the entity rewards R ENTITY The calculation method is Among them, number e represents the number of entities e in the current path; therefore, the total reward function formula of the relationship selection agent can be expressed as: R TOTAL2 =λ1R BASE +λ2R PATH +λ3R DIVERSITY +λ4RENTITY .
[0109] The computer device can also design an entity selection agent reward function. Among them, the entity selection agent reward is consistent with the relationship selection agent reward. The total reward function is also: R TOTAL3 =λ1R BASE +λ2R PATH +λ3R DIVERSITY +λ4R ENTITY ; The final reward function is: R TOTAL =ω1R TOTAL1 +ω2R TOTAL2 +ω3R TOTAL3 +ω4SemanticSimilarity(P); where SemanticSimilarity(P) is the semantic similarity of each entity and relationship in the path. Path reasoning must not only consider the temporal consistency of the relationship but also ensure that the semantics of each node (such as entity type, attributes, etc.) during the reasoning process are consistent with the inferred relationship.
[0110] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph for the legal field is provided, which may also include a process of constructing a three-agent collaborative arbitration mechanism. The specific process includes: using a reinforcement learning strategy to construct a three-agent three-agent game framework; combining a dynamic priority strategy and a weight adaptive algorithm to calculate the optimal action according to each establishment function, and judging whether there is a decision conflict among the three agents based on the optimal action; if there is a decision conflict, then calculating the degree of coordination, temporal similarity, and relationship similarity, and constructing a collaborative arbitration mechanism for conflict arbitration.
[0111] The three agents may encounter decision conflicts when making decisions. For example, in the typical case of "the retroactive effect of the new law on the cooling-off period for divorce", the time agent denied the applicability of the new law based on the principle of "no retroactive effect of the law", while the relationship agent advocated the continuity of legal application due to the strong correlation between the articles, and the entity agent needed to verify whether the facts of the case met the historical judgment standards. The cognitive conflicts in these three dimensions caused the traditional single-agent decision-making system to come to a deadlock. It is this cross-modal legal conflict scenario that highlights the key value of the collaborative arbitration mechanism: by constructing a three-dimensional game framework of temporal legality verification, relationship path confidence assessment and entity attribute matching, combined with dynamic priority strategies and weight adaptive algorithms, it can not only resolve 83% of typical legal contradictions such as cross-border jurisdiction conflicts and disputes over the connection between old and new laws, but also fundamentally guarantee the unity of judicial decision-making in the three dimensions of timeliness, logical consistency and substantive fairness. In order to resolve the conflicts among agents in decision-making, a three-agent collaborative mechanism is set up according to the characteristics of the legal field. The architecture of the three-agent collaborative mechanism is as follows: Figure 4 shown.
[0112] When the three agents do not encounter a decision conflict, the reward function value is directly output. When the agents encounter a decision conflict, they enter the collaborative arbitration stage for arbitration and then output the arbitration result.
[0113] Decision conflict occurs when the three agents (TS-Agent for time selection, RS-Agent for relationship selection, and ES-Agent for entity selection) choose different optimal actions or have irreconcilable conflicts in their reward calculations. These conflicts manifest as: Action space divergence: The optimal actions (time, relationship, and entity) calculated by the three agents based on their respective reward functions are mutually exclusive; and Q-value discrepancies: The expected rewards (Q-values) of the agents for the same action differ by more than a preset threshold.
[0114] Specifically, in this embodiment, when the optimal actions of the three agents meet the following conditions, the system determines that there is a conflict:
[0115]
[0116] Among them, a ts 、a rs 、a es are the optimal actions of time, relationship, and entity respectively, and ε is the Q-value threshold, which represents the lower limit of the agent's confidence in the action. The final joint reward function needs to integrate the independent contributions of the three agents and reflect the rigid constraints of the legal scenario through dynamic weight distribution. The formula is expressed as:
[0117] R TOTAL =ω1R TOTAL1 +ω2R TOTAL2 +ω3R TOTAL3 +ω4SemanticSimilarity(P)+δCconflict; where δCconflict is the conflict penalty term, which is activated when a decision conflict is detected (δ>0). When the decisions of the three agents trigger a conflict (for example, the actions are mutually exclusive and the Q values are all higher than the threshold ε), the penalty term is activated according to the following logic: Among them; K is the penalty coefficient, and the calculation formula of the coordination degree is: C collab =w1·S time +w2·S relation +w3·S entity ; Among them, w1, w2, w3 are the weights of time, relationship, and entity dimensions respectively, and S is the similarity component. Time similarity S time To measure the degree of overlap between the time dimension actions in the arbitration results and the original time decisions of the three agents, the calculation formula is: Among them, Time appliedTime is the set of time actions finally adopted in the arbitration result (such as the effective time range of the selected legal provisions). agents is the set of time actions decided independently by the three agents (such as the old time window recommended by the time agent). If the arbitration result highly overlaps with the time actions of the three agents (S time →1), indicating that the timeliness rule is fully respected; if the difference is large (S time →0), the timing legitimacy may be sacrificed.
[0118] Relationship similarity S relation It can be used to measure the logical consistency between the legal provisions association path in the arbitration result and the original relationship decision of the three agents. The calculation formula is: S relation =Cosine Similarity (Path applied ,Path agents ); Path applied Path for the legal provisions finally adopted by the arbitration mechanism; agents Represents the relationship path in the original decision of the three agents. The computer device can perform a weighted average (or directly add) of all the clause vectors in the path in order to generate the overall vector of the path: The calculation formula for cosine similarity is: If S relation If it is close to 1, it indicates that the arbitration result is highly consistent with the legal provisions of the original decision; if it is close to 0, it may break the internal correlation of the legal system (such as ignoring implied terms).
[0119] Entity similarity S entity To measure the degree of consistency between the entity attribute matching in the arbitration result and the original entity decision of the three agents, the calculation formula is: Among them, Entity applied Entity is the entity set finally adopted in the arbitration result; agents is the entity set of the three agents’ independent decision making; if S entity If it is higher, it means that the arbitration result is compatible with the historical judgment standards of entity attributes; if it is lower, it may introduce concepts outside the legal system.
[0120] In one embodiment, a multi-hop reasoning method for a temporal knowledge graph in the legal field is provided, which may also include a process of judicial interpretation and display. The specific process includes: obtaining multi-hop reasoning results, interpreting the legitimacy of the path and marking conflict points based on the multi-hop reasoning results, and performing visual display.
[0121] Generate explanatory content that conforms to legal logic and is easy to understand for the reasoning results, and be able to explain and visualize the reasoning results. The core goal is to solve the black box decision-making problem existing in the traditional judicial system, and to make the complex legal reasoning process transparent and structured through technical means to meet the legal procedure requirements for legitimacy, traceability and verifiability.
[0122] In this embodiment, the computer device can provide legal logic verification and explainability enhancement for the reasoning path generated by reinforcement learning. The first step is to interpret the legality of the path, which verifies the temporal validity and conflict avoidance logic of the nodes in the reasoning path based on the effectiveness hierarchy of legal provisions; the second step is to perform abductive reasoning reproduction, and generate a visual logical chain that conforms to judicial practice through the spatiotemporal coupling of case elements and legal relations; the last step is to mark conflict points and mark the legal basis for the dispute nodes that are arbitrated in multi-agent collaborative decision-making.
[0123] Specifically, first, the computer device can reason about the path Each edge in the is verified for legal validity and the legality score Scorelegal(r i ,t i ), the formula is: The hierarchical weight is assigned according to the legal effectiveness level (e.g., the constitutional provisions have a weight of 1.0, and administrative regulations have a weight of 0.8), and the timeliness is based on the three-state time vector v in the dynamic timeliness modeling. t = [promulgation, effectiveness, abolition] calculation clause at query time t q The effectiveness of is: The case matching degree is calculated by comparing the judgment results related to the current entity ei in the historical case library through cosine similarity. Then, the key path nodes are extracted based on the attention mechanism and a natural language explanation is generated. The formula is: The attention weight is calculated by the legal effect weight and temporal correlation of the nodes in the path, and the formula is: h ek is the entity embedding, v t is the time vector, W a is a trainable parameter and fills in the predefined legal logic template. Finally, the conflict node e in the arbitration decision conflict To mark, the formula is: ConflictNote(e conflict )=Superordinate law takes precedence(e conflict )∨Time Recency Principle (t conflict ).
[0124] If the conflicting nodes involve laws at different levels of effectiveness, the highest-level legal basis is annotated; if the laws are at the same level, the most recently effective clause is annotated. This example not only verifies the legitimacy of the reasoning path, but also generates a visual logical chain consistent with judicial practice. It also annotates the legal basis for disputed nodes in multi-agent collaborative decision-making, ensuring the interpretability and rigor of the reasoning results.
[0125] In another embodiment, a multi-hop reasoning method for temporal knowledge graphs in the legal field is provided. For example, a query is a legal consultation question, such as: What liability determination clause applies to a civil dispute between [start time] and [end time]? The multi-hop reasoning method in this embodiment mainly includes: query parsing with time constraints, path completion with spatiotemporal coupling, multi-agent collaborative reasoning on rewards and penalties, and generation of explainable results. Specifically:
[0126] In the query parsing stage of time constraints, first, based on the three-state attributes of legal provisions (promulgation / revision / repeal) output by the time factor extraction module, entity time verification is achieved by automatically filtering invalid entity nodes (such as repealed clauses), and at the same time, the conflict detection algorithm (such as checking "revision time ≥ promulgation time") is called to enforce time logic contradictions; secondly, the BERT-Legal model in the multi-source data acquisition module is used to parse the time modifiers in the user query (such as expressions such as "since 2020"), and construct dynamic time constraints to complete time window extraction; finally, the dynamic abolition propagation module is linked to predict the relationship path that may involve the "new common law vs. old special law" conflict, and the conflict arbitration mechanism is activated to predict relationship conflicts. The output result is a query subgraph containing valid entities, compliance relationships and time constraints, and potential legal conflict hotspots are marked;
[0127] Then, in the spatiotemporal coupled path completion stage, computer equipment can apply the abolition propagation model through a dynamic abolition mask mechanism, that is, based on the breadth-first search to traverse the legal text reference relationship graph, automatically shielding the reasoning path involving the abolition clause; further adopting the semantic combination embedding technology, the text effectiveness vector, the case feature vector and the time decay vector (γ = 0.57) are tensor-fused to solve the problem of the breakage of low-frequency entity paths such as regional regulations; at the same time, compliance verification is performed, and the legal hierarchy of the completed path is reviewed through the effectiveness hierarchy verification rules (Constitution>Laws>Administrative Regulations) (such as the compliance score > 0.8 under the principle of "superior law priority"), and finally outputting a complete path with a credibility score (in the range of 0-1), providing structured input for subsequent multi-agent reward and punishment collaborative reasoning.
[0128] In the multi-agent reward and punishment collaborative reasoning stage, the entity agent relies on the deep linkage of the multi-source data module and the judicial case database, and adopts the case element similarity matching algorithm (βb =0.68) verifies the entity attribute association, constructs a 768-dimensional case feature vector space through the BERT-Legal model, combines the improved cosine similarity algorithm to dynamically retrieve the Top-K similar cases, and triggers the judicial interpretation library to verify the legal status of new entities online. Based on the dynamic modeling module of legal effectiveness, the time agent applies the time decay function with the optimized parameter γ=0.83 to quantify the effectiveness of the provisions, and at the same time builds a three-state time window verification system to detect the continuity of the promulgation period, effective period, and abolition period of the reasoning path nodes. The relational agent uses an 8-head graph attention network (GAT) to construct a relationship confidence graph, and incorporates a dynamic abolition mask mechanism into the node update process. When the abolition mark δ=1 is detected, the invalid association is automatically blocked, and the legislative law conflict detection rule is implanted to give a 1.2 times weight gain to the relationship edge marked with "special provisions". The multimodal collaborative decision-making mechanism is implemented through a dynamic weight allocation algorithm (α time =0.4,α relation =0.35,α entity =0.25) to balance agent decision-making and construct a three-dimensional collaboration evaluation model (S = 0.7·time compliance + 0.2·logical relevance + 0.1·entity matching). The reinforcement learning framework uses a hierarchical reward function to drive multi-hop reasoning. The basic reward integrates the compliance score (0.5), case similarity (0.3), and path efficiency (0.2), combined with a path diversity reward and an ε-greedy dynamic exploration strategy (exponential decay from 0.5 to 0.1).
[0129] In the stage of generating explainable results, the time validity status of each node in the reasoning path is marked with a time legitimacy certificate; a conflict arbitration record is generated to display the dynamic changes in the weights of the three agents in the decision-making process and the basis for arbitration; a validity traceability map is constructed to visualize the impact of the revision history of the clauses on the current reasoning; at the same time, a hierarchical display strategy is adopted to output the reasoning results in a graded manner according to the core basis (weight>0.7) and auxiliary clauses (0.3<weight≤0.7), ensuring that the conclusion structure is highly consistent with the analysis logic of legal practitioners.
[0130] This application provides a multi-hop reasoning method for temporal knowledge graphs in the legal field. It adopts structured API + semi-structured XPath parsing + unstructured BERT-Legal model, combined with legal entity semantic association technology, to build a multi-dimensional data system covering legal provisions, cases, and policies. It dynamically schedules data sources through a priority weight matrix, and enhances semantic mapping based on an improved TF-IDF algorithm to ensure data authority, real-time and relevance, providing high-quality input for knowledge graphs; it designs a multi-granularity time regular expression set to accurately extract the full life cycle status of the provisions "enactment-effectiveness-repeal", and through the time-limited state triple modeling and conflict detection algorithm, combined with the dynamic abolition reverse conduction rule, automatically traces the associated sub-items of the repealed clauses and Update its status, eliminate logical contradictions in timeliness, and support the accurate identification of cross-period effectiveness conflicts; based on the reverse reference tracking model and breadth-first search (BFS) traversal algorithm, define the abolition propagation function and associated influence rules to realize the multi-level dynamic transmission of the abolition status, and combine the abolition threshold (ρ>0.6 triggers the abolition of all clauses) and time window constraints (the promulgation time of the sub-clause is earlier than the abolition time) trained by judicial big data. Through the dynamic mask mechanism, the invalid path is automatically filtered to solve the problem of residual sub-clauses caused by the abolition of the parent law, reduce the misuse rate of historical clauses to below the industry threshold, and ensure the rigor of reasoning; by constructing a three-state time vector space and a dynamic abolition propagation mechanism, break through the limitations of traditional timestamp modeling and realize the accurate characterization of the status of the entire life cycle of legal provisions. The system can automatically identify complex time-limit scenarios such as conflicts of legal retroactivity and the alternation of old and new laws, significantly improving the rigor of cross-period legal reasoning; the innovatively designed spatiotemporal coupling embedding technology combines the effectiveness of provisions, case elements and time decay factors into a tensor fusion, effectively solving the path break problem of long-tail entities such as regional regulations and new cases, and greatly improving the reliability of multi-hop reasoning under low-coverage knowledge graphs; the conflict arbitration mechanism based on the three-agent collaborative architecture successfully balances the decision-making weights of time compliance, logical relevance and entity matching, significantly reducing the decision-making contradiction rate of cross-level legal conflict scenarios, and ensuring the self-consistency of reasoning logic in emerging fields such as cross-border data compliance; constructing a three-dimensional reward system including effectiveness hierarchy rules and the principle of priority of special law The incentive function system is deeply embedded with a compliance scoring mechanism derived from legislative law, which effectively corrects the path selection bias of traditional reinforcement learning and significantly improves the decision-making accuracy of cross-jurisdictional legal conflicts; the designed dynamic abolition transmission model and legal conflict attention mechanism give the system the ability to continuously adapt to the evolution of the legal system. Through the extraction of spatiotemporal features, the system can quickly adapt to the knowledge graph construction needs of different legal systems and jurisdictions; the designed dynamic compliance scoring function and conflict arbitration annotation mechanism give the system the ability to dynamically adapt to the evolution of legal interpretation rules. Through a configurable rule engine and a hierarchical interpretation template library, it can quickly generate reasoning path analysis reports that conform to the interpretation paradigms of different legal systems, thereby improving the cross-jurisdictional compatibility and interpretation transparency of judicial decision-making logic.
[0131] It should be understood that, although the various steps in the above flow chart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above flow chart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0132] In one embodiment, Figure 5 As shown, a temporal knowledge graph multi-hop reasoning system for the legal field is provided, including: a multi-source data acquisition module 510, a time factor extraction module 520, a dynamic abolition propagation module 530, a legal effect determination module 540, a path completion module 550 and a collaborative strategy and multi-hop reasoning module 560, wherein:
[0133] Multi-source data collection module 510 is used to collect multi-source legal data, obtain various legal entities, establish dynamic mapping relationships between legal data and legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system;
[0134] The timeliness factor extraction module 520 is used to perform multi-granular time parsing based on the legal data knowledge system, extract the life cycle status of each legal provision, and introduce a legal conflict detection algorithm to obtain a set of legal entities with timeliness annotations;
[0135] Dynamic revocation propagation module 530, for constructing a revocation propagation function using a backreference tracking mechanism and a time validity verification algorithm, traversing the legal application relationship graph based on the revocation propagation function, setting revocation impact factors, and obtaining a set of laws with revocation annotations;
[0136] The legal effect determination module 540 is used to determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals, and fuse them to obtain a time embedding representation. The time embedding representation is then embedded into the nodes and relationships of the knowledge graph, and elements of the clause conflict matrix are introduced to construct a time series knowledge graph.
[0137] The path completion module 550 is used to adopt a path completion mechanism, build a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network, and integrate spatiotemporal features through the completion model to complete the path of the temporal knowledge graph;
[0138] The collaborative strategy and multi-hop reasoning module 560 is used to determine the time selection agent, the relationship selection agent, and the entity selection agent, use the reinforcement learning method to select the corresponding time, relationship, and entity, and design a reward function for each agent respectively. Combined with the dynamic priority strategy and the weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
[0139] In one embodiment, the multi-source data acquisition module 510 is also used to determine each legal data type. If the legal data type is structured data, it is retrieved through the API interface; if the legal data type is unstructured data, it is retrieved using the BERT-Legal model; if the legal data type is semi-structured data, it is retrieved based on XPath parsing; based on the retrieved multi-source legal data, each legal entity is determined, a legal entity link matrix is constructed, and a dynamic mapping relationship between legal data and legal entities is established through an improved TF-IDF algorithm and semantic similarity calculation; a weight matrix is defined, a weight table is constructed for each legal term based on the weight matrix, and the priority of each legal term is calculated according to the weight table.
[0140] In one embodiment, the timeliness factor extraction module 520 is also used to perform multi-granularity time analysis based on the legal data knowledge system, determine the promulgation time, effective time, and abolition mark of each legal article, and design a legal time regular expression; define the article timeliness status triple based on the legal time regular expression; set a dynamic legal article abolition mechanism according to the article timeliness status triple; set legal status transfer rules, and introduce a legal conflict detection algorithm to perform time logic verification on the legal article to obtain verification results; mark the legal entity with timeliness according to the dynamic legal article abolition mechanism and the verification results to obtain a set of legal entities with timeliness markings.
[0141] In one embodiment, the dynamic revocation propagation module 530 is also used to construct a revocation propagation function using a reverse reference tracking mechanism and a time verification algorithm, and determine the legal provision association impact rules based on the revocation propagation function; use breadth-first search to traverse the legal application relationship graph, identify and update the revoked legal provisions based on the legal provision association impact rules; set a revocation impact factor based on the revoked legal provisions, and mark the legal provisions as revoked based on the revocation impact factor to obtain a set of laws with revocation marks.
[0142] In one embodiment, the legal effect determination module 540 is also used to determine the one-hot encoding vectors of the set of legal entities with time limit labels and the set of laws with repeal labels, and generate a time vector for each time point based on the set of legal entities with time limit labels; map the time vector through the time embedding matrix, and integrate the state attributes of the legal provisions into the time vector to obtain a time embedding representation.
[0143] In one embodiment, the legal effect determination module 540 is also used to embed the time embedding representation into the nodes and relationships of the knowledge graph, and generate a temporal relationship vector for each relationship; introduce the clause conflict matrix elements into the temporal relationship vector and the time embedding representation to construct a temporal knowledge graph.
[0144] In one embodiment, the path completion module 550 is also used to learn the embedded representation of the time status of each node and relationship in the temporal knowledge graph based on the long short-term memory network; perform legal conflict modulation on the relationship in the temporal knowledge graph based on the graph attention network; set a dynamic mask function to filter the association of repealed legal provisions in the temporal knowledge graph, and construct a time-space coupled completion model; based on the completion model, dynamically adjust the completion probability and similarity weighted probability of the temporal knowledge graph through the balance coefficient to complete the path completion.
[0145] In one embodiment, the collaborative strategy and multi-hop reasoning module 560 is also used to use a reinforcement learning strategy to construct a three-dimensional game framework for three intelligent agents; combined with a dynamic priority strategy and a weight adaptive algorithm, the optimal action is calculated according to each establishment function, and based on the optimal action, it is determined whether there is a decision conflict among the three intelligent agents; if there is a decision conflict, the degree of collaboration, time similarity, and relationship similarity are calculated, and a collaborative arbitration mechanism is constructed to arbitrate the conflict.
[0146] In one embodiment, a temporal knowledge graph multi-hop reasoning system for the legal field may also include a judicial explainability generation module for obtaining multi-hop reasoning results, interpreting the path legality and marking conflict points based on the multi-hop reasoning results, and performing visual display.
[0147] In one embodiment, a temporal knowledge graph multi-hop reasoning system for the legal field can be applied to Figure 6 The illustrated architecture primarily includes data update pre-task processing, knowledge reasoning, and judicial explainability generation. Data update pre-task processing can include multi-source data collection, timeliness factor extraction, and dynamic revocation propagation. Knowledge reasoning can include dynamic modeling of legal effectiveness, dynamic evolution of spatiotemporal coupled knowledge graphs, and reinforcement learning modules for multi-agent collaborative decision-making and domain knowledge enhancement.
[0148] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, memory, network interface, display screen and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a multi-hop reasoning method of a temporal knowledge graph for the legal field is implemented. The display screen of the computer device can be a liquid crystal display or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0149] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of a multi-hop reasoning method of a temporal knowledge graph for the legal field are implemented.
[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a multi-hop reasoning method of a temporal knowledge graph for the legal field are implemented.
[0152] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0153] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0154] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A multi-hop reasoning method for temporal knowledge graphs in the legal field, characterized by: The method comprises: Collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between the legal data and the legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system; Based on the legal data knowledge system, multi-granularity time analysis is performed to extract the life cycle status of each legal provision, and a legal conflict detection algorithm is introduced to obtain a set of legal entities with time-limit annotations; A revocation propagation function is constructed using a reverse citation tracking mechanism and a time validity verification algorithm. Based on the revocation propagation function, a legal application relationship graph is traversed, and a revocation impact factor is set to obtain a set of laws with revocation annotations. Determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals, fuse them, and obtain a time embedding representation. This time embedding representation is then embedded into the nodes and relationships of the knowledge graph, and the elements of the clause conflict matrix are introduced to construct a temporal knowledge graph. A path completion mechanism is adopted to build a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network. The spatiotemporal features are integrated through the completion model to complete the path of the temporal knowledge graph. Determine the time selection agent, relationship selection agent, and entity selection agent, use reinforcement learning methods to select the corresponding time, relationship, and entity, and design reward functions for each agent respectively. Combined with dynamic priority strategy and weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
2. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: Collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between the legal data and the legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system, including: Determine the type of legal data. If the legal data type is structured data, retrieve it through the API interface; if the legal data type is unstructured data, retrieve it using the BERT-Legal model; if the legal data type is semi-structured data, retrieve it based on XPath parsing; Based on the retrieved multi-source legal data, each legal entity is identified, a legal entity link matrix is constructed, and a dynamic mapping relationship between the legal data and the legal entity is established through an improved TF-IDF algorithm and semantic similarity calculation; A weight matrix is defined, a weight table is constructed for each legal term based on the weight matrix, and a priority of each legal term is calculated according to the weight table.
3. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: Based on the legal data knowledge system, multi-granularity time parsing is performed to extract the lifecycle status of each legal provision. A legal conflict detection algorithm is introduced to obtain a set of legal entities with time-limit annotations, including: Based on the legal data knowledge system, multi-granularity time analysis is performed to determine the promulgation time, effective time, and abolition mark of each legal provision, and a legal time regular expression is designed; Defining a clause validity status triple based on the legal time regular expression; Setting up a dynamic legal provisions repeal mechanism based on the provisions’ validity status triples; Set up legal status transfer rules and introduce legal conflict detection algorithms to perform time logic verification on legal provisions to obtain verification results; According to the dynamic legal article abolition mechanism and the verification result, the legal entities are marked with time limits to obtain a set of legal entities with time limit marks.
4. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: A revocation propagation function is constructed using a reverse citation tracking mechanism and a time validity verification algorithm. Based on the revocation propagation function, the legal application relationship graph is traversed, and the revocation impact factor is set to obtain a set of laws with revocation annotations, including: Using a backreference tracking mechanism and a time validity verification algorithm to construct a revocation propagation function, and determining the legal provisions association impact rules based on the revocation propagation function; Using breadth-first search to traverse the legal application relationship graph, identifying and updating the abolished legal provisions based on the association and impact rules of the legal provisions; An abolition impact factor is set according to the abolition legal clause, and the legal clauses are marked as abolition based on the abolition impact factor to obtain a set of laws with abolition marks.
5. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: Determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals and fuse them together to obtain a temporal embedding representation, including: Determine a one-hot encoding vector of a set of legal entities with expiration marks and a set of laws with revocation marks, and generate a time vector for each time point based on the set of legal entities with expiration marks; The time vector is mapped through a time embedding matrix, and the state attributes of the legal provisions are integrated into the time vector to obtain a time embedding representation.
6. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: The time embedding representation is embedded into the nodes and relationships of the knowledge graph, and the clause conflict matrix elements are introduced to construct a temporal knowledge graph, including: Embed the time embedding representation into the nodes and relationships of the knowledge graph, and generate a temporal relationship vector for each relationship; The clause conflict matrix elements are introduced into the temporal relationship vector and the time embedding representation to construct a temporal knowledge graph.
7. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: A path completion mechanism is adopted to build a spatiotemporal coupled completion model based on the graph attention network and the long short-term memory network. The spatiotemporal features are integrated through the completion model to complete the path of the temporal knowledge graph, including: Based on the long short-term memory network, an embedding representation of the temporal state is learned for each node and relationship in the temporal knowledge graph; Based on the graph attention network, legal conflict modulation is performed on the relations in the temporal knowledge graph; Setting a dynamic mask function to filter the association of abolished legal provisions in the temporal knowledge graph, and constructing a spatiotemporal coupling completion model; Based on the completion model, the completion probability and similarity weighted probability of the temporal knowledge graph are dynamically adjusted through the balance coefficient to complete the path completion.
8. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: Combining dynamic priority strategies and weight adaptive algorithms, a collaborative arbitration mechanism is built for the three agents, including: Use reinforcement learning strategies to build a three-agent three-dimensional game framework; Combining a dynamic priority strategy and a weighted adaptive algorithm, the optimal action is calculated according to each of the established functions, and based on the optimal action, it is determined whether there is a decision conflict among the three intelligent agents; If there is a decision conflict, the coordination degree, time similarity and relationship similarity are calculated, and a collaborative arbitration mechanism is constructed to arbitrate the conflict.
9. The multi-hop reasoning method for temporal knowledge graphs in the legal field according to claim 1 is characterized in that: The method further comprises: Obtain multi-hop reasoning results, interpret path legitimacy and mark conflict points based on the multi-hop reasoning results, and perform visual display.
10. A temporal knowledge graph multi-hop reasoning system for the legal field, characterized by: The system comprises: A multi-source data acquisition module is used to collect multi-source legal data, obtain various legal entities, establish a dynamic mapping relationship between the legal data and the legal entities through semantic association technology, and construct a weight table for each legal term to obtain a legal data knowledge system; A timeliness factor extraction module is used to perform multi-granularity time analysis based on the legal data knowledge system, extract the life cycle status of each legal provision, and introduce a legal conflict detection algorithm to obtain a set of legal entities with timeliness annotations; A dynamic revocation propagation module is used to construct a revocation propagation function using a backreference tracking mechanism and a time validity verification algorithm, traverse the legal application relationship graph based on the revocation propagation function, set revocation impact factors, and obtain a set of laws with revocation annotations; The legal effect determination module is used to determine the one-hot encoding vectors of the set of legal entities with time limits and the set of laws with repeals, and fuse them to obtain a time embedding representation. The time embedding representation is then embedded into the nodes and relationships of the knowledge graph, and the elements of the clause conflict matrix are introduced to construct a time series knowledge graph. A path completion module is used to adopt a path completion mechanism, build a spatiotemporal coupled completion model based on a graph attention network and a long short-term memory network, and perform path completion on the temporal knowledge graph by fusing spatiotemporal features through the completion model; The collaborative strategy and multi-hop reasoning module is used to determine the time selection agent, relationship selection agent, and entity selection agent, use the reinforcement learning method to select the corresponding time, relationship, and entity, and design a reward function for each agent respectively. Combined with the dynamic priority strategy and weight adaptive algorithm, a collaborative arbitration mechanism is constructed for the three agents, and multi-hop reasoning is performed based on the collaborative arbitration mechanism and the temporal knowledge graph after path completion.
Citation Information
Cited By
Collaborative recommendation method and device fusing lightweight relation path completion and dynamic negative sampling, equipment and medium
CN120849721A
A collaborative recommendation method, apparatus, device, and medium integrating lightweight relation path completion and dynamic negative sampling.
CN120849721B
Intelligent reasoning knowledge base construction method based on knowledge graph
CN121119092A
Local legislation compliance intelligent detection system and method based on deep semantic analysis and multi-modal legal knowledge graph
CN121145925A
Knowledge graph-based self-interpretation multi-hop reasoning and dynamic optimization method and system
CN121189497A