Dynamic Relationship Prediction Method and Device for Financial Risk Knowledge Graph
Through the KGANN model and unsupervised learning method, combined with the enterprise risk database and retrieval strategy, the problem of frequent relationship updates in the financial risk knowledge graph is solved, real-time relationship updates and knowledge graph completeness are achieved, and the quality of AI services is improved.
Patent Information
- Application Number
- CN202211279273.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-10-19
AI Technical Summary
Relationships in the financial risk knowledge graph are frequently updated, and existing methods are difficult to adapt to dynamic changes, resulting in incomplete knowledge graphs and affecting the quality of AI services.
The KGANN model is used for dynamic relationship prediction, and real-time relationship update is achieved by building enterprise risk database, knowledge graph vectorization, hidden layer structure extraction and unsupervised learning. The model is trained using early stop strategy, and combined with search strategies for dimensions such as enterprise scale, attention and risk, etc.
It has achieved timely updates of relationships in the financial risk knowledge graph, improved the completeness of the knowledge graph and the quality of AI services, and reduced the cost of manpower labeling.
Smart Images

Figure CN115658892B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of knowledge graph relationship recognition, and in particular, to a dynamic relationship prediction method and device for financial risk knowledge graphs. Background Art
[0002] Amidst the rapid development of the global internet, financial data continues to accumulate online, providing new data sources and perspectives for preventing financial risks. However, the vast amount of financial data on the internet is multi-source and heterogeneous, making it difficult to effectively utilize. Efficiently describing structured facts in the financial sector and leveraging this knowledge to generate value has become a hot topic. In the construction of financial risk knowledge graphs, datasets struggle to cover all domain knowledge, resulting in incompleteness in most knowledge graphs. This incompleteness hinders the improvement of AI service quality. The frequent occurrence of equity transactions, corporate mergers and acquisitions, and changes in actual controllers in the financial industry has led to relatively static entities in financial risk knowledge graphs, but frequently updated relationships. Static relationships are difficult to adapt to the ever-changing real world, making it difficult for upper-level applications to meet user needs. Related methods typically infer new relationships based on existing knowledge in the knowledge graph, making it difficult to continuously update relationships within the knowledge graph. Therefore, developing a dynamic relationship prediction method and device for financial risk knowledge graphs that can effectively overcome the shortcomings of these related technologies has become a pressing technical challenge in the industry. Summary of the invention
[0003] In response to the above-mentioned problems existing in the prior art, an embodiment of the present invention provides a dynamic relationship prediction method and device for financial risk knowledge graph.
[0004] In a first aspect, an embodiment of the present invention provides a dynamic relationship prediction method for a financial risk knowledge graph, including: Step S1, collecting, preprocessing, and partitioning a data set; Step S2, constructing an enterprise risk database, which is constructed by domain experts using a seven-step method and includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; Step S3, constructing an enterprise risk knowledge graph, and constructing an enterprise risk knowledge graph in a top-down manner based on the enterprise risk database; Step S4, vectorizing the knowledge graph, training the knowledge contained in the knowledge graph using the TransE model, and using the obtained TransE model to convert the knowledge in the form of triples into knowledge vectors; Step S5, obtaining a hidden layer structure, extracting the domain knowledge graph structure according to the library hierarchy, and using this structure as the hidden layer structure of the subsequent neural network model; Step S6, constructing a KGANN model, which includes an input layer, a hidden layer, and an output layer; the input layer is responsible for converting the input corpus into word vectors, taking the data set obtained in Step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in Step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors, and relationship vectors. The hidden layer neurons contain named entity vectors, and the connections between the hidden layers are replaced by relationship vectors. During the training of the model, the connections between the hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more conform to the current semantic information; the output layer includes a fully connected layer and a function implementation layer. The fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing word in the cloze task and outputting the word with the highest probability; Step S7, training the KGANN model constructed in S6 using the data set. To prevent overfitting, use the early_stopping strategy for training until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; Step S8, analyzing the connection matrix in the KGANN model, calculating the semantic similarity between different relationships and real relationships, and obtaining a new relationship through calibration.
[0005] Based on the content of the above method embodiments, the dynamic relationship prediction method for the financial risk knowledge graph provided in the embodiments of the present invention. The data collection in step S1 includes a retrieval strategy, which assigns different retrieval interval durations to different enterprises. The retrieval strategy divides enterprises into three categories, namely I, II, and III, through three dimensions: enterprise scale, enterprise attention, and enterprise risk. The indicators of each dimension are divided into three categories: A, B, and C. Among them, the enterprise scale division standard is based on the "Statistical Classification of Large, Medium, and Small Enterprises" announced by the National Bureau of Statistics. Large enterprises are the first category A, medium-sized enterprises are the first category B, and small and micro enterprises are the first category C. The enterprise attention is divided according to the number of reads of the enterprise's posts on the stock bar. Enterprises with the top 30% of the reading quantity are the second category A, enterprises with the reading quantity ranking between 30% - 70% are the second category B, and enterprises ranking in the last 30% and lacking corresponding enterprise information on the stock bar are the second category C. The enterprise risk is divided according to the total number of its own risks, associated risks, historical risks, and sensitive public opinions recorded by Qichacha. When the total risk ranking is in the top 30% of the enterprises, they are the third category A, when the total risk ranking is between 30% - 70%, they are the third category B, and when ranking in the last 30% and lacking corresponding enterprise information, they are the third category C. Large-scale enterprises have a greater impact on the financial system when they make property pledges, major share transactions by the actual controller, etc., so they need to be discovered and identified in a timely manner. When an enterprise has a high degree of attention, more investors conduct equity transactions with the enterprise. At this time, the enterprise information needs to be updated in a timely manner to prevent risks and maintain market confidence. When an enterprise itself has more risk events, it needs to be strengthened in supervision. When two or more of the indicators of enterprise scale, enterprise attention, and enterprise risk are category A, then the enterprise is a category I enterprise. When all three dimension indicators are category C, then the enterprise is a category III enterprise, and the remaining enterprises are all category II enterprises. The retrieval interval durations for category I enterprises, category II enterprises, and category III enterprises are every hour, every day, and every week respectively.
[0006] Based on the content of the above method embodiments, the dynamic relationship prediction method for the financial risk knowledge graph provided in the embodiments of the present invention. The calculation methods of the hidden layers in steps S5 and S6 of deep learning are as shown in Equation (1):
[0007] y i = f(E i + R i ) (1)
[0008] Among them, E i is the i-th named entity part, R i is the i-th connection part, and f(x) is the activation function, which is used to introduce non-linear factors to improve the learning ability and robustness of the model. The calculation process of E i is as shown in Equation (2):
[0009]
[0010] Among them, x j is the j-th word vector of the input, and n is the number of neurons in layer E i e i is the named entity vector contained in the i-th neuron. To distinguish the importance of different knowledge, each piece of knowledge is assigned a weight w i . At this time, the knowledge is stored row by row and read column by column when inputting neurons. Therefore, (e i *w i ) is transposed. Then, the semantic relevance between the input word vector and the named entity is calculated. If the j-th word vector x j of the input does not match the dimension of the knowledge matrix KGM and cannot be directly calculated, a transformation matrix T is introduced for connection to fuse the input vector and the weighted named entity vector, and finally the fused feature vector of the named entity part is obtained. The calculation process of the connection part of the first hidden layer is shown in Equation (3):
[0011]
[0012] Among them, b i is the bias vector of the i-th neuron, and R i is a two-dimensional connection matrix, and R ij is the connection between the j-th input and the i-th output. Using only a single value cannot fully distinguish different relationships. To make R ij accommodate more relationship feature information, it is expanded. R i is expanded from a two-dimensional matrix to a three-dimensional matrix. The content of the first two dimensions remains unchanged, and the added third dimension accommodates a vector, which is used as the relationship between different named entities. To facilitate the subsequent fusion of the named entity part and the connection part and ensure that the dimensions of the feature vectors are the same, feature extraction is performed on it.
[0013] Based on the content of the above method embodiment, in the method for dynamic relationship prediction for a financial risk knowledge graph provided in the embodiment of the present invention, the calculation processes of the connection parts of the second and third hidden layers are shown in Equation (4):
[0014]
[0015] Among them, R i' is a three-dimensional connection matrix, and C is a feature extraction matrix responsible for compressing the three-dimensional connection matrix R i' into a two-dimensional matrix.
[0016] Based on the content of the above method embodiment, in the method for dynamic relationship prediction for a financial risk knowledge graph provided in the embodiment of the present invention, the calculation method of the neurons in the first hidden layer is shown in Equation (5):
[0017]
[0018] Based on the content of the above method embodiments, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, the calculation methods of the neurons in the second and third hidden layers are shown in Equation (6):
[0019]
[0020] Based on the content of the above method embodiments, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, for the relationship prediction method in step S8, after the model is trained, the connection matrix between the hidden layers has learned the semantic information contained in the corpus. Calculate the cosine similarity between each relationship and each currently existing relationship. Those below the similarity threshold will be ignored. The remaining relationship vectors generate a candidate list, and the candidate list is calibrated in a human-machine collaboration manner. The new relationships that meet the requirements will be updated into the knowledge graph.
[0021] Second aspect, an embodiment of the present invention provides a dynamic relationship prediction device for a financial risk knowledge graph, including: a first main module, configured to implement step S1, collect, preprocess, and divide a data set; step S2, construct an enterprise risk library, which is constructed by domain experts using the seven-step method and includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; a second main module, configured to implement step S3, construct an enterprise risk knowledge graph, and construct an enterprise risk knowledge graph in a top-down manner based on the enterprise risk library; step S4, vectorize the knowledge graph, use the TransE model to train the knowledge contained in the knowledge graph, and use the trained TransE model to convert the knowledge in the form of triples into knowledge vectors; a third main module, configured to implement step S5, obtain a hidden layer structure, extract the domain knowledge graph structure according to the library hierarchy structure, and use this structure as the hidden layer structure of the subsequent neural network model; step S6, construct a KGANN model, which includes an input layer, a hidden layer, and an output layer; where the input layer is responsible for converting the input corpus into word vectors, using the data set obtained in step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors, and relationship vectors. The hidden layer neurons include named entity vectors, and the connections between the hidden layers are replaced by relationship vectors. During the training of the model, the connections between the hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more conform to the current semantic information; the output layer includes a fully connected layer and a function implementation layer, where the fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing word in the cloze task and outputting the word with the highest probability; a fourth main module, configured to implement step S7, use the data set to train the KGANN model constructed in S6, and use the early_stopping strategy for training to prevent overfitting until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; step S8, analyze the connection matrix in the KGANN model, calculate the semantic similarity between different relationships and real relationships, and obtain a new relationship through calibration.
[0022] Third aspect, an embodiment of the present invention provides an electronic device, including:
[0023] At least one processor; and
[0024] At least one memory communicatively connected to the processor, wherein:
[0025] The memory stores program instructions that can be executed by a processor. The processor can execute the dynamic relationship prediction method for a financial risk knowledge graph provided by any one of the various implementation manners of the first aspect by invoking the program instructions.
[0026] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the dynamic relationship prediction method for a financial risk knowledge graph provided by any one of the various implementation manners of the first aspect.
[0027] The dynamic relationship prediction method and device for a financial risk knowledge graph provided by the embodiments of the present invention use the hierarchical structure of the knowledge graph as the structure of the feature extraction layer, inject the features of named entities into the neurons of the feature extraction layer. The neurons of the feature extraction layer are different named entities, and the connections between the feature extraction layers are the relationships between named entities. At the same time, an unsupervised language model is used as a training task to extract features from the input statement, and then learn the relationships between named entities to ensure the timeliness of updating the relationships between entities. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0029] Figure 1 It is a flowchart of the dynamic relationship prediction method for a financial risk knowledge graph provided by an embodiment of the present invention;
[0030] Figure 2 It is a schematic structural diagram of the dynamic relationship prediction device for a financial risk knowledge graph provided by an embodiment of the present invention;
[0031] Figure 3 It is a schematic physical structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention. Additionally, the technical features in the various embodiments or individual embodiments provided by the present invention can be arbitrarily combined with each other to form a feasible technical solution. This combination is not restricted by the order of steps and / or the structural composition mode, but must be based on what can be achieved by those of ordinary skill in the art. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.
[0033] An embodiment of the present invention provides a dynamic relationship prediction method for a financial risk knowledge graph. Refer to Figure 1, the method includes: Step S1, collecting, preprocessing, and partitioning the dataset; Step S2, constructing an enterprise risk library, which is constructed by domain experts using the seven-step method and contains enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; Step S3, constructing an enterprise risk knowledge graph, and constructing the enterprise risk knowledge graph in a top-down manner based on the enterprise risk library; Step S4, vectorizing the knowledge graph, using the TransE model to train the knowledge contained in the knowledge graph, and using the trained TransE model to convert the knowledge in the form of triples into knowledge vectors; Step S5, obtaining the hidden layer structure, extracting the domain knowledge graph structure according to the library hierarchy structure, and using this structure as the hidden layer structure of the subsequent neural network model; Step S6, constructing a KGANN model, which includes an input layer, a hidden layer, and an output layer; the input layer is responsible for converting the input corpus into word vectors, using the dataset obtained in Step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in Step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors, and relationship vectors. The hidden layer neurons contain named entity vectors, and the connections between the hidden layers are replaced by relationship vectors. During the training of the model, the connections between the hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more in line with the current semantic information; the output layer includes a fully connected layer and a function implementation layer. The fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing word in the cloze task and outputting the word with the highest probability; Step S7, using the dataset to train the KGANN model constructed in S6. To prevent overfitting, use the early_stopping strategy for training until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; Step S8, analyzing the connection matrix in the KGANN model, calculating the semantic similarity between different relationships and real relationships, and obtaining a new relationship through calibration.
[0034] Based on the content of the above method embodiments, as an alternative embodiment, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, the data collection in step S1 includes a retrieval strategy, where different retrieval interval durations are assigned to different enterprises. The retrieval strategy divides enterprises into three categories, namely I, II, and III, through three dimensions: enterprise scale, enterprise attention, and enterprise risk. The indicators of each dimension are divided into three categories: A, B, and C. Among them, the enterprise scale division standard is based on the "Measures for the Classification of Large, Medium, and Small Enterprises in Statistics" announced by the National Bureau of Statistics. Large enterprises are the first category A, medium-sized enterprises are the first category B, and small and micro enterprises are the first category C. The enterprise attention is divided according to the number of reads of the enterprise's posts on the stock bar. Enterprises with the top 30% of the reading quantity are the second category A, enterprises with the reading quantity ranking between 30% - 70% are the second category B, and those ranking in the last 30% and lacking corresponding enterprise information on the stock bar are the second category C. The enterprise risk is divided according to the total number of its own risks, associated risks, historical risks, and sensitive public opinions recorded by Qichacha. When the total risk ranking is in the top 30% of enterprises, they are the third category A, when the total risk ranking is between 30% - 70%, they are the third category B, and those ranking in the last 30% and lacking corresponding enterprise information are the third category C. Enterprises with large scales have a great impact on the financial system when making property pledges, major share transactions by the actual controller, etc., so they need to be discovered and identified in a timely manner. When an enterprise has a high degree of attention, more investors conduct equity transactions with the enterprise. At this time, the enterprise information needs to be updated in a timely manner to prevent risks and maintain market confidence. When an enterprise itself has many risk events, strengthen supervision. When two or more of the indicators of enterprise scale, enterprise attention, and enterprise risk are category A, then the enterprise is a category I enterprise. When the above three-dimensional indicators are all category C, then the enterprise is a category III enterprise, and the rest of the enterprises are category II enterprises. The retrieval interval durations for category I enterprises, category II enterprises, and category III enterprises are every hour, every day, and every week respectively.
[0035] Based on the content of the above method embodiments, as an alternative embodiment, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, the calculation methods of the hidden layers in steps S5 and S6 of deep learning are as shown in Equation (1):
[0036] [[ID=⑥]]y[[ID=⑦]] i [[ID=⑧]]= f(E[[ID=⑨]] i [[ID=⑩]]+ R[[ID=⑪]] i [[ID=⑫]]) (1)
[0037] Where, E i is the i-th named entity part, R i is the i-th connection part, and f(x) is the activation function, which is used to introduce non-linear factors to improve the learning ability and robustness of the model; the calculation process of E i is as shown in Equation (2):
[0038]
[0039] Among them, x j is the j-th word vector of the input, n is the number of neurons in layer E i e i is the named entity vector contained in the i-th neuron. To distinguish the importance of different knowledge, each piece of knowledge is assigned a weight w i . At this time, the knowledge is stored row by row and read column by column when inputting neurons. Therefore, (e i *w i ) is transposed. Then, the semantic relevance between the input word vector and the named entity is calculated. If the j-th word vector x j of the input does not match the dimension of the knowledge matrix KGM and cannot be directly calculated, a transformation matrix T is introduced for connection to fuse the input vector and the weighted named entity vector, and finally the fused feature vector of the named entity part is obtained. The calculation process of the connection part of the first hidden layer is shown in Equation (3):
[0040]
[0041] Among them, b i is the bias vector of the i-th neuron, and R i is a two-dimensional connection matrix, and R ij is the connection between the j-th input and the i-th output; using only a single value cannot fully distinguish different relationships. To make R ij accommodate more relationship feature information, it is expanded. R i is expanded from a two-dimensional matrix to a three-dimensional matrix. The content of the first two dimensions remains unchanged, and the added third dimension accommodates a vector. This vector is used for the relationship between different named entities. To facilitate the subsequent fusion of the named entity part and the connection part and ensure that the dimensions of the feature vectors are the same, feature extraction is performed on it.
[0042] Based on the content of the above method embodiment, as an alternative embodiment, in the method for dynamic relationship prediction for a financial risk knowledge graph provided by the embodiments of the present invention, the calculation processes of the connection parts of the second and third hidden layers are shown in Equation (4):
[0043]
[0044] Among them, R i' is a three-dimensional connection matrix, and C is a feature extraction matrix responsible for compressing the three-dimensional connection matrix R i' into a two-dimensional matrix.
[0045] Based on the content of the above method embodiments, as an alternative embodiment, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, the calculation method of the neurons in the first hidden layer is shown in Equation (5):
[0046]
[0047] Based on the content of the above method embodiments, as an alternative embodiment, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, the calculation methods of the neurons in the second and third hidden layers are shown in Equation (6):
[0048]
[0049] Based on the content of the above method embodiments, as an alternative embodiment, in the dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention, for the relationship prediction method in step S8, after the model is trained, the connection matrix between the hidden layers has learned the semantic information contained in the corpus. Calculate the cosine similarity between each relationship and each real-time existing relationship. Those below the similarity threshold will be ignored. The remaining relationship vectors generate a candidate list, and the candidate list is calibrated in a human-machine collaboration manner. The new relationships that meet the requirements will be updated into the knowledge graph.
[0050] The dynamic relationship prediction method for a financial risk knowledge graph provided in the embodiments of the present invention uses the hierarchical structure of the knowledge graph as the structure of the feature extraction layer, injects the features of named entities into the neurons of the feature extraction layer. The neurons of the feature extraction layer are different named entities, and the connections between the feature extraction layers are the relationships between named entities. At the same time, an unsupervised language model is used as the training task to extract features from the input statements, and then learn the relationships between named entities to ensure the timeliness of entity relationship updates.
[0051] In the process of dynamically constructing a knowledge graph in the financial field, financial named entities usually change little, but over time, the relationships between different entities often change. Therefore, the key to knowledge reasoning lies in the supplementation of relationships and attributes between entities. If supervised learning is carried out using a labeled dataset, there are problems such as poor timeliness, high labor costs, and incomplete labeling. To solve the above problems, a dynamic financial knowledge reasoning framework based on KGANN uses real-time Internet data as the training set and takes the Masked Language Model as the task of the model to solve the problem of labeled data. The knowledge reasoning based on the KGANN model consists of four parts: a. Data preprocessing, b. Obtaining the hidden layer structure, c. Model training, and d. Relationship identification and prediction. The data preprocessing part generates a dataset for the deep learning model. The part of extracting the hidden layer structure is responsible for extracting the hierarchical structure of the domain knowledge graph and transforming it into the hidden layer of the KGANN model. During the model training process, the relationships between different entities are captured in the form of feature vectors. Then, in the relationship identification and prediction part, the dynamic relationships of the financial risk knowledge graph are obtained by analyzing and comparing the spatial distances with the existing relationship vectors.
[0052] To achieve timely dynamic relationship prediction, the dataset used to train the KGANN model should have strong timeliness. However, the risk levels of different enterprises and the impacts caused by risks are not the same. If a unified retrieval interval is adopted, when the interval is long, it will lead to a decrease in the timeliness of dynamic identification, and conversely, it will consume system resources. This paper formulates a retrieval strategy to allocate different retrieval intervals to different enterprises, effectively alleviating the contradiction between timeliness and system resources. Then, a training set required for the masked language model task, a cloze task dataset, is constructed. After cleaning, sentence splitting, word segmentation, and word masking steps are performed on the data retrieved by the retrieval strategy at regular intervals, a dataset required for training the KGANN model is generated.
[0053] The retrieval strategy divides enterprises into three categories, I, II, and III, through three dimensions: enterprise scale, enterprise attention, and enterprise risk. The indicators of each dimension are divided into three categories, A, B, and C. Among them, for enterprise scale, according to the division standard based on the "Measures for the Division of Large, Medium, and Small Enterprises in Statistics" announced by the National Bureau of Statistics, large enterprises are category A, medium-sized enterprises are category B, and small and micro enterprises are category C. Enterprise attention is divided according to the number of reads of the enterprise's posts on the stock bar. Enterprises with the top 30% of the reading quantity are category A, enterprises with the reading quantity ranking between 30% - 70% are category B, and enterprises ranking in the last 30% and those lacking corresponding enterprise information in the stock bar are category C. Enterprise risk is divided according to the total number of its own risks, associated risks, historical risks, and sensitive public opinions recorded in Qichacha. When the total risk ranking is in the top 30% of enterprises, it is category A, when the total risk ranking is between 30% - 70%, it is category B, and when ranking in the last 30% and lacking corresponding enterprise information, it is category C.
[0054] Large-scale enterprises have a great impact on the financial system when they engage in property right pledge, major share transactions by the actual controller, etc., so they need to be detected and identified in a timely manner. When an enterprise receives high attention, there are more investors conducting equity transactions with the enterprise. At this time, the information of the enterprise should be updated in a timely manner to prevent risks and maintain market confidence. When an enterprise itself experiences many risk events, supervision should be strengthened. Therefore, when two or more of the indicators of enterprise scale, enterprise attention, and enterprise risk are A, the enterprise is a Class I enterprise. When all three-dimensional indicators are C, the enterprise is a Class III enterprise, and the rest are Class II enterprises. The retrieval intervals for Class I, Class II, and Class III enterprises are every hour, every day, and every week respectively.
[0055] Some of the data obtained through retrieval contains useless characters in the HTML header. Therefore, in the data preprocessing process, the data is first cleaned to remove the useless characters. Since the deep learning model is trained in units of sentences, the data in units of paragraphs needs to be divided into single sentences. In the knowledge graph, named entities all appear in the form of words. Therefore, this framework uses word vectors instead of character vectors and introduces a domain word list during the word segmentation process to effectively prevent misclassification of enterprise names and proper nouns.
[0056] The masked language model is a self-supervised learning model that does not require data annotation and generates a dataset through the "masking" process. "Masking" uses special symbols to randomly replace a word in the text, and the replaced sentence is used as the question, and the replaced word is used as the answer. Adopting a masking strategy similar to the BERT model, at most 15% of the words in each sentence will be replaced by the "[MASK]" label, where 80% are actually replaced by [MASK], 10% remain unchanged, and the remaining 10% are replaced by other words. Using the replaced sentence as the input and the replaced word as the prediction result, a dataset for model learning is obtained.
[0057] The hidden layer is jointly determined by the number of hidden layers, the number of neurons in each layer, and the neuron structure. Among them, the number of hidden layers is determined by the number of layers in the library; while retaining the required enterprise nodes, the number of neurons in each layer and the named entities contained in the neurons are determined by pruning through comparison between the knowledge graph and the library; then, according to the relationships contained in the knowledge graph, it is determined whether there are connections between the hidden layers, and then the connection matrix between the hidden layers is constructed. Finally, the hidden layer structure of the KGANN model is constructed according to the data obtained above.
[0058] The enterprise risk database is manually constructed by domain experts. The database is divided into three layers. The first layer includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; the second layer includes legal person, registration status, establishment date, location, industry, former names, number of insured employees, and change records; the third layer includes controlling shareholders, held shares, investment ratio, investment amount, case amount, and judgment results. Therefore, the number of hidden layers of the KGANN model is determined to be three layers.
[0059] With the support of the enterprise risk database, by leveraging the relatively high-quality semi-structured and structured data from Qichacha and Stock Bar, a knowledge graph is constructed in a top-down manner. Considering that the knowledge graph should have higher reusability and universality, 3,527 common enterprises are included in the knowledge extraction scope, and finally 2,822,394 triples are obtained. Then, relevant associated nodes are selected from the detected enterprises to form a sub-graph of the knowledge graph, and pruning or supplementation is performed on the useless parts, and the hidden layer of the model is constructed based on this.
[0060] In the model training part, the input layer uses the BERT model to vectorize the dataset. The TransE is used to generate the named entity vectors and initial relationship vectors of the hidden layer. The data is subjected to feature extraction and modeling through the hidden layer. Then, three fully connected layers are used to appropriately scale the features. The output layer uses the softmax function to predict the masked words. After the model is fully trained using the data, the connections between the hidden layers contain the semantic information contained in the training corpus. At this time, not only the existing relationships between named entities are updated accordingly, but also the relationship vectors that originally did not exist between named entities are obtained. However, these relationship vectors are not always accurate. Therefore, the semantic similarity between the relationship vectors and each real relationship vector is calculated. Then, those with a similarity lower than the similarity threshold will be ignored, and the remaining relationship vectors generate a candidate list. The candidate list is calibrated in a human-machine collaboration manner, and the new relationships that meet the requirements will be updated into the knowledge graph.
[0061] The relationships marked as A, B, and C between named entities in the initial state are the existing relationships, and this relationship will be updated as the model is trained. The relationship marked as Pi in the initial state is the relationship to be predicted, which is initialized using random numbers that conform to the normal distribution. After the model is fully trained, this vector quickly evolves towards the semantic space where the named entities are located, and then predicts the relationships that originally did not exist between named entities. In the semantic space where the named entities are located, the spatial distance between the predicted relationship vector and the real relationship vector represents the semantic similarity between the two. The higher the semantic similarity, the higher the confidence that the predicted relationship is this relationship. Calculate the cosine similarity. At this time, if Pi is closer to A than B, it is considered that the confidence of the predicted relationship being "business scope" is higher.
[0062] However, a knowledge graph is a collection of knowledge in degrees and usually needs to be calibrated before being added to the knowledge graph. The number of predicted relationships is huge, and it is difficult to calibrate all of them. Therefore, a human-machine collaboration method is adopted to set a threshold for similarity. Suppose Pi is the predicted relationship between E1 and E2. When the similarity between Pi and all existing relationship vectors is lower than this threshold, it is considered that the relationship between E1 and E2 cannot be generalized using existing relationships, and the triple (E1, Pi, E2) does not hold. Subsequently, the predicted relationships higher than the threshold are sorted and calibrated by [a certain entity]. For example, when predicting the relationship of the triple (China National Petroleum & Natural Gas Corporation, Pi, mining industry), there are two relationships where Pi is higher than the threshold, P1 = business scope, P2 = industry affiliation. Then, [a certain entity] calibrates them to obtain a triple and adds it to the knowledge graph.
[0063] The implementation basis of each embodiment of the present invention is achieved through programmed processing by a device with a processor function. Therefore, in engineering practice, the technical solutions and their functions of each embodiment of the present invention can be encapsulated into various modules. Based on this actual situation, on the basis of the above embodiments, an embodiment of the present invention provides a dynamic relationship prediction device for a financial risk knowledge graph, and this device is used to execute the dynamic relationship prediction method for a financial risk knowledge graph in the above method embodiments. See Figure 2, the device includes: a first main module for implementing step S1 of collecting, preprocessing, and partitioning a data set; step S2 of constructing an enterprise risk database, which is constructed by domain experts using a seven-step method and includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; a second main module for implementing step S3 of constructing an enterprise risk knowledge graph, and constructing an enterprise risk knowledge graph in a top-down manner based on the enterprise risk database; step S4 of vectorizing the knowledge graph, using the TransE model to train the knowledge contained in the knowledge graph, and using the trained TransE model to convert the knowledge in the form of triples into knowledge vectors; a third main module for implementing step S5 of obtaining a hidden layer structure, extracting the domain knowledge graph structure according to the database hierarchy, and using this structure as the hidden layer structure of the subsequent neural network model; step S6 of constructing a KGANN model, which includes an input layer, a hidden layer, and an output layer; where the input layer is responsible for converting the input corpus into word vectors, using the data set obtained in step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors, and relationship vectors. The neurons in the hidden layer contain named entity vectors, and the connections between the hidden layers are replaced by relationship vectors. During the training of the model, the connections between the hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more in line with the current semantic information; the output layer includes a fully connected layer and a function implementation layer, where the fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing words in the cloze task and outputting the word with the highest probability; a fourth main module for implementing step S7 of training the KGANN model constructed in S6 using the data set. To prevent overfitting, use the early_stopping strategy for training until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; step S8 of analyzing the connection matrix in the KGANN model, calculating the semantic similarity between different relationships and real relationships, and obtaining a new relationship through calibration.
[0064] The dynamic relationship prediction device for a financial risk knowledge graph provided by the embodiment of the present invention adopts Figure 2 several modules therein, uses the hierarchical structure of the knowledge graph as the structure of the feature extraction layer, injects the features of named entities into the neurons of the feature extraction layer, the neurons of the feature extraction layer are different named entities, the connections between the feature extraction layers are the relationships between named entities, and at the same time uses an unsupervised language model as the training task to extract features from the input statement, and then learns the relationships between named entities to ensure the timeliness of entity relationship updates.
[0065] It should be noted that the devices in the device embodiments provided by the present invention can be used not only to implement the methods in the above method embodiments, but also to implement the methods in other method embodiments provided by the present invention. The difference lies only in setting corresponding functional modules, and the principle is basically the same as that of the above device embodiments provided by the present invention. As long as those skilled in the art, based on the above device embodiments, refer to the specific technical solutions in other method embodiments, obtain corresponding technical means by combining technical features, and the technical solutions constituted by these technical means, and on the premise of ensuring the practicality of the technical solutions, the devices in the above device embodiments can be improved to obtain corresponding device-like embodiments for implementing the methods in other method-like embodiments. For example:
[0066] Based on the content of the above device embodiment, as an optional embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiment of the present invention further includes: a first sub-module, configured to implement a retrieval strategy included in the data collection in step S1, allocate different retrieval interval durations to different enterprises, and divide enterprises into three categories, namely I, II, and III, through three dimensions of enterprise scale, enterprise attention, and enterprise risk. The indicators of each dimension are divided into three categories, namely A, B, and C; among them, the enterprise scale division standard is based on the "Measures for the Division of Large, Medium, and Small Enterprises in Statistics" announced by the National Bureau of Statistics. Large enterprises are the first category A, medium-sized enterprises are the first category B, and small and micro enterprises are the first category C; enterprise attention is divided according to the number of reads of the enterprise's posts in the stock bar. Enterprises with the top 30% of the number of reads are the second category A, enterprises with the number of reads ranking between 30% and 70% are the second category B, and enterprises ranking in the last 30% and lacking corresponding enterprise information in the stock bar are the second category C; enterprise risk is divided according to the total number of its own risks, associated risks, historical risks, and sensitive public opinions recorded by Qichacha. When the total risk ranking is in the top 30% of the enterprises, they are the third category A, when the total risk ranking is between 30% and 70%, they are the third category B, and when ranking in the last 30% and lacking corresponding enterprise information, they are the third category C; large-scale enterprises have a great impact on the financial system when making property pledges, major share transactions by the actual controller change, so they should be discovered and identified in time; when an enterprise has a high degree of attention, more investors conduct equity transactions with the enterprise, and at this time, the enterprise information should be updated in time to prevent risks from occurring and maintain market confidence; when an enterprise itself has more risk events, strengthen supervision. When two or more of the indicators of enterprise scale, enterprise attention, and enterprise risk are category A, then the enterprise is a type I enterprise. When the above three-dimensional indicators are all category C, then the enterprise is a type III enterprise, and the rest of the enterprises are all type II enterprises; the retrieval interval durations for type I enterprises, type II enterprises, and type III enterprises are every hour, every day, and every week respectively.
[0067] Based on the content of the above device embodiments, as an alternative embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiments of the present invention further includes: a second sub-module for implementing the calculation method of the hidden layer in the deep learning of steps S5 and S6, and its calculation method is shown in Equation (1):
[0068] y i = f(E i + R i ) (1)
[0069] where E i is the i-th named entity part, R i is the i-th connection part, f(x) is an activation function used to introduce non-linear factors and improve the learning ability and robustness of the model; the calculation process of E i is shown in Equation (2):
[0070]
[0071] where x j is the j-th input word vector, n is the number of neurons in the E i layer, e i is the named entity vector contained in the i-th neuron. To distinguish the importance of different knowledge, each piece of knowledge is assigned a weight w i . At this time, the knowledge is stored row by row and read column by column when inputting neurons. Therefore, (e i * w i ) is transposed. Then, the semantic relevance between the input word vector and the named entity is calculated. The j-th input word vector x j and the knowledge matrix KGM have mismatched dimensions and cannot be directly calculated. Therefore, a transformation matrix T is introduced for connection to fuse the input vector and the weighted named entity vector, and finally the fused feature vector of the named entity part is obtained. The calculation process of the connection part of the first hidden layer is shown in Equation (3):
[0072]
[0073] where b i is the bias vector of the i-th neuron, R i is a two-dimensional connection matrix, and R ij is the connection between the j-th input and the i-th output; using only a single value cannot fully distinguish different relationships. To enable R ij to accommodate more relationship feature information, it is expanded, and R iExpand from a two-dimensional matrix to a three-dimensional matrix. The content of the first two dimensions remains unchanged, and the added third dimension accommodates a vector. Use this vector as the relationship between different named entities. To facilitate the subsequent integration of the named entity part and the connection part, ensure that the dimensions of the feature vectors are the same, and perform feature extraction on them.
[0074] Based on the content of the above device embodiments, as an optional embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiments of the present invention further includes: a third sub-module, which is used to implement the calculation process of the connection part of the second and third hidden layers as shown in formula (4):
[0075]
[0076] where R i' is a three-dimensional connection matrix, and C is a feature extraction matrix, which is responsible for compressing the three-dimensional connection matrix R i' into a two-dimensional matrix.
[0077] Based on the content of the above device embodiments, as an optional embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiments of the present invention further includes: a fourth sub-module, which is used to implement the calculation method of the neurons in the first hidden layer as shown in formula (5):
[0078]
[0079] Based on the content of the above device embodiments, as an optional embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiments of the present invention further includes: a fifth sub-module, which is used to implement the calculation method of the neurons in the second and third hidden layers as shown in formula (6):
[0080]
[0081] Based on the content of the above device embodiments, as an optional embodiment, the dynamic relationship prediction device for a financial risk knowledge graph provided in the embodiments of the present invention further includes: a sixth sub-module, which is used to implement the relationship prediction method in step S8. After the model is trained, the connection matrix between the hidden layers has learned the semantic information contained in the corpus. Calculate the cosine similarity between each relationship and each real-time existing relationship. Those lower than the similarity threshold will be ignored. The remaining relationship vectors generate a candidate list, and the candidate list is calibrated in a human-machine collaboration manner. The new relationships that meet the requirements will be updated into the knowledge graph.
[0082] The method of the embodiments of the present invention is implemented relying on an electronic device. Therefore, it is necessary to introduce the relevant electronic device. For this purpose, the embodiments of the present invention provide an electronic device, such as Figure 3As shown in the figure, the electronic device includes: at least one processor, a communications interface, at least one memory, and a communication bus. Among them, the at least one processor, the communications interface, and the at least one memory complete communication with each other through the communication bus. The at least one processor can call the logical instructions in the at least one memory to execute all or part of the steps of the methods provided in the foregoing method embodiments.
[0083] In addition, when the logical instructions in the foregoing at least one memory are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the method embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0084] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
[0085] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. With this understanding, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or sometimes in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions.
[0087] It should be noted that the term "comprising", "including", or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device that comprises a series of elements includes not only those elements but also other elements that are not explicitly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, the elements defined by the statement "comprising..." do not preclude the presence of additional identical elements in the process, method, article, or device that comprises the said elements.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A dynamic relationship prediction method for a financial risk knowledge graph, characterized in that, Including: Step S1: Collect, preprocess, and partition the data set; Step S2: Construct an enterprise risk library, which is constructed by domain experts using the seven-step method and includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; Step S3: Construct an enterprise risk knowledge graph. Based on the enterprise risk library, construct the enterprise risk knowledge graph in a top-down manner; Step S4: Vectorize the knowledge graph. Use the TransE model to train the knowledge contained in the knowledge graph, and use the obtained TransE model to transform the knowledge in the form of triples into knowledge vectors; Step S5: Obtain the hidden layer structure. Extract the domain knowledge graph structure according to the library hierarchy, and this structure is used as the structure of the hidden layer of the subsequent neural network model; Step S6: Construct the KGANN model, which includes three parts: an input layer, a hidden layer, and an output layer; among them, the input layer is responsible for converting the input corpus into word vectors, using the data set obtained in Step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in Step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors, and relationship vectors. The hidden layer neurons contain named entity vectors, and the connections between the hidden layers are replaced by relationship vectors. During the training of the model, the connections between the hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more in line with the current semantic information; the output layer includes a fully connected layer and a function implementation layer. Among them, the fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing words in the cloze task and outputting the word with the highest probability; Step S7: Use the data set to train the KGANN model constructed in S6. To prevent overfitting, use the early_stopping strategy for training until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; Step S8: Analyze the connection matrix in the KGANN model, calculate the semantic similarity between different relationships and real relationships, and obtain a new relationship through calibration.
2. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 1, wherein The data collection in step S1 includes a retrieval strategy that assigns different retrieval interval durations to different enterprises. The retrieval strategy classifies enterprises into three categories, namely, Category I, Category II, and Category III, through three dimensions: enterprise scale, enterprise attention, and enterprise risk. The indicators of each dimension are divided into three categories: A, B, and C. Large enterprises belong to the first A category, medium-sized enterprises belong to the first B category, and small and micro enterprises belong to the first C category. Enterprise attention is divided according to the number of readings of the enterprise's posts on the stock bar. Enterprises with the top 30% of the reading quantity are classified as the second A category, enterprises with the reading quantity ranking between 30% and 70% are classified as the second B category, and enterprises ranking in the last 30% and those lacking corresponding enterprise information on the stock bar are classified as the second C category. Enterprise risk is divided according to the total number of its own risks, associated risks, historical risks, and sensitive public opinions recorded by Qichacha. When the total risk ranking is in the top 30% of the enterprises, they are classified as the third A category. When the total risk ranking is between 30% and 70%, they are classified as the third B category. When ranking in the last 30% and lacking corresponding enterprise information, they are classified as the third C category. Enterprises with large scales have a great impact on the financial system when making property pledges, major share transactions by the actual controller, etc., so they need to be discovered and identified in a timely manner. When an enterprise has a high degree of attention, more investors conduct equity transactions with the enterprise. At this time, the enterprise information needs to be updated in a timely manner to prevent risks from occurring and maintain market confidence. When an enterprise has more risk events, strengthen supervision. When two or more of the indicators of enterprise scale, enterprise attention, and enterprise risk are of category A, then the enterprise is a Category I enterprise. When the above three-dimensional indicators are all of category C, then the enterprise is a Category III enterprise. The rest of the enterprises are all Category II enterprises. The retrieval interval durations for Category I enterprises, Category II enterprises, and Category III enterprises are every hour, every day, and every week, respectively.
3. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 2, wherein The calculation method of the hidden layer in the deep learning of steps S5 and S6 is shown in Equation (1) as follows: y i = f(E i + R i ) (1) Among them, E i is the i-th named entity part, R i is the i-th connection part, and f(x) is the activation function, which is used to introduce non-linear factors and improve the learning ability and robustness of the model; The calculation process of E i is shown in Equation (2): Among them, x j is the j-th word vector of the input, n is the number of neurons in the E i layer, e i is the named entity vector contained in the i-th neuron. To distinguish the importance of different knowledge, each piece of knowledge is assigned a weight w i . At this time, the knowledge is stored row by row and read column by column when inputting neurons. Therefore, transpose (e i *w i ). Then calculate the semantic relevance between the input word vector and the named entity. The j-th word vector x j of the input does not match the dimension of the knowledge matrix KGM and cannot be directly calculated. Then introduce a transformation matrix T for connection to fuse the input vector and the weighted named entity vector, and finally obtain the fused feature vector of the named entity part. The calculation process of the connection part of the first hidden layer is shown in Equation (3): where, b i is the bias vector of the i-th neuron, and R i is a two-dimensional connection matrix, and R ij is the connection between the j-th input and the i-th output; using only a single numerical value cannot fully distinguish different relationships. To enable R ij to accommodate more relationship feature information, it is expanded, and R i is extended from a two-dimensional matrix to a three-dimensional matrix. The content of the first two dimensions remains unchanged, and the added third dimension accommodates a vector. This vector is used for the relationships between different named entities. To facilitate the subsequent fusion of the named entity part and the connection part and ensure that the dimensions of the feature vectors are the same, feature extraction is performed on it.
4. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 3, wherein The calculation process of the connection part between the second and third hidden layers is shown in Equation (4) as follows: Among them, R i' is a three-dimensional connection matrix, and C is a feature extraction matrix, responsible for compressing the three-dimensional connection matrix R i' into a two-dimensional matrix.
5. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 4, wherein The calculation method of the neurons in the first hidden layer is shown in Equation (5) as follows:
6. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 5, wherein The calculation method of the neurons in the second and third hidden layers is shown in Equation (6) as follows:
7. The dynamic relationship prediction method for a financial risk knowledge graph according to claim 6, wherein Regarding the relationship prediction method in step S8, after the model is trained, the connection matrix between the hidden layers has learned the semantic information contained in the corpus. Calculate the cosine similarity between each relationship and each real-time existing relationship. Those lower than the similarity threshold will be ignored. The remaining relationship vectors generate a candidate list, and the candidate list is calibrated in a human-machine collaboration manner. The new relationships that meet the requirements will be updated into the knowledge graph.
8. A dynamic relationship prediction device for a financial risk knowledge graph, characterized in that, including: The first main module is used to implement step S1, for data collection, preprocessing, and dataset division; Step S2, constructing an enterprise risk database, which is constructed by domain experts using the seven-step method and includes enterprise basic information, enterprise equity information, enterprise financial information, and enterprise risk information; The second main module is used to implement step S3, constructing an enterprise risk knowledge graph. Based on the enterprise risk database, construct the enterprise risk knowledge graph in a top-down manner; step S4, vectorize the knowledge graph, use the TransE model to train the knowledge contained in the knowledge graph, and use the obtained TransE model to transform the knowledge in the form of triples into knowledge vectors; The third main module is used to implement step S5, obtain the hidden layer structure, extract the domain knowledge graph structure according to the library hierarchy structure, and this structure is used as the hidden layer structure of the subsequent neural network model; step S6, construct the KGANN model, which includes an input layer, a hidden layer and an output layer; The input layer is responsible for converting the input corpus into word vectors, using the data set obtained in step S1 as the input, and vectorizing the data through the BERT model; the hidden layer uses the knowledge graph structure obtained in step S2, including the number of hidden layers, the number of neurons in each layer, named entity vectors and relationship vectors. The hidden layer neurons contain named entity vectors, and the connections between hidden layers are replaced by relationship vectors. During the training of the model, the connections between hidden layers learn the semantic information contained in the corpus, and then adjust the relationship vectors during the BP backpropagation process to make them more conform to the current semantic information; the output layer includes a fully connected layer and a function implementation layer, where the fully connected layer reduces the high-dimensional space of the hidden layer to a low-dimensional space, and the function implementation layer is responsible for predicting the missing word in the cloze task and outputting the word with the highest probability; The fourth main module is used to implement step S7, train the KGANN model constructed in S6 using the data set. To prevent overfitting, use the early_stopping strategy for training until the model converges to the best effect, save the model, and use it for subsequent relationship prediction; step S8, analyze the connection matrix in the KGANN model, calculate the semantic similarity between different relationships and real relationships, and obtain a new relationship through calibration.
9. An electronic device, characterized in that, Including: At least one processor, at least one memory and a communication interface; wherein, The processor, memory and communication interface communicate with each other; The memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Chinese dangerous chemical named entity recognition method
CN113836930A
Internet public opinion event-oriented enterprise risk identification method based on KGANN
CN114118779A