Knowledge graph completion method, device, equipment, medium and product

The clustering algorithm obtains high-quality negative example triplets, which solves the problems of poor reasoning ability and low accuracy in bank applications, and achieves a more efficient and accurate knowledge graph completion effect.

CN119849609APending Publication Date: 2025-04-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411901295.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing knowledge graph completion model has problems with poor reasoning ability and low accuracy in bank applications, mainly because the traditional negative sampling method fails to fully integrate multiple data sources within the bank and has not been optimized for complex business relationships and risk models.

Method used

High-quality negative example triplets are obtained through clustering algorithms, thereby improving the inference ability of the knowledge graph completion model. The specific steps include obtaining the input sample, dividing it into the preset clustering center, updating the clustering center, determining the clustering results, generating negative example triplets, and building a knowledge graph completion model.

Benefits of technology

It improves the reasoning ability and accuracy of the knowledge graph completion model, enhances the model's understanding of the complex business relationships and risk models of the bank, and improves the integrity and application efficiency of the knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849609A_ABST
    Figure CN119849609A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge graph completion method, device and equipment, a medium and a product. The method is applied to the field of cloud computing, and comprises the following steps: acquiring input samples, and dividing the input samples to corresponding preset clustering centers; updating a preset clustering center according to each input sample to generate an updated clustering center, and determining a clustering result according to the preset clustering center and the updated clustering center; when the clustering result is that clustering is finished, determining a target category where the to-be-replaced entity is located; and generating a negative example triple according to the target category and the to-be-replaced entity, and constructing a knowledge graph completion model according to the negative example triple. The generated negative example triad can enrich information of the knowledge graph and provide more diversified data for model learning, the constructed knowledge graph completion model can effectively fill the missing part in the knowledge graph, the integrity and accuracy of the knowledge graph are improved, the efficiency and quality of knowledge graph completion can be improved, and the knowledge graph completion efficiency and quality can be improved. And more valuable information is provided for business analysis and decision-making of banks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing, and in particular to a knowledge graph completion method, device, equipment, medium and product. Background Art

[0002] In today's digital financial environment, banks have accumulated a huge amount of data, including customer information, transaction records, financial product details, etc. In order to better understand and utilize this data, knowledge graphs are widely used in the banking field. However, due to the complexity, diversity and continuous updating of data, banks' knowledge graphs are often incomplete, which brings many challenges to accurate risk assessment, customer service and business decision-making.

[0003] The more advanced knowledge graph completion models today can support knowledge reasoning well and have strong knowledge representation capabilities, but there is still a problem in the model caused by random negative sampling, which results in poor model training results. The traditional negative sampling method is to randomly replace the entities in the entity set with the head entity or the tail entity in the positive triple. However, this method does not fully integrate the various data sources within the bank, nor does it optimize for the bank's complex business relationships and risk models, resulting in poor reasoning ability and low accuracy when the model is applied to the bank's knowledge graph completion. Summary of the invention

[0004] The present invention provides a knowledge graph completion method, device, equipment, medium and product to obtain high-quality negative example triples through a clustering algorithm, thereby improving the reasoning ability of the knowledge graph completion model.

[0005] According to one aspect of the present invention, a knowledge graph completion method is provided, the method comprising:

[0006] Obtain each input sample and divide each input sample into corresponding preset cluster centers;

[0007] The preset cluster center is updated according to each input sample to generate an updated cluster center, and a clustering result is determined according to the preset cluster center and the updated cluster center;

[0008] When the clustering result is the end of clustering, the target category of the entity to be replaced is determined;

[0009] Negative example triplets are generated according to the target category and the entity to be replaced, and a knowledge graph completion model is constructed based on the negative example triplets.

[0010] Optionally, each input sample is divided into a corresponding preset cluster center, including: taking each input sample as a target sample in turn; determining the Euclidean distance between the target sample and each preset cluster center, and taking the preset cluster center with the smallest Euclidean distance as the target cluster center; determining the target category corresponding to the target cluster center, and dividing the target sample into the target category.

[0011] Optionally, the preset cluster centers are updated according to each input sample to generate updated cluster centers, including: determining the category corresponding to each preset cluster center; calculating the sample mean of the input samples in each category, and using each sample mean as the updated cluster center of each category.

[0012] Optionally, the clustering result is determined according to the preset cluster center and the updated cluster center, including: calculating the center distance between the preset cluster center and the updated cluster center; when the center distance is less than a preset distance threshold, determining that the clustering result is clustering end.

[0013] Optionally, generating a negative example triplet based on the target category and the entity to be replaced includes: calculating the entity distance between the entity to be replaced and each entity in the target category; taking the entity with the smallest entity distance as the target entity, and generating a negative example triplet based on the target entity.

[0014] Optionally, after constructing the knowledge graph completion model based on the negative example triples, the method also includes: obtaining the graph to be completed, inputting the graph to be completed into the knowledge graph completion model for connection prediction, so as to complete the knowledge graph.

[0015] According to another aspect of the present invention, a knowledge graph completion device is provided, the device comprising:

[0016] An input sample division module is used to obtain each input sample and divide each input sample into a corresponding preset cluster center;

[0017] A clustering result determination module, used to update the preset cluster center according to each input sample to generate an updated cluster center, and determine the clustering result according to the preset cluster center and the updated cluster center;

[0018] A negative example triplet generation module is used to determine the target category of the entity to be replaced when the clustering result is the end of clustering;

[0019] The knowledge graph completion model construction module generates negative example triplets based on the target category and the entity to be replaced, and builds the knowledge graph completion model based on the negative example triplets.

[0020] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0021] at least one processor;

[0022] and a memory communicatively coupled to the at least one processor;

[0023] Among them, the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a knowledge graph completion method described in any embodiment of the present invention.

[0024] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a knowledge graph completion method described in any embodiment of the present invention when executed.

[0025] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program, and the computer program, when executed by a processor, implements a knowledge graph completion method according to any embodiment of the present invention.

[0026] The technical solution of the embodiment of the present invention can preliminarily classify a large number of input samples by dividing each input sample into corresponding preset cluster centers, and by continuously optimizing the cluster centers, the clustering results can be made more accurate and reasonable, and can better reflect the real distribution and characteristics of the data. The generated negative example triples can enrich the information of the knowledge graph and provide more diverse data for model learning. The constructed knowledge graph completion model can effectively fill in the missing parts in the knowledge graph, improve the integrity and accuracy of the knowledge graph, improve the efficiency and quality of knowledge graph completion, and provide more valuable information for the bank's business analysis and decision-making.

[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 creative work.

[0029] Figure 1 is a flowchart of a knowledge graph completion method provided according to Embodiment 1 of the present invention;

[0030] Figure 2 is a flowchart of another knowledge graph completion method provided according to the second embodiment of the present invention;

[0031] Figure 3 is a schematic diagram of the structure of a knowledge graph completion device provided according to Embodiment 3 of the present invention;

[0032] Figure 4 It is a structural schematic diagram of an electronic device that implements a knowledge graph completion method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] Embodiment 1

[0036] Figure 1 A flowchart of a knowledge graph completion method is provided for the first embodiment of the present invention. This embodiment is applicable to the bank knowledge graph completion scenario. The method can be executed by a knowledge graph completion device. The knowledge graph completion device can be implemented in the form of hardware and / or software. The knowledge graph completion device can be configured in a computer controller. Figure 1 As shown, the method includes:

[0037] S110: Obtain each input sample, and divide each input sample into a corresponding preset cluster center.

[0038] Among them, input samples refer to a collection of specific data information related to various banking services, such as customer information, account transaction status, specific attributes of financial products, etc., which are the basic data units for subsequent clustering operations. The preset cluster center refers to a category reference point that is pre-set by humans before starting the clustering operation. It is usually divided according to certain business logic or characteristic attributes, such as banking business type or customer risk level, and is used to classify input samples into corresponding categories.

[0039] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data comply with relevant laws, regulations and standards in relevant regions.

[0040] Optionally, each input sample is divided into a corresponding preset cluster center, including: taking each input sample as a target sample in turn; determining the Euclidean distance between the target sample and each preset cluster center, and taking the preset cluster center with the smallest Euclidean distance as the target cluster center; determining the target category corresponding to the target cluster center, and dividing the target sample into the target category.

[0041] Among them, when performing data cluster analysis, in order to process the target samples in an orderly manner, the controller will set the samples as target samples one by one in order. Euclidean distance is a measurement method for measuring the distance between two points in space. In this scenario, it can be used to measure the degree of difference between the target sample and the preset cluster center. By calculating the distance between the target sample and each preset cluster center according to the preset formula, the Euclidean distance value between the target sample and each preset cluster center in the feature space can be obtained. Euclidean distance reflects the comprehensive difference between the sample and the cluster center in the characteristics of each dimension. The smallest distance indicates that the target sample is closest to the preset cluster center in terms of feature performance. From the perspective of classification, it is more suitable to be classified into the category represented by the preset cluster center with the smallest distance. Therefore, the controller will select the preset cluster center with the smallest Euclidean distance as the target cluster center. Each preset cluster center is set with the corresponding target category at the beginning. When the target cluster center is determined, its corresponding target category is also clarified. In summary, all input samples can be classified into their appropriate categories based on their distance relationship with the preset cluster center, providing a classified and organized data basis for subsequent further data analysis, model building and other operations.

[0042] S120: updating the preset cluster center according to each input sample to generate an updated cluster center, and determining a clustering result according to the preset cluster center and the updated cluster center.

[0043] Among them, updating the cluster center means that after the input samples are divided into the corresponding preset cluster centers, the preset cluster centers are adjusted and updated by using mean calculation according to the characteristics of the newly added samples, and the new cluster centers are obtained, which can more accurately reflect the comprehensive characteristics of the samples in the category to which they belong. The clustering result refers to the final category division obtained after iteratively updating the preset cluster centers and determining whether to end the clustering operation according to the preset judgment criteria, indicating the category status to which the input samples finally belong.

[0044] Specifically, after the input samples are divided, the preset cluster center should be updated according to the newly added samples. For example, if the mean calculation method is used, if the preset cluster center represents the financial business category, and a new batch of input samples about a certain type of emerging financial products are newly divided, the characteristic values ​​of the samples of this category can be combined to recalculate the mean of the cluster center and other representative features to obtain the updated cluster center. Then compare the preset cluster center and the updated cluster center. If the difference between the two is less than the set threshold, or the change is very small after a certain round of iterative updates, the clustering is judged to be over and the clustering result is obtained. Otherwise, continue to update and iterate.

[0045] Optionally, the preset cluster centers are updated according to each input sample to generate updated cluster centers, including: determining the category corresponding to each preset cluster center; calculating the sample mean of the input samples in each category, and using each sample mean as the updated cluster center of each category.

[0046] Among them, when performing cluster analysis, the preset cluster center is a reference point that is initially set manually for classifying data. Each preset cluster center is associated with a specific category. The category can be divided according to certain logic or characteristics, aiming to classify similar data into the same category. For example, according to the business type, it can be divided into personal credit, corporate credit, savings business, and financial management business. Each category has its own unique business characteristics and related data characteristics. For example, the personal credit category may focus on the credit score of individual customers, loan purpose and other characteristics; the savings business category focuses on factors such as deposit amount, deposit term, interest rate type, etc.

[0047] Furthermore, after the numerous input samples are divided into the categories corresponding to the preset cluster centers, the mean calculation can be performed for the samples in each category. For example, in the personal credit category, there are multiple input samples of personal loan applications for different customers, each of which contains data features in multiple dimensions such as loan amount, loan term, customer age and credit score. For the dimension of loan amount, the controller can add up the loan amount values ​​of all samples in the category and divide it by the number of samples to obtain the mean of the loan amount dimension; similarly, the mean calculation operation is performed for other dimensions such as loan term, customer age, credit score, etc. Finally, the controller can combine the means calculated for each dimension to form an updated cluster center. By updating the cluster center, the overall characteristics and average level of the samples in the current category can be better reflected, so that the subsequent new input samples can be classified more accurately, and a data basis that is more in line with the actual business situation can be provided for further and accurate completion of the bank's knowledge graph, which is helpful to improve the graph content such as customer portraits and business relationships under different business categories, and assist banks in making more scientific and reasonable decisions and operational management.

[0048] Optionally, the clustering result is determined according to the preset cluster center and the updated cluster center, including: calculating the center distance between the preset cluster center and the updated cluster center; when the center distance is less than a preset distance threshold, determining that the clustering result is clustering end.

[0049] Among them, when calculating the center distance between the preset cluster center and the updated cluster center, it is similar to the calculation of the Euclidean distance between the sample and the cluster center, and is also based on the characteristics of each dimension. For example, taking the bank wealth management business category as an example, the preset cluster center has its corresponding eigenvalue vector from multiple dimensions such as the expected rate of return, investment period and risk level of the wealth management product. The updated cluster center also has a new eigenvalue vector based on these dimensions after incorporating new samples. Through the corresponding Euclidean distance formula, the preset cluster center vector and the updated cluster center vector are substituted into the formula to calculate the center distance that comprehensively reflects the differences between the two in various dimensions.

[0050] It can be known that when the calculated center distance is less than the preset distance threshold, it indicates that after the update operation based on the input sample, the change of the cluster center has been very small, and the sample distribution in each category is basically stable and will not change significantly. At this time, the clustering result can be determined as the end of clustering. Subsequently, based on the stable clustering situation, further operations such as determining the target category of the entity to be replaced can be carried out to promote the smooth completion of the bank's knowledge graph, so that the knowledge graph can more accurately present the relationship between various types of bank businesses and the attributes of related entities.

[0051] S130: When the clustering result is that the clustering is completed, determine the target category of the entity to be replaced.

[0052] Among them, the entity to be replaced refers to the specific elements in the bank's knowledge graph that have incomplete information, whose associations need to be further clarified, or that need to be verified and supplemented. For example, the business-related entity corresponding to the inaccurate business information associated with a certain customer is the object whose situation in the knowledge graph needs to be improved through a series of operations in the future. The target category refers to the specific category to which the entity to be replaced belongs after the clustering is completed, which is determined by the previous clustering operation, such as the credit business category of a certain risk level, or the wealth management business category of a certain type of income characteristics, etc., which is used as a reference for subsequent operations such as generating negative triples.

[0053] S140. Generate negative example triples according to the target category and the entity to be replaced, and build a knowledge graph completion model according to the negative example triples.

[0054] Among them, negative triples refer to the relationship combinations that are constructed in the knowledge graph construction and completion, which are not in line with the actual situation but are logical, and are used to assist the model in learning to distinguish between correct and incorrect relationships, and help the knowledge graph completion model to better learn and improve the graph content. The knowledge graph completion model refers to a model that is constructed by using data such as positive triples and generated negative triples as training materials, and using relevant technical means such as machine learning. Its purpose is to learn the correct model of entities and relationships in the knowledge graph, and then supplement and improve the missing entities, relationships and other parts in the bank's knowledge graph, so that the knowledge graph can more comprehensively and accurately reflect the knowledge system related to banking business. In addition, when constructing a knowledge graph completion model based on negative triples, the distance between entities, relationships and negative samples can be calculated through the minimum loss function to update the vector representation of entities and relationships again.

[0055] Specifically, after determining the target category, the controller can generate negative triples based on the entity to be replaced. For example, in the bank knowledge graph, there are normal positive triples such as (customer A, purchase, financial product X), so the generated negative triple may be (customer A, not purchase, financial product Y), where financial product Y is an entity related to the target category of the entity to be replaced but does not conform to the actual situation. By constructing many such reasonable negative triples and using them together with the existing positive triples as training data, a knowledge graph completion model is constructed using machine learning and other related principles, so that the model can learn the patterns of correct and incorrect relationships, so that the missing relationships and entities in the bank knowledge graph can be completed, making the entire knowledge graph more complete.

[0056] Optionally, after constructing the knowledge graph completion model based on the negative example triples, the method also includes: obtaining the graph to be completed, inputting the graph to be completed into the knowledge graph completion model for connection prediction, so as to complete the knowledge graph.

[0057] Among them, the graph to be completed refers to the knowledge graph with missing information and incomplete relationships between entities. For example, there may be gaps in the relationship between customers and financial products, such as which financial products some customers have purchased are not accurately recorded, or the relationship between business process links is incomplete, and the specific logical chain of some credit businesses from application to approval to loan issuance is not clearly reflected in the graph. The graph to be completed covers many bank-related business entities and some existing relationships between entities, and is the basic object for subsequent completion operations.

[0058] Specifically, the knowledge graph completion model can make connection predictions for the entities in the graph to be completed and the potential relationships between them based on the correct relationship patterns represented by the positive triples learned previously and the incorrect relationship patterns represented by the negative triples. For example, for a customer entity in the graph that has just opened an account but has not yet associated any financial products, the model predicts several financial products that the customer may be suitable for purchasing by analyzing a large amount of existing customer and financial product relationship data, and then supplements the corresponding customer and financial product relationship in the knowledge graph to complete the missing content. For another example, for the breakpoints between entities in the business process, the model can also infer reasonable connection relationships based on learning results, and complete the business process logic into the graph. Through the connection prediction operation, the knowledge graph completion model can continuously add missing entities to the graph to be completed and improve the relationship between entities, and finally achieve effective completion of the entire bank knowledge graph, so that it can more comprehensively and accurately reflect the various business situations of the bank.

[0059] The technical solution of the embodiment of the present invention can preliminarily classify a large number of input samples by dividing each input sample into corresponding preset cluster centers, and by continuously optimizing the cluster centers, the clustering results can be made more accurate and reasonable, and can better reflect the real distribution and characteristics of the data. The generated negative example triples can enrich the information of the knowledge graph and provide more diverse data for model learning. The constructed knowledge graph completion model can effectively fill in the missing parts in the knowledge graph, improve the integrity and accuracy of the knowledge graph, improve the efficiency and quality of knowledge graph completion, and provide more valuable information for the bank's business analysis and decision-making.

[0060] Embodiment 2

[0061] Figure 2 This is a flow chart of a knowledge graph completion method provided in the second embodiment of the present invention. This embodiment adds a specific process of generating negative example triples according to the target category and the entity to be replaced on the basis of the above-mentioned first embodiment. Among them, the specific contents of steps S250-S260 are roughly the same as steps S120-S130 in the first embodiment, so they will not be repeated in this embodiment. Figure 2 As shown, the method includes:

[0062] S210: Obtain each input sample, and divide each input sample into a corresponding preset cluster center.

[0063] Optionally, each input sample is divided into a corresponding preset cluster center, including: taking each input sample as a target sample in turn; determining the Euclidean distance between the target sample and each preset cluster center, and taking the preset cluster center with the smallest Euclidean distance as the target cluster center; determining the target category corresponding to the target cluster center, and dividing the target sample into the target category.

[0064] S220: updating the preset cluster center according to each input sample to generate an updated cluster center, and determining a clustering result according to the preset cluster center and the updated cluster center.

[0065] Optionally, the preset cluster centers are updated according to each input sample to generate updated cluster centers, including: determining the category corresponding to each preset cluster center; calculating the sample mean of the input samples in each category, and using each sample mean as the updated cluster center of each category.

[0066] Optionally, the clustering result is determined according to the preset cluster center and the updated cluster center, including: calculating the center distance between the preset cluster center and the updated cluster center; when the center distance is less than a preset distance threshold, determining that the clustering result is clustering end.

[0067] S230: When the clustering result is that the clustering is completed, determine the target category of the entity to be replaced.

[0068] S240: Calculate the entity distance between the entity to be replaced and each entity in the target category.

[0069] In a specific implementation, the target category may be the personal housing loan business category of a bank, which contains entity information related to housing loans of many customers, including multiple characteristic information such as loan amount, loan term, and repayment method. The entity to be replaced may be a housing loan-related element with incomplete information or a relationship that needs to be further clarified, such as inaccurate entity information about the mortgaged assets in a housing loan. At this point, the controller will compare and calculate the characteristic values ​​of the entity to be replaced in each dimension with the corresponding dimension characteristic values ​​of other entities in the target category to obtain the entity distance between them.

[0070] S250: taking the entity with the smallest entity distance as the target entity, and generating a negative example triplet based on the target entity.

[0071] Specifically, after calculating the entity distance between the entity to be replaced and each entity in the target category, the controller will select the entity with the smallest distance as the target entity. That is, after calculation, it is found that the entity related to the housing loan mortgage asset of another customer has the smallest distance with it, and the corresponding entity is the target entity. Then the controller will generate negative triples based on this target entity. For example, if there is a positive triple in the knowledge graph (customer A, adopted, mortgage asset X for housing loan), then a negative triple can be generated based on the target entity (customer A, did not adopt, mortgage asset Y corresponding to the target entity for housing loan). By constructing a reasonable negative triple, it can be used together with the positive triple to subsequently construct a knowledge graph completion model, so that the model can learn the difference between correct and incorrect relationships, and then more effectively complete the bank's knowledge graph.

[0072] S260. Construct a knowledge graph completion model based on negative example triplets.

[0073] Optionally, after constructing the knowledge graph completion model based on the negative example triples, the method also includes: obtaining the graph to be completed, inputting the graph to be completed into the knowledge graph completion model for connection prediction, so as to complete the knowledge graph.

[0074] The technical solution of the embodiment of the present invention can quantify the closeness of the relationship between the entity to be replaced and other entities in the target category by calculating the entity distance. Selecting the entity with the smallest distance as the target entity can accurately capture the situation that is most similar or relevant to the entity to be replaced, thereby constructing a representative and targeted negative triple. The generated negative triple can better reflect the potential problems and missing relationships in the knowledge graph, which helps to improve the learning effect and accuracy of the knowledge graph completion model. It can improve the efficiency and quality of knowledge graph completion and provide more valuable information for the bank's business analysis and decision-making.

[0075] Embodiment 3

[0076] Figure 3 This is a schematic diagram of the structure of a knowledge graph completion device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: an input sample division module 310, which is used to obtain each input sample and divide each input sample into a corresponding preset cluster center;

[0077] A clustering result determination module 320, configured to update the preset cluster center according to each input sample to generate an updated cluster center, and determine the clustering result according to the preset cluster center and the updated cluster center;

[0078] A negative example triplet generation module 330 is used to determine the target category of the entity to be replaced when the clustering result is the clustering end;

[0079] The knowledge graph completion model construction module 340 generates negative example triples according to the target category and the entity to be replaced, and constructs a knowledge graph completion model according to the negative example triples.

[0080] Optionally, the input sample division module 310 is specifically used to: take each input sample as a target sample in turn; determine the Euclidean distance between the target sample and each preset cluster center, and take the preset cluster center with the smallest Euclidean distance as the target cluster center; determine the target category corresponding to the target cluster center, and divide the target sample into the target category.

[0081] Optionally, the clustering result determination module 320 specifically includes: an updated cluster center generation unit, which is used to: determine the category corresponding to each preset cluster center; calculate the sample mean of the input samples in each category, and use the sample mean as the updated cluster center of each category.

[0082] Optionally, the clustering result determination module 320 specifically includes: a clustering result determination unit, which is used to: calculate the center distance between the preset cluster center and the updated cluster center; when the center distance is less than a preset distance threshold, determine that the clustering result is clustering end.

[0083] Optionally, the knowledge graph completion model construction module 340 is specifically used to: calculate the entity distance between the entity to be replaced and each entity in the target category; take the entity with the smallest entity distance as the target entity, and generate a negative example triplet based on the target entity.

[0084] Optionally, the device also includes: a knowledge graph completion module, which is used to obtain the graph to be completed after constructing the knowledge graph completion model according to the negative example triples, and input the graph to be completed into the knowledge graph completion model for connection prediction to complete the knowledge graph.

[0085] The technical solution of the embodiment of the present invention can preliminarily classify a large number of input samples by dividing each input sample into corresponding preset cluster centers, and by continuously optimizing the cluster centers, the clustering results can be made more accurate and reasonable, and can better reflect the real distribution and characteristics of the data. The generated negative example triples can enrich the information of the knowledge graph and provide more diverse data for model learning. The constructed knowledge graph completion model can effectively fill in the missing parts in the knowledge graph, improve the integrity and accuracy of the knowledge graph, improve the efficiency and quality of knowledge graph completion, and provide more valuable information for the bank's business analysis and decision-making.

[0086] A knowledge graph completion device provided in an embodiment of the present invention can execute a knowledge graph completion method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0087] Embodiment 4

[0088] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0089] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0090] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0091] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a knowledge graph completion method.

[0092] In some embodiments, a knowledge graph completion method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the knowledge graph completion method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a knowledge graph completion method in any other appropriate manner (e.g., by means of firmware).

[0093] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0094] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0097] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A knowledge graph completion method, characterized in that: include: Obtain each input sample, and divide each input sample into a corresponding preset cluster center; The preset cluster center is updated according to each of the input samples to generate an updated cluster center, and a clustering result is determined according to the preset cluster center and the updated cluster center; When the clustering result is the end of clustering, the target category of the entity to be replaced is determined; A negative example triple is generated according to the target category and the entity to be replaced, and a knowledge graph completion model is constructed according to the negative example triple.

2. The method according to claim 1, characterized in that The dividing each of the input samples into corresponding preset cluster centers includes: Take each input sample as the target sample in turn; Determine the Euclidean distance between the target sample and each preset cluster center, and take the preset cluster center with the smallest Euclidean distance as the target cluster center; Determine the target category corresponding to the target cluster center, and classify the target samples into the target category.

3. The method according to claim 2, characterized in that The updating of the preset cluster center according to each of the input samples to generate an updated cluster center includes: Determine the category corresponding to each of the preset cluster centers; The sample means of the input samples in each of the categories are calculated, and each of the sample means is used as the updated cluster center of each of the categories.

4. The method according to claim 1, characterized in that: The determining the clustering result according to the preset cluster center and the updated cluster center includes: Calculating the center distance between the preset cluster center and the updated cluster center; When the center distance is less than a preset distance threshold, the clustering result is determined to be clustering completion.

5. The method according to claim 1, characterized in that: The generating a negative example triplet according to the target category and the entity to be replaced includes: Calculating the entity distance between the entity to be replaced and each entity in the target category; The entity with the smallest entity distance is taken as the target entity, and a negative example triplet is generated according to the target entity.

6. The method according to claim 1, characterized in that After constructing the knowledge graph completion model according to the negative example triples, the method further includes: Obtain the graph to be completed, and input the graph to be completed into the knowledge graph completion model for connection prediction to complete the knowledge graph.

7. A knowledge graph completion device, characterized in that: include: An input sample division module is used to obtain each input sample and divide each input sample into a corresponding preset cluster center; A clustering result determination module, used for updating the preset cluster center according to each of the input samples to generate an updated cluster center, and determining a clustering result according to the preset cluster center and the updated cluster center; A negative example triplet generation module is used to determine the target category of the entity to be replaced when the clustering result is the end of clustering; The knowledge graph completion model construction module generates negative example triples according to the target category and the entity to be replaced, and constructs a knowledge graph completion model according to the negative example triples.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 6.

9. A computer storage medium, characterized in that The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.