Financial knowledge graph reasoning method and system based on multilayer path semantic modeling
Through the multi-layer path semantic modeling method, combined with single-path and multi-path semantic models, the problem of insufficient ability to capture complex semantic relationships in the existing technology is solved, and the inference accuracy and interpretability of financial knowledge graphs are significantly improved.
Patent Information
- Application Number
- CN202411469424.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-10
AI Technical Summary
Existing path-based knowledge graph completion methods have limitations in capturing complex semantic relationships and improving model inference accuracy, especially ignoring the interaction between multiple paths, and the process of path conversion into sentences may lead to semantic expressions. precise.
Using a multi-layer path semantic modeling method, combining single-path and multi-path semantic models, using semantic scoring functions and objective functions, extract semantic information of paths and subgraphs, and encoded through pre-trained language models to calculate semantic similarity to improve the model's reasoning ability.
It significantly improves the inference accuracy and interpretability of the model, can understand complex semantic relationships more effectively, and improves the completion accuracy and comprehensiveness of the financial knowledge graph.
Smart Images

Figure CN119294495A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph technology, and specifically to a financial knowledge graph reasoning method and system based on multi-layer path semantic modeling. Background Art
[0002] With the rapid development of the global financial market, financial institutions are facing increasingly complex and large data sets. These data cover a variety of categories such as market dynamics, customer transaction records, credit ratings, etc. With the rapid growth of data volume, the complexity of financial risk management continues to rise, and more intelligent and personalized solutions are urgently needed to deal with diverse risks. In this context, financial knowledge graphs, as an emerging technical means, have gradually become an important tool for financial risk management. By organically integrating scattered financial data into knowledge, financial knowledge graphs can reveal the relationships between multiple entities such as customers, assets, and markets, provide financial institutions with a comprehensive perspective to understand complex risks, and support more accurate risk assessment and management strategies.
[0003] In the process of building a financial knowledge graph, the path-based knowledge graph completion method has become an important means to solve data incompleteness. This method analyzes the known entities and relationships in the knowledge graph to deduce the missing entity or relationship information, thereby completing the financial knowledge graph. Specifically, the path completion method mines the connection path between the head entity and the tail entity in the financial knowledge graph, converts it into understandable semantic information, and uses the pre-trained language model for semantic matching, and finally infers new knowledge.
[0004] However, although the path-based knowledge graph completion method has alleviated the problem of missing data to a certain extent, current research still faces multiple challenges. First, most existing methods only focus on the semantic information of a single path, while ignoring the interactions between multiple paths, which limits the model's ability to capture complex semantic relationships. Secondly, the process of converting paths into sentences often relies on simple splicing strategies. Although such strategies are intuitive, they may lead to inaccurate semantic expressions and affect the accuracy of reasoning. Therefore, how to enhance the ability to understand complex semantics and improve the interpretability of the model while improving the accuracy of model reasoning is still an important problem that path-based knowledge graph completion methods need to solve. Summary of the invention
[0005] The purpose of the present invention is to provide a financial knowledge graph reasoning method and system based on multi-layer path semantic modeling to solve the problems existing in the above-mentioned prior art and break through the limitations of traditional knowledge graph completion algorithms.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A financial knowledge graph reasoning method based on multi-layer path semantic modeling, comprising the following steps:
[0008] Collect the financial knowledge graph to be inferred;
[0009] Construct a reasoning model based on multi-layer path semantics;
[0010] The reasoning model is used to complete the reasoning of the financial knowledge graph.
[0011] Preferably, the reasoning model includes: a single-path-based semantic model, a multi-path-based semantic model, a semantic score function, and an objective function;
[0012] The single-path-based semantic model is used to extract contextual semantics from the path of the financial knowledge graph;
[0013] The multi-path based semantic model is used to extract semantic association features between multiple paths from the sub-graph paths of the financial knowledge graph;
[0014] The semantic score function is used to add the path-level confidence score and the subgraph-level confidence score of the financial knowledge graph as a final score for reasoning;
[0015] The objective function is used to measure the difference between the model's prediction and the actual result, and is used for optimizing the inference model.
[0016] Preferably, the workflow of the single-path-based semantic model includes:
[0017] Extract the reasoning path between head and tail entities from the financial knowledge graph;
[0018] Convert the target triples of the reasoning path and the financial knowledge graph into description sentences using a conversion method based on distant supervision;
[0019] Encoding the description sentence using a pre-trained language model to generate a path context embedding representation;
[0020] The semantic similarity between paths is calculated as the path-level confidence score of the target triplet.
[0021] Preferably, the workflow of the multi-path based semantic model includes:
[0022] Retrieve similar triplets from the financial knowledge graph and extract a subgraph of all triplets;
[0023] Use topological features to initialize the features of nodes and edges in the subgraph;
[0024] Utilize graph attention network to encode subgraphs to generate subgraph context embedding representations;
[0025] The semantic similarity between subgraphs is calculated as the subgraph-level confidence score of the target triplet.
[0026] Preferably, the hinge loss function is used as the objective function, and the formula includes:
[0027] L=[S p (T i )-S p (T i '))+γ] +
[0028] Where L represents the hinge loss function; S p (T i ) represents a positive triple T i The final semantic score of S p (T i ') represents a negative triple T i 'The final semantic score; γ represents a hyperparameter.
[0029] The present invention also provides a financial knowledge graph reasoning system based on multi-layer path semantic modeling, the system is used to implement the above method, including: a collection module, a construction module and a reasoning module;
[0030] The acquisition module is used to acquire the financial knowledge graph to be inferred;
[0031] The building module is used to build a reasoning model based on multi-layer path semantics;
[0032] The reasoning module is used to complete the reasoning of the financial knowledge graph using the reasoning model.
[0033] Preferably, the reasoning model includes: a single-path-based semantic model, a multi-path-based semantic model, a semantic score function, and an objective function;
[0034] The single-path-based semantic model is used to extract contextual semantics from the path of the financial knowledge graph;
[0035] The multi-path based semantic model is used to extract semantic association features between multiple paths from the sub-graph paths of the financial knowledge graph;
[0036] The semantic score function is used to add the path-level confidence score and the subgraph-level confidence score of the financial knowledge graph as a final score for reasoning;
[0037] The objective function is used to measure the difference between the model's prediction and the actual result, and is used for optimizing the inference model.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] 1. A joint semantic modeling framework is proposed to comprehensively evaluate the confidence of triples from two levels of path context semantics.
[0040] 2. A path conversion method based on remote supervision is proposed, which significantly enhances the ability of the pre-trained language model to understand path semantics.
[0041] 3. Multiple experiments were conducted on benchmark datasets, and the results showed that joint semantic modeling can effectively improve the reasoning ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 A schematic diagram of a method flow of an embodiment of the present invention;
[0044] Figure 2 is a structural block diagram of a method according to an embodiment of the present invention;
[0045] Figure 3 Schematic diagram of comparative experimental accuracy of an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] It should be understood that the terms described in the present invention are only for describing special embodiments and are not intended to limit the present invention. In addition, for the numerical range in the present invention, it should be understood that each intermediate value between the upper and lower limits of the scope is also specifically disclosed. Each smaller range between the intermediate value in any stated value or stated range and any other stated value or intermediate value in the described range is also included in the present invention. The upper and lower limits of these smaller ranges can be independently included or excluded in the scope.
[0049] Unless otherwise indicated, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which the invention belongs. Although the present invention describes only preferred methods and materials, any methods and materials similar or equivalent to those described herein may also be used in the implementation or testing of the present invention. All documents mentioned in this specification are incorporated by reference to disclose and describe the methods and / or materials related to the documents. In the event of a conflict with any incorporated document, the content of this specification shall prevail.
[0050] It will be apparent to those skilled in the art that various modifications and variations may be made to the specific embodiments of the present invention description without departing from the scope or spirit of the present invention. Other embodiments derived from the present invention description will be apparent to those skilled in the art. The present application description and examples are exemplary only.
[0051] The words “include,” “including,” “have,” “contain,” etc. used in this document are open-ended terms, meaning including but not limited to.
[0052] Unless otherwise specified, the "parts" described in the present invention are all based on mass parts.
[0053] Embodiment 1
[0054] like Figure 1 FIG. 1 is a schematic diagram of the method flow of this embodiment, and the steps include:
[0055] S1. Collect the financial knowledge graph to be inferred.
[0056] S2. Construct a reasoning model based on multi-layer path semantics.
[0057] In this embodiment, the reasoning model includes: a single-path-based semantic model, a multi-path-based semantic model, a semantic score function, and an objective function.
[0058] The workflow of each part of the reasoning model in this embodiment will be described in detail below.
[0059] The single-path-based semantic model is used to extract contextual semantics from the paths of the financial knowledge graph. The workflow includes: extracting the reasoning path between the head and tail entities from the financial knowledge graph; converting the reasoning path and the target triples of the financial knowledge graph into description sentences using a distant supervision-based conversion method; encoding the description sentences using a pre-trained language model to generate a path context embedding representation; and calculating the semantic similarity between paths as the path-level confidence score of the target triples.
[0060] Specifically, first, the paths between the head entity and the tail entity in the financial knowledge graph are extracted, and these paths are sorted and filtered to ensure their accuracy and effectiveness. Subsequently, the network converts the filtered paths and triples into contextual description sentences to achieve the transformation of structured knowledge into natural language text. Next, these sentences are encoded using a pre-trained language model to capture their contextual semantic information, and the confidence of the triples is evaluated by calculating semantic similarity, thereby ensuring the semantic accuracy and reliability of the selected triples.
[0061] For the target triple (e h , r m , e t ), this embodiment first adopts a breadth-first search strategy to extract e from the training set (or test set) h and e t Multiple paths between them can effectively reflect the logical relationship between them. Then, this embodiment designs a conversion strategy based on remote supervision, aiming to effectively utilize real-world knowledge to enhance contextual semantics. This method is based on the assumption of remote supervision, that is, "if a sentence contains entities in a knowledge path, then it can convey the meaning of the path." Subsequently, based on this assumption, the present invention extracts relevant sentences from an external resource library as description sentences of the path.
[0062] After converting the paths into sentences, the pre-trained language model BERT is used to encode these sentences to generate contextual semantic representations. Given any path p q , the encoding process can be expressed as:
[0063]
[0064] Among them, p q represents any path between the head and tail entities; E represents the path p after BERT encoding q The embedded representation of .
[0065] Finally, cosine similarity is used to measure the semantic similarity between the target triple and the path. The specific calculation formula is as follows:
[0066]
[0067] in, represents the path-level contextual semantic embedding of the target triplet generated by BERT, Indicates e h and e t Any path P between iNext, the similarity score between the contextual semantic embedding of each path and the path-level contextual semantic embedding of the target triple is calculated, and the highest score is taken as the path-level confidence score of the triple.
[0068] The multi-path based semantic model is used to extract semantic association features between multiple paths from the subgraph paths of the financial knowledge graph. The workflow includes: extracting the reasoning path between the head and tail entities from the financial knowledge graph; converting the reasoning path and the target triple of the financial knowledge graph into a description sentence using a distant supervision-based conversion method; encoding the description sentence using a pre-trained language model to generate a path context embedding representation; and calculating the semantic similarity between the paths as the path-level confidence score of the target triple.
[0069] Specifically, the network first extracts closed subgraphs around the target triple and its similar triples from the financial knowledge graph. Subsequently, unreliable subgraphs are removed using statistical methods based on relationship sequences to improve the quality and reliability of the subgraphs. After the subgraph screening is completed, this embodiment uses a graph attention network to encode these subgraphs to generate high-quality embedded representations. In addition, a contrastive learning method is used to further optimize these embedded representations. Finally, the target triples are comprehensively scored from a global context perspective by calculating the semantic similarity between subgraphs.
[0070] For the target triple (e h , r m , e t ), first retrieve the inclusion relation r from the training set or test set m The triples of the target nodes are selected as similar triples. Then, a subgraph of all similar triples and target triples is extracted from the financial knowledge graph. The specific steps are as follows: First, the 3-hop neighbors of each target node (head entity and tail entity) are extracted respectively. Next, the intersection of these two neighbor sets is calculated. Finally, any isolated nodes or nodes that are more than 3 hops away from any target node are removed. To prevent the leakage of target relationship information, the target relationship between the head entity and the tail entity in the subgraph will be deleted.
[0071] Subsequently, a topology-based encoding method is used to initialize the features of the entity nodes in the subgraph. For each node in the subgraph, the shortest distance to the target head entity and tail entity is calculated, and two vectors are generated by applying one-hot encoding to these distances. Subsequently, these two vectors are connected to form the initial vector of the node. In terms of relation encoding, this embodiment directly retrieves the concept text of each relation in the subgraph from an external corpus through regularized matching. Then, these texts are encoded using a pre-trained language model as the initial vector of the relation.
[0072] Then, this embodiment uses the attention mechanism to effectively aggregate neighbor information. The mechanism is a multi-layer feedforward neural network used to learn the importance of different neighbor information to the target entity and its relations. For a given entity e c and its neighbor relationship entity pair (r y , e x ), the attention mechanism is defined as follows:
[0073]
[0074]
[0075] in, Represents an entity pair with an adjacency relationship (r y , e x ) for the k-th layer node e c The importance of; ⊙ represents the Hadamard product; and represents the initialization feature generated in the previous step, W and b represent the weight and bias of the fully connected layer respectively. In order to compare the importance of each neighbor node, this embodiment uses the softmax function to normalize the importance of all neighbor nodes:
[0076]
[0077] in, Indicates e c Given these normalized attention weights, the model applies a linear transformation to the target entity, converting the input features into higher-level features, and then performs a summation operation to obtain the entity e c The final representation at the (k+1)th layer:
[0078]
[0079] Finally, a global-level complete contextual semantic representation of the subgraph is obtained by average pooling all nodes.
[0080] In order to evaluate the semantic relevance between the similar case subgraph and the target triple subgraph, this embodiment adopts the cosine similarity method, which is specifically defined as follows:
[0081]
[0082] in, and The subgraph embedding representations of the target triplet and any similar triplet are represented respectively. Next, the similarity score between the subgraph embedding representation of each similar triplet and the subgraph embedding representation of the target triplet is calculated, and the highest score is taken as the subgraph-level confidence score of the triplet.
[0083] The semantic score function is used to add the path-level confidence score and subgraph-level confidence score of the financial knowledge graph as the final score of the target triplet for reasoning.
[0084] The objective function is used to measure the difference between the model's prediction and the actual result, and is used to optimize the inference model. Specifically, the hinge loss function is used as the objective function, and the formula includes:
[0085] L=[S p (T i )-S p (T i ')+γ] +
[0086] Where L represents the hinge loss function; S p (T i ) represents a positive triple T i The final semantic score of S p (T i ') represents a negative triple T i '; γ represents a hyperparameter. The negative sample triples are generated by randomly replacing the head entity or tail entity in the positive sample with other entities.
[0087] S3. Use the reasoning model to complete the reasoning of the financial knowledge graph.
[0088] Finally, the reasoning model is used to complete the reasoning of the financial knowledge graph. The method structure diagram of this embodiment is as follows: Figure 2 shown.
[0089] Embodiment 2
[0090] In order to verify the superiority of the present invention over the prior art, a comparative experiment is specially set up in this embodiment.
[0091] (1) Dataset
[0092] Experiments were conducted with different baseline models on three datasets of different sizes:
[0093] The WN18RR, FB15k-237, and NELL-995 datasets are benchmark datasets for knowledge graph reasoning experiments, where the entities in the test set are new entities that have not appeared in training. The specific properties of the three datasets are shown in Table 1:
[0094] Table 1
[0095]
[0096] Where train and Test represent the training set and test set respectively, Relations, Entities and Triplets represent relations, entities and triples respectively.
[0097] (2) Comparison method
[0098] The present invention is compared with rule-based, subgraph-based and path-based methods respectively, specifically including:
[0099] 1) Neural LP: This is an end-to-end model that combines neural networks with logical reasoning. It can automatically learn and optimize the parameters and structure of rules to achieve differentiable logical reasoning.
[0100] 2) RuleN: This model approximates the confidence of path rules through random sampling, thereby discovering longer and more complex reasoning paths and improving the accuracy of logical reasoning.
[0101] 3) DRUM: This model combines logical rule learning and low-rank tensor decomposition, and uses graph neural networks to transmit information in multi-relational reasoning tasks and effectively evaluate the confidence of reasoning rules.
[0102] 4) KG-BERT: By pre-training the language model to encode and score the one-hop path in the knowledge graph, KG-BERT can effectively process and reason about the path information and improve the efficiency of inductive reasoning.
[0103] 5) GraIL: This is a subgraph-based reasoning method that can infer the relationship between target nodes by extracting closed subgraphs, initializing node features, and using graph neural networks to propagate information, thereby significantly enhancing the flexibility and accuracy of reasoning.
[0104] (3) Performance comparison with other algorithms on four datasets
[0105] Figure 3 The accuracy comparison of this algorithm and other algorithms on three data sets is shown. It can be seen that the results of the algorithm on the data sets are significantly better than those of other algorithms.
[0106] From the results, it can be seen that the algorithm comprehensively scores the triples by combining the two dimensions of path semantic similarity and subgraph semantic similarity, thereby surpassing all compared baseline models in performance. Compared with baseline models such as NeuralLP and RuleN, the algorithm can not only capture diverse semantic information more effectively, but also improve the accuracy and generalization of reasoning. In logical reasoning tasks, models such as KG-BERT and GraIL mainly focus on the modeling of single semantic information, while the algorithm significantly improves the comprehensiveness and interpretability of reasoning through a multi-dimensional comprehensive scoring mechanism. Therefore, whether in the processing of path or subgraph semantics, the algorithm has shown better results, proving its superiority in complex relational reasoning tasks.
[0107] Embodiment 3
[0108] This embodiment also provides a financial knowledge graph reasoning system based on multi-layer path semantic modeling, including: an acquisition module, a construction module and a reasoning module; the acquisition module is used to acquire the financial knowledge graph to be reasoned; the construction module is used to construct a reasoning model based on multi-layer path semantics; the reasoning module is used to use the reasoning model to complete the reasoning of the financial knowledge graph.
[0109] Among them, the reasoning model includes: a single-path-based semantic model, a multi-path-based semantic model, a semantic scoring function and an objective function; the single-path-based semantic model is used to extract contextual semantics from the path of the financial knowledge graph; the multi-path-based semantic model is used to extract semantic association features between multiple paths from the subgraph paths of the financial knowledge graph; the semantic scoring function is used to add the path-level confidence score and the subgraph-level confidence score of the financial knowledge graph as the final score for reasoning; the objective function is used to measure the difference between the model's prediction and the actual result, and is used to optimize the reasoning model.
[0110] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A financial knowledge graph reasoning method based on multi-layer path semantic modeling, characterized in that the steps include: Collect the financial knowledge graph to be inferred; Construct a reasoning model based on multi-layer path semantics; The reasoning model is used to complete the reasoning of the financial knowledge graph.
2. The financial knowledge graph reasoning method based on multi-layer path semantic modeling according to claim 1 is characterized in that: The reasoning model includes: a single-path-based semantic model, a multi-path-based semantic model, a semantic score function and an objective function; The single-path-based semantic model is used to extract contextual semantics from the path of the financial knowledge graph; The multi-path based semantic model is used to extract semantic association features between multiple paths from the sub-graph paths of the financial knowledge graph; The semantic score function is used to add the path-level confidence score and the subgraph-level confidence score of the financial knowledge graph as a final score for reasoning; The objective function is used to measure the difference between the model's prediction and the actual result, and is used for optimizing the inference model.
3. The financial knowledge graph reasoning method based on multi-layer path semantic modeling according to claim 2 is characterized in that: The workflow of the single-path semantic model includes: Extract the reasoning path between head and tail entities from the financial knowledge graph; Convert the reasoning path and the target triple of the financial knowledge graph into a description sentence using a conversion method based on distant supervision; Encoding the description sentence using a pre-trained language model to generate a path context embedding representation; The semantic similarity between paths is calculated as the path-level confidence score of the target triplet.
4. The financial knowledge graph reasoning method based on multi-layer path semantic modeling according to claim 2 is characterized in that: The workflow of the multi-path based semantic model includes: Retrieve similar triplets from the financial knowledge graph and extract a subgraph of all triplets; Use topological features to initialize the features of nodes and edges in the subgraph; Utilize graph attention network to encode subgraphs to generate subgraph context embedding representations; The semantic similarity between subgraphs is calculated as the subgraph-level confidence score of the target triplet.
5. The financial knowledge graph reasoning method based on multi-layer path semantic modeling according to claim 2 is characterized in that: The hinge loss function is used as the objective function, and the formula includes: L=[S p (T i )-S p (T′ i )+γ] + Where L represents the hinge loss function; S p (T i ) represents a positive triple T i The final semantic score of S p (T' i ) represents a negative triple T' i The final semantic score of ; γ represents a hyperparameter.
6. A financial knowledge graph reasoning system based on multi-layer path semantic modeling, the system being used to implement the method described in any one of claims 1 to 5, characterized in that: include: Acquisition module, construction module and reasoning module; The acquisition module is used to acquire the financial knowledge graph to be inferred; The building module is used to build a reasoning model based on multi-layer path semantics; The reasoning module is used to complete the reasoning of the financial knowledge graph using the reasoning model.
7. The financial knowledge graph reasoning system based on multi-layer path semantic modeling according to claim 6 is characterized in that: The reasoning model includes: a semantic model based on a single path, a semantic model based on multiple paths, a semantic score function and an objective function; The single-path-based semantic model is used to extract contextual semantics from the path of the financial knowledge graph; The multi-path based semantic model is used to extract semantic association features between multiple paths from the sub-graph paths of the financial knowledge graph; The semantic score function is used to add the path-level confidence score and the subgraph-level confidence score of the financial knowledge graph as a final score for reasoning; The objective function is used to measure the difference between the model's prediction and the actual result, and is used for optimizing the inference model.
Citation Information
Cited By
Knowledge graph-based semantic association and logic rule reasoning method
CN120011368A
A knowledge graph-based semantic association and logical rule inference method
CN120011368B
Uncertain knowledge graph reasoning method based on rule mining
CN120104809A
Digital RMB related data processing method and device based on large model technology
CN120256646A