Knowledge graph processing method and device, storage medium and electronic equipment
By using a knowledge graph processing model based on user descriptions and entity vectors to determine target rating values in the user knowledge graph of financial institutions, the problem of low accuracy in knowledge graph completion is solved, and more accurate knowledge graph completion is achieved.
Patent Information
- Application Number
- CN202511230197.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies have low accuracy in completing user knowledge graphs for financial institutions.
By acquiring the knowledge graph of financial institutions to be completed, the knowledge graph processing model is used to determine the target score between the target user and each financial object based on the user description vector and user entity vector of the target user. Based on the score, the target financial object is identified from the knowledge graph, and relationship edges are added to complete the knowledge graph completion.
It improves the accuracy of knowledge graph completion by combining multi-dimensional information to determine the degree of correlation, thus achieving more accurate knowledge graph completion.
Smart Images

Figure CN121119082A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence, in particular to a knowledge graph processing method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the rapid development of big data and the Internet, various financial products of financial institutions are emerging in an endless stream, the customer scale is expanding, and the service mode is increasingly diversified. Financial institutions attach importance to and do a good job in customer information management, so as to meet the personalized needs of different value customers. However, the management and maintenance of massive customer information bring challenges to financial institutions. Knowledge graph can convert massive unstructured data into structured data, and the entities in the knowledge graph are linked through relationships, which can well express structural knowledge. Financial institutions can manage and maintain massive customer information through the construction of knowledge graph, and mine potential useful information from it.
[0003] When constructing a large-scale customer information knowledge graph, the relationship between entities can be supplemented through knowledge completion technology (link prediction) to improve the richness of information in the knowledge graph. At present, the related technology only relies on the related information in the knowledge graph to complete the knowledge graph when completing the user knowledge graph of the financial institution, thereby there is a problem of low accuracy of knowledge graph completion.
[0004] In view of the above problems in the related art, no effective solution has been proposed so far. SUMMARY
[0005] The main purpose of the present application is to provide a knowledge graph processing method and device, a storage medium and an electronic device to solve the problem of low accuracy of knowledge graph completion when completing the user knowledge graph of the financial institution in the related art.
[0006] In order to achieve the above purpose, according to one aspect of the present application, a knowledge graph processing method is provided. The method comprises: acquiring a knowledge graph to be completed of a financial institution, wherein the knowledge graph comprises an entity set and a relationship set, the entities in the entity set are used to represent users or financial objects of the financial institution, and the relationships in the relationship set are used to represent the relationships between the users and the financial objects; for a target user in the knowledge graph, determining a target score value between the target user and each financial object based on a user description vector of the target user and a user entity vector of the target user in the knowledge graph through a knowledge graph processing model, wherein the target score value represents the degree of association between the target user and the financial object; determining a target financial object from the financial objects in the knowledge graph based on the target score value, and adding a relationship edge between the entities of the target user and the target financial object in the knowledge graph, to obtain a completed knowledge graph.
[0007] Optionally, the method further comprises: obtaining an object description vector of the financial object and an object entity vector of the financial object in the knowledge graph; and calculating a target score value between the target user and the financial object in the target relationship based on a preset scoring function, the object description vector, the object entity vector, a user description vector, a relationship vector, and a user entity vector, wherein the relationship vector is a vector representation of the target relationship.
[0008] Optionally, the method further comprises: determining a first sub-score value based on a first sub-function, the object entity vector, the user entity vector, and the relationship vector, wherein the first sub-function is used to evaluate the reliability of the target relationship between the target user and the financial object; determining a second sub-score value based on a second sub-function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, wherein the second sub-function is used to evaluate the contribution of the object description vector and the user description vector to the prediction of the target relationship; and determining the target score value based on the first sub-score value and the second sub-score value.
[0009] Optionally, the method further comprises: obtaining demand description information corresponding to the target user before calculating the target score value between the target user and the financial object in the target relationship based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector; determining the demand description information as the target relationship, and determining the relationship vector based on the demand description information.
[0010] Optionally, the method further comprises: sorting the financial objects in the knowledge graph based on the size of the target score value to obtain sorted financial objects, wherein the association degree between the sorted financial objects and the target user decreases from high to low; and determining the first P financial objects in the sorted financial objects as the target financial objects.
[0011] Optionally, the method further comprises: extracting N triplets from the knowledge graph, wherein the triplets comprise a user, a financial object related to the user, and a relationship representation; determining N positive samples and M negative samples based on the N triplets, and generating real labels corresponding to the positive samples and the negative samples, respectively, wherein the real labels represent real rating values of the association degree between the user and the financial object in the positive samples or the negative samples, and the real labels of the positive samples and the negative samples are different; processing the knowledge graph and the description text of the entities in the knowledge graph through an initial neural network model to obtain a predicted rating set, wherein the predicted rating set comprises predicted rating values between the user and the financial object in the knowledge graph, and the predicted rating values represent the predicted association degree between the user and the financial object; calculating a loss function value based on the predicted rating set and the real labels corresponding to the positive samples and the negative samples, respectively; updating the initial neural network model when the loss function value is greater than a preset value, and repeating the step of determining the predicted rating set based on the updated initial neural network model until the loss function value is less than or equal to the preset value, thereby obtaining a knowledge graph processing model.
[0012] Optionally, the method further comprises: processing the knowledge graph through an initial knowledge graph embedding model to obtain initial entity vectors of the entities and initial relationship vectors of the relationships, wherein the initial entity vectors comprise initial user entity vectors and initial object entity vectors; processing the description text of the entities through an initial word embedding model to obtain initial entity description vectors of the entities, wherein the initial entity description vectors comprise initial user description vectors and initial object description vectors; determining predicted ratings corresponding to the positive samples and the negative samples, respectively, based on a preset rating function and the initial entity vectors, the initial relationship vectors, and the initial entity description vectors corresponding to the positive samples and the negative samples, respectively; and determining the predicted rating set based on the predicted ratings corresponding to the positive samples and the negative samples, respectively.
[0013] In order to achieve the above object, according to another aspect of the present application, a knowledge graph processing device is provided. The device comprises: a first obtaining module configured to obtain a knowledge graph to be completed by a financial institution, wherein the knowledge graph comprises an entity set and a relation set, an entity in the entity set is configured to represent a user or a financial object of the financial institution, and a relation in the relation set is configured to represent a relation between the user and the financial object; a first determining module configured to, for a target user in the knowledge graph, determine a target score value between the target user and each financial object based on a user description vector of the target user and a user entity vector of the target user in the knowledge graph by using a knowledge graph processing model, wherein the target score value represents a degree of association between the target user and the financial object; and a first processing module configured to determine a target financial object from the financial objects in the knowledge graph based on the target score value, add a relation edge between the entities of the target user and the target financial object in the knowledge graph, and obtain a completed knowledge graph.
[0014] Optionally, the first determining module further comprises: an obtaining sub-module configured to, for a financial object in the knowledge graph, obtain an object description vector of the financial object and an object entity vector of the financial object in the knowledge graph; and a calculating sub-module configured to calculate the target score value between the target user and the financial object under the target relation based on a preset scoring function, the object description vector, the object entity vector, a user description vector, a relation vector and a user entity vector, wherein the relation vector is a vector representation of the target relation.
[0015] Optionally, the calculating sub-module further comprises: a first determining unit configured to determine a first sub-score value based on a first sub-function, the object entity vector, the user entity vector and the relation vector, wherein the first sub-function is configured to evaluate a reliability of the target user and the financial object having the target relation; a second determining unit configured to determine a second sub-score value based on a second sub-function, the object description vector, the object entity vector, the user description vector, the relation vector and the user entity vector, wherein the second sub-function is configured to evaluate a contribution of the object description vector and the user description vector to a prediction of the target relation; and a third determining unit configured to determine the target score value based on the first sub-score value and the second sub-score value.
[0016] Optionally, the knowledge graph processing device further comprises: a second obtaining module configured to obtain demand description information corresponding to the target user; and a second determining module configured to determine the demand description information as the target relation and determine the relation vector based on the demand description information.
[0017] Optionally, the first processing module further comprises: a sorting module configured to sort the financial objects in the knowledge graph based on the size of the target score value to obtain sorted financial objects, wherein the association degree between the sorted financial objects and the target user is from high to low; and a determination submodule configured to determine the first P financial objects in the sorted financial objects as the target financial objects.
[0018] Optionally, the knowledge graph processing apparatus further comprises: a second processing module configured to extract N triplets from the knowledge graph, wherein the triplets comprise a user, a financial object associated with the user, and a relationship representation; a generation module configured to determine N positive samples and M negative samples based on the N triplets, and generate real labels corresponding to the positive samples and the negative samples, respectively, wherein the real labels represent real score values of the association degree between the user and the financial object in the positive samples or the negative samples, and the real labels of the positive samples and the negative samples are different; a third processing module configured to process the knowledge graph and the description text of the entities in the knowledge graph through an initial neural network model to obtain a predicted score set, wherein the predicted score set comprises predicted score values between the user and the financial object in the knowledge graph, and the predicted score values represent predicted association degrees between the user and the financial object; and a fourth processing module configured to calculate a loss function value based on the predicted score set and the real labels corresponding to the positive samples and the negative samples, respectively, update the initial neural network model in a case where the loss function value is greater than a preset value, and repeatedly execute the step of determining the predicted score set based on the updated initial neural network model until the loss function value is less than or equal to the preset value, to obtain the knowledge graph processing model.
[0019] Optionally, the third processing module further comprises: a first processing submodule configured to process the knowledge graph through an initial knowledge graph embedding model to obtain initial entity vectors of the entities and initial relationship vectors of the relationships, wherein the initial entity vectors comprise an initial user entity vector and an initial object entity vector; a second processing submodule configured to process the description text of the entities through an initial word embedding model to obtain initial entity description vectors of the entities, wherein the initial entity description vectors comprise an initial user description vector and an initial object description vector; a third processing submodule configured to determine predicted scores corresponding to the positive samples and the negative samples, respectively, based on a preset scoring function and the initial entity vectors, the initial relationship vectors, and the initial entity description vectors corresponding to the positive samples and the negative samples, respectively; and a fourth processing submodule configured to determine the predicted score set based on the predicted scores corresponding to the positive samples and the negative samples, respectively.
[0020] In order to achieve the above object, according to another aspect of the present application, a computer readable storage medium is provided, which comprises a stored executable program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the knowledge graph processing method as described above when the executable program is run.
[0021] In order to achieve the above object, according to another aspect of the present application, an electronic device is provided, which comprises a memory storing an executable program; and a processor configured to run the program, wherein the program is configured to execute the knowledge graph processing method as described above when the program is run.
[0022] In order to achieve the above object, according to another aspect of the present application, a computer program product is provided, which comprises computer instructions configured to implement the steps of the knowledge graph processing method as described above when executed by a processor.
[0023] In the embodiments of the present application, by using the knowledge graph processing model, the target score value between the target user and each financial object is determined based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph, which realizes determining the correlation degree between the target user and each financial object in combination with the related description information of the target user outside the knowledge graph and the related entity information of the user in the knowledge graph, that is, realizing determining the correlation degree in combination with multi-dimensional information, so that the accuracy of the determined correlation can be improved. The target financial object is determined from the financial objects in the knowledge graph based on the target score value, so as to perform knowledge graph completion, which realizes performing knowledge graph completion based on the correlation degree determined by multi-dimensional information, so that the accuracy of the knowledge graph completion can be improved.
[0024] Therefore, the scheme provided by the present application achieves the purpose of performing knowledge graph completion based on multi-dimensional information, realizes the technical effect of improving the accuracy of knowledge graph completion, and solves the technical problem of low accuracy of knowledge graph completion when a user knowledge graph of a financial institution is completed in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0025] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be construed as an inappropriate limitation on the present application. In the drawings:
[0026] Figure 1 is a hardware structure block diagram of a computer terminal provided according to the embodiments of the present application;
[0027] Figure 2 is a flowchart of the knowledge graph processing method provided according to the embodiments of the present application;
[0028] Figure 3is a schematic diagram of a knowledge graph processing device according to an embodiment of the present application.
[0029] Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, analyzed data, etc.) involved in the present application are information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal. For example, the system and related users or institutions are provided with an interface to provide the user with a corresponding operation portal for the user to choose to agree or refuse the automatic decision result; if the user chooses to refuse, the expert decision process is entered.
[0033] Embodiment 1
[0034] According to the embodiments of the present application, an embodiment of a knowledge graph processing method is further provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0035] The method embodiment provided by the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the knowledge graph processing method is shown. As shown in the figure, Figure 1 The computer terminal 10 (or mobile device) can include one or more processors 102 (the processor 102 can include but is not limited to a microcontroller unit (MCU) or a field programmable gate array (FPGA) processing device, etc.), a memory 104 for storing data, and a transmission device 106 for communication function. In addition, it can also include a display, an input / output (I / O) interface, a universal serial bus (USB) port (which can be included as one of the ports in the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that, Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or less components than those shown in the figure, or have a different configuration from that shown in the figure. Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or less components than those shown in the figure, or have a different configuration from that shown in the figure. Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can also include more or less components than those shown in the figure, or have a different configuration from that shown in the figure.
[0036] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to herein as "data processing circuits" in general. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As referred to in the embodiments of the present application, the data processing circuit serves as a processor control (for example, selection of variable resistance terminal path connected with the interface).
[0037] The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage devices corresponding to the knowledge graph processing method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the knowledge graph processing method described above. The memory 104 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include a memory remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0038] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.
[0039] The display can be, for example, a touch screen type liquid crystal display (Liquid Crystal Display, LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device).
[0040] In the above-mentioned operating environment, the present application provides a knowledge graph processing method as shown in Figure 2 Figure 2 is a flowchart of the knowledge graph processing method according to Embodiment 1 of the present application.
[0041] In step S201, a knowledge graph to be completed by a financial institution is acquired, wherein the knowledge graph includes an entity set and a relationship set, an entity in the entity set is used to represent a user or a financial object of the financial institution, and a relationship in the relationship set is used to represent a relationship between the user and the financial object.
[0042] Optionally, an electronic device, an application system, a server, and the like can be used as an execution subject of the present application. In the present embodiment, a target processing system is used as an execution subject to execute the knowledge graph processing method described above.
[0043] Optionally, the knowledge graph to be completed is used to record a relationship between a client (i.e., a user) and a financial object.
[0044] In an optional embodiment, the financial object can refer to a financial product. By completing the knowledge graph, the financial product can be recommended to the user.
[0045] In an optional embodiment, the financial object can refer to a financial service. By completing the knowledge graph, the financial service expected to be handled by the user can be determined, and the customer service seat corresponding to the financial service can be connected to the user.
[0046] Optionally, the relationships in the relationship set include, but are not limited to, a like relationship, a behavior relationship (such as having handled a certain service, having purchased a certain product, etc.). In the knowledge graph, if there is a relationship between a certain user and a certain financial object, a corresponding relationship edge is constructed between the user and the financial object to represent the existence of the relationship.
[0047] In step S202, for a target user in the knowledge graph, a target score value between the target user and each financial object is determined by a knowledge graph processing model based on a user description vector of the target user and a user entity vector of the target user in the knowledge graph, wherein the target score value represents the degree of association between the target user and the financial object.
[0048] In an optional embodiment, the target user refers to a user to be analyzed in the completion of the knowledge graph. For example, the target user can be any user in the knowledge graph. For another example, the target user can be a user designated by a staff of a financial institution. For another example, the target user can be a user who initiates a product recommendation request or a customer service request. After the completion of the knowledge graph, the products that the user can like or the services that the user can consult can be known, and thus product recommendation or connection of a service seat can be performed based on the completion result.
[0049] The core goal of the completion of the knowledge graph is to predict and supplement missing factual information in the knowledge graph. In the knowledge graph, a triple is a basic unit for representing the relationship between entities, usually in the form of (subject, relationship, object), that is, (h, r, t). The relationship r is regarded as a translation from the subject h to the object t, that is, the entity and the relationship are projected in the same continuous vector space, h + r ≈ t, and the obtained vector representation is defined as the structure-based representation of the entity and the relationship. The subject represents the starting point in the triple, or the initiator of the relationship. In the knowledge graph, the subject is usually an entity, and the subject can also be referred to as the head entity. In this embodiment, the subject is a user entity. The relationship is a bridge connecting the subject and the object, describing the specific connection between the two, that is, reflecting the relationship between entities. The object is the end point of the triple, which is the object pointed to by the relationship, and the object can also be referred to as the tail entity. Like the subject, the object is also an entity in the knowledge graph, and in this embodiment, the object is a financial object entity.
[0050] For example, in the customer knowledge graph of a financial institution, a triple can be represented as ("Customer A", "purchase", "financial product X"), which means that there is a "purchase" relationship between "Customer A" and "financial product X". Such triples can store a lot of information about customer preferences, behaviors, associated entities, etc., helping to build complex inter-entity networks. The triple structured representation of the knowledge graph represents the relationship between entities, enabling machines to understand and process this information, enabling automated reasoning and completion of knowledge, and is the basis for knowledge graph construction and query. By collecting and analyzing triples, the knowledge graph can store and display complex information in a structured manner, providing support for subsequent data mining, recommendation systems, question and answer systems, etc.
[0051] Therefore, the process of completing the knowledge graph is actually the process of completing the triples in the knowledge graph. In order to complete the triples of the target customer, the target processing system can obtain the user description vector of the target user and the user entity vector of the target user in the knowledge graph, and obtain the related information of the potential demand of the target user (as a specific relationship, that is, the relationship in the triple). Then input the aforementioned user description vector, user entity vector, and related information of potential demand into the knowledge graph processing model to determine the target score value between the target user and each financial object by the knowledge graph processing model.
[0052] For example, the information input into the model is the triple to be completed: (head entity, relationship,?), such as (customer A, potential demand,?). The model input result is to calculate the target score value for all candidate tail entities (such as all financial products). The target score value represents the degree of association between the target user and the financial object.
[0053] Optionally, the knowledge graph processing model can be a neural network model. The user description vector can be determined based on the relevant description information of the user.
[0054] Step S203, based on the target score value, determine the target financial object from the financial objects in the knowledge graph, add a relationship edge between the entities of the target user and the target financial object in the knowledge graph, and obtain the completed knowledge graph.
[0055] In an optional embodiment, the lower the score value, the higher the degree of association. Therefore, the target processing system can select the candidate entity with the lowest score (most likely) as the completion result, that is, determine the financial object with the lowest target score value as the target financial object.
[0056] After determining the target financial object, the new triple (customer A, potential demand, product X) is added to the knowledge graph, that is, the corresponding relationship edge is added between the entities of the target user and the target financial object in the knowledge graph, and the completed knowledge graph is obtained.
[0057] In the embodiment of the present application, by adopting the knowledge graph processing model, the target score value between the target user and each financial object is determined based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph, which realizes determining the association degree between the target user and each financial object in combination with the related description information of the target user outside the knowledge graph and the related entity information of the user in the knowledge graph, that is, realizing determining the association degree in combination with multi-dimensional information, so as to improve the accuracy of the determined association. The target financial object is determined from the financial objects in the knowledge graph based on the target score value to perform knowledge graph completion, which realizes knowledge graph completion based on the association degree determined by multi-dimensional information, so as to improve the accuracy of knowledge graph completion.
[0058] Therefore, the scheme provided in the present application achieves the purpose of knowledge graph completion based on multi-dimensional information, realizes the technical effect of improving the accuracy of knowledge graph completion, and solves the technical problem of low accuracy of knowledge graph completion when a user knowledge graph of a financial institution is completed in the related art.
[0059] Optionally, in the knowledge graph processing method provided in the embodiment of the present application, the knowledge graph processing model is obtained in the following manner: N triplets are extracted from the knowledge graph, wherein the triplets include a user, a financial object having a relationship with the user, and a relationship representation; N positive samples and M negative samples are determined based on the N triplets, and real labels corresponding to the positive samples and the negative samples are generated, wherein the real labels represent real score values of the association degree between the user and the financial object in the positive samples or the negative samples, and the real labels of the positive samples and the negative samples are different; a prediction score set is obtained by processing the knowledge graph and the description text of the entities in the knowledge graph through an initial neural network model, wherein the prediction score set includes prediction score values between the user and the financial objects in the knowledge graph, and the prediction score values represent the predicted association degree between the user and the financial objects; a loss function value is calculated based on the prediction score set and the real labels corresponding to the positive samples and the negative samples, and in the case that the loss function value is greater than a preset value, the initial neural network model is updated, and the step of determining the prediction score set based on the updated initial neural network model is repeatedly executed until the loss function value is less than or equal to the preset value, and the knowledge graph processing model is obtained.
[0060] Optionally, before training the model, N groups of known triplets are first extracted from the knowledge graph, which contain the head entity (user), the tail entity (financial object) and the relationship between them. For example, a triplet such as (customer A, collection, product B) is extracted from the graph as the basis for positive sample training of the model.
[0061] Optionally, the extracted N triplets are taken as positive samples, and the true labels of the positive samples can be 0, indicating that there is a relationship between the entities in the positive samples. For the generation of negative samples, the entities (usually the tail entities) in the triplets can be randomly replaced, and the replaced triplets are required not to exist in the graph, so as to create unreasonable triplets. For example, (customer A, collection, product B) is replaced by (customer A, collection, product C), where product C is not actually collected by customer A. The true label of the negative sample can be 1, indicating that there is no relationship between the entities in the negative sample.
[0062] The true labels of the positive samples and the negative samples have different values. For example, the score value of the positive sample label is a low target, such as close to 0; and the score value of the negative sample label is a high target, such as greater than the positive sample and exceeding a preset interval threshold γ.
[0063] After determining the positive and negative samples and the corresponding true labels, the knowledge graph and the description text of the entities in the knowledge graph are input into an initial neural network model, and the structured information (embedding vectors of entities and relationships) of the knowledge graph and the semantic information of the entity description text are processed by the initial neural network model. The model fuses the structured information and the semantic information, and calculates a predicted score set including multiple predicted score values, for example, the predicted score set includes the predicted score values between each user and each financial object.
[0064] Optionally, after obtaining the predicted score set, a loss function value is calculated based on the predicted score set and the true labels corresponding to the positive samples and the negative samples. For example, the loss function used can be a margin loss, which aims to force the model to output a predicted score value for the positive sample that is at least γ (for example, γ = 0.8) lower than the predicted score value for the negative sample. In the case where the loss function value is greater than a preset value, the model parameters are adjusted to reduce the gap through an optimization algorithm (such as gradient descent), until the loss function value is less than or equal to the preset value, and the knowledge graph processing model is obtained.
[0065] It should be noted that through the positive and negative sample comparison training, the model training effect can be further improved based on considering the structural relationship between entities and the semantic information of entity descriptions, so that the model can more accurately predict and complete the relationships between entities in the knowledge graph.
[0066] Optionally, in the knowledge graph processing method provided in the embodiments of the present application, the initial neural network model comprises: an initial knowledge graph embedding model and an initial word embedding model, wherein the initial neural network model is used to process the knowledge graph and the description text of the entity in the knowledge graph to obtain a prediction score set, comprising: the initial knowledge graph embedding model is used to process the knowledge graph to obtain an initial entity vector of each entity and an initial relationship vector of each relationship, wherein the initial entity vector comprises an initial user entity vector and an initial object entity vector; the initial word embedding model is used to process the description text of the entity to obtain an initial entity description vector of each entity, wherein the initial entity description vector comprises an initial user description vector and an initial object description vector; based on a preset scoring function and the initial entity vector, the initial relationship vector and the initial entity description vector corresponding to each positive sample and negative sample respectively, the prediction score corresponding to each positive sample and negative sample is determined respectively; and the prediction score set is determined based on the prediction score corresponding to each positive sample and negative sample respectively.
[0067] Optionally, the initial neural network model comprises: an initial knowledge graph embedding model and an initial word embedding model. The initial graph embedding model can be a TransE model.
[0068] The initial knowledge graph embedding model can map the entities and relationships in the knowledge graph into a low-dimensional vector space to obtain an initial entity vector of each entity and an initial relationship vector of each relationship. The TransE model learns these vectors by optimizing the first sub-function S E =‖h e +r-t e ‖, wherein h e is the vector representation of the head entity (such as the initial entity vector described above), r is the vector representation of the relationship (such as the initial relationship vector of the head entity), and t e is the vector representation of the tail entity (such as the initial entity vector of the tail entity).
[0069] After the training of the initial knowledge graph embedding model is completed, two matrices, an entity embedding matrix and a relationship embedding matrix, are obtained. Each entity or relationship has a unique ID in the knowledge graph. As long as the ID is used to query the row of the corresponding matrix, the vector of the entity or edge (i.e., the entity vector or the relationship vector) can be obtained.
[0070] In the process of processing the description text, the description text of the entity can be first converted into a word embedding, a split embedding and a position embedding, and then the vector is spliced to serve as a direct input of an initial word embedding model. The initial word embedding model obtains a sentence vector of each sentence in the entity description text through processing. Finally, the average value of all the sentence vectors is obtained to obtain a vector representation based on the entity description information, that is, an initial entity description vector, so as to serve as an entity representation of the description information corresponding to the entity.
[0071] Simultaneous learning of the entity description information vector representation and the structure-based triple vector representation in the same continuous low-dimensional vector space will obtain better representation capability and more accurate vector representations of entities and relations. A scoring function (second sub-function) based on the entity description information representation can be defined as:
[0072] S D =‖h d +r-t d ‖+‖h d +r-t e ‖+‖h e +r-t d ‖
[0073] Wherein, h d represents an initial entity description vector of a head entity, and t d represents an initial description vector of a tail entity.
[0074] Optionally, the first sub-function and the second sub-function described above jointly constitute a preset scoring function, that is, a scoring function S=S E +S D .
[0075] After obtaining the initial entity vector and the initial relation vector through the initial knowledge graph embedding model and obtaining the initial entity description vector through the initial word embedding model, for each positive sample and each negative sample, a target score corresponding to the sample is determined based on the vectors corresponding to the entities and the relations in the sample output by the two models and the preset scoring function.
[0076] Optionally, a prediction score set is determined based on the prediction scores respectively corresponding to each positive sample and each negative sample.
[0077] Optionally, in the training process, the model parameters of the initial knowledge graph embedding model and the initial word embedding model are constantly optimized, and finally a knowledge graph processing model containing a knowledge graph embedding model and a word embedding model is obtained.
[0078] It should be noted that the initial knowledge graph embedding model and the initial word embedding model are combined to obtain the preliminary vector representation of the entity, the relationship and the description thereof, and the prediction score set is determined based on the preliminary vector representation, thereby improving the accuracy of the determined prediction score set.
[0079] Optionally, in the knowledge graph processing method provided by the embodiments of the present application, the target processing system determines the target score value between the target user and each financial object based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph, comprising: for the financial object in the knowledge graph, obtaining the object description vector of the financial object and the object entity vector of the financial object in the knowledge graph; calculating the target score value between the target user and the financial object under the target relationship based on the preset score function, the object description vector, the object entity vector, the user description vector, the relationship vector and the user entity vector, wherein the relationship vector is the vector representation of the target relationship.
[0080] Optionally, after the knowledge graph processing model is trained, two matrices, an entity embedding matrix and a relationship embedding matrix, are obtained in the knowledge graph processing model. Each entity or relationship has a unique ID in the knowledge graph. As long as the ID is used to query the row of the corresponding matrix, the vector of the entity or edge (i.e., the entity vector (user entity vector, object entity vector) or the relationship vector) can be obtained. The knowledge graph processing model also records the entity description vectors (i.e., the user description vector and the object description vector) corresponding to each entity in the knowledge graph. That is, the aforementioned vectors are generated and saved once in the training stage, and can be directly used in reasoning (i.e., completion) without further processing.
[0081] Therefore, when the target user and the financial object are determined during the knowledge graph completion, the ID corresponding to the target user and the financial object is determined, and then the ID is input into the model. The model can determine the user description vector of the target user, the user entity vector, and the object description vector and the object entity vector of the financial object.
[0082] Optionally, the target processing system can also determine the demand description information corresponding to the target user, determine the demand description information as the target relationship, determine the ID corresponding to the target relationship, and then input the ID into the model. The model can determine the relationship vector corresponding to the target relationship. Before the model training starts, all relationships and entities appearing in the knowledge graph can be scanned, and then each relationship can be given an integer ID starting from 0 according to the order of appearance or in dictionary order. This mapping is stored as a "relationship-ID" table and an "entity-ID" table. During training and reasoning, this table is used for bidirectional lookup.
[0083] Optionally, for the financial object in the knowledge graph, the target processing system can calculate the target score value between the target user and the financial object in the target relationship (i.e., the specific relationship) based on the above-mentioned scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, wherein the relationship vector is the vector representation of the target relationship.
[0084] For example, if the completion task is to predict and add a missing relationship edge (i.e., link prediction) between entities, such as input (customer A, potential demand,?)→output product X→complete the triple (customer A, potential demand, product X). The information input into the model is the triple to be completed: (head entity, relationship,?). For example, (customer A, potential demand,?). The model determines the corresponding vector according to the input. And for all candidate tail entities (such as all bank products), the target score value of the financial object is calculated by combining the vector corresponding to the candidate tail entity and the vector corresponding to the input information and the scoring function.
[0085] It should be noted that by the above-mentioned manner, the structured triple information and the unstructured entity description information are effectively fused, so that the accuracy of the knowledge graph completion can be improved.
[0086] Optionally, in the method for processing the knowledge graph provided in the embodiments of the present application, the scoring function includes a first sub-function and a second sub-function, wherein the target score value between the target user and the financial object in the target relationship is calculated based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, including: determining a first sub-score value based on the first sub-function, the object entity vector, the user entity vector, and the relationship vector, wherein the first sub-function is used to evaluate the reliability of the target relationship between the target user and the financial object; determining a second sub-score value based on the second sub-function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, wherein the second sub-function is used to evaluate the contribution of the object description vector and the user description vector to the prediction of the target relationship; determining the target score value based on the first sub-score value and the second sub-score value.
[0087] Optionally, the first sub-function is represented as:
[0088] S E =‖h e +r-t e ‖
[0089] The target processing system can substitute the object entity vector into the above-mentioned t e , substitute the user entity vector into the above-mentioned h e , and substitute the relationship vector into the above-mentioned r to obtain the first sub-score value.
[0090] Optionally, the second sub-function is represented as:
[0091] S D ‖h d +r-t d ‖+‖h d +r-t e ‖+‖h e +r-t d ‖
[0092] The target processing system can substitute the object entity vector into the above t e , substitute the user entity vector into the above h e , substitute the relationship vector into the above r, and substitute the object description vector into the above t d , substitute the user description vector into the above h d , to obtain a second sub-score value.
[0093] After obtaining the first sub-score value and the second sub-score value, the target score value is obtained by adding the first sub-score value and the second sub-score value according to the formula S = S E +S D
[0094] It should be noted that the above method can accurately calculate the target score value, thereby improving the accuracy of knowledge graph completion.
[0095] Optionally, in the knowledge graph processing method provided in the embodiments of the present application, before calculating the target score value of the target user and the financial object in the target relationship based on the preset score function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, the method further includes: obtaining demand description information corresponding to the target user; determining the demand description information as the target relationship, and determining the relationship vector based on the demand description information.
[0096] Optionally, the demand description information corresponding to the target user can be provided by the user, for example, provided by the target user when initiating a product recommendation request or a customer service request.
[0097] Optionally, the demand description information corresponding to the target user can also be determined by the staff of the financial institution according to the actual business demand.
[0098] After the demand description information is determined, the demand description information is directly determined as the target relationship, and the key words in the demand description information are matched in the above relationship-ID table to obtain the relationship ID, and then the matched relationship ID is input into the model to determine the relationship vector.
[0099] It should be noted that, through the above manner, the relationship vector is accurately determined, so that the accuracy of the knowledge graph completion can be improved.
[0100] Optionally, in the knowledge graph processing method provided in the embodiment of the application, the target financial object is determined from the financial objects in the knowledge graph based on the target score value, including: sorting the financial objects in the knowledge graph based on the size of the target score value to obtain sorted financial objects, wherein the association degree between the sorted financial objects and the target user is from high to low; and determining the first P financial objects in the sorted financial objects as the target financial objects.
[0101] In an optional embodiment, the lower the score value, the higher the association degree between the financial object and the target user. Therefore, the financial objects in the knowledge graph can be sorted in order from low to high according to the template score system, to obtain the sorted financial objects.
[0102] After obtaining the sorted financial objects, the first P financial objects in the sorted financial objects are determined as the target financial objects. Wherein, P is a positive integer.
[0103] It should be noted that, through the above manner, the relationship vector is accurately determined, so that the accuracy of the knowledge graph completion can be improved.
[0104] Therefore, the scheme provided in the application achieves the purpose of completing the knowledge graph based on multi-dimensional information, achieves the technical effect of improving the accuracy of knowledge graph completion, and solves the technical problem of low accuracy of knowledge graph completion when completing the user knowledge graph of a financial institution in related technologies.
[0105] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0106] Embodiment 2
[0107] The embodiment of the application also provides a knowledge graph processing device. It should be noted that the knowledge graph processing device of the embodiment of the application can be used to execute the knowledge graph processing method provided in the embodiment of the application. The knowledge graph processing device provided in the embodiment of the application is introduced as follows.
[0108] According to the embodiment of the application, a device for implementing the above knowledge graph processing method is also provided, as shown in Figure 3 The device comprises:
[0109] The first obtaining module 301 is configured to obtain a knowledge graph to be completed by a financial institution, wherein the knowledge graph comprises an entity set and a relation set, an entity in the entity set is used to represent a user or a financial object of the financial institution, and a relation in the relation set is used to represent a relation between the user and the financial object.
[0110] The first determining module 302 is configured to determine, for a target user in the knowledge graph, a target score value between the target user and each financial object based on a user description vector of the target user and a user entity vector of the target user in the knowledge graph by using a knowledge graph processing model, wherein the target score value represents a correlation degree between the target user and the financial object.
[0111] The first processing module 303 is configured to determine a target financial object from the financial objects in the knowledge graph based on the target score value, add a relation edge between the entities of the target user and the target financial object in the knowledge graph, and obtain a completed knowledge graph.
[0112] In the embodiments of the present application, the target score value between the target user and each financial object is determined based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph by using the knowledge graph processing model, which realizes determining the correlation degree between the target user and each financial object in combination with the related description information of the target user outside the knowledge graph and the related entity information of the user in the knowledge graph, that is, realizing determining the correlation degree in combination with multi-dimensional information, so as to improve the accuracy of the determined correlation. The target financial object is determined from the financial objects in the knowledge graph based on the target score value to complete the knowledge graph, which realizes completing the knowledge graph based on the correlation degree determined by the multi-dimensional information, so as to improve the accuracy of the completed knowledge graph.
[0113] Therefore, the scheme provided in the present application achieves the purpose of completing the knowledge graph based on multi-dimensional information, realizes the technical effect of improving the accuracy of the completed knowledge graph, and solves the technical problem of low accuracy of the completed knowledge graph of the user of the financial institution in the related art.
[0114] Optionally, in the knowledge graph processing apparatus provided in the embodiments of the present application, the first determining module further comprises: an obtaining sub-module, configured to obtain an object description vector of a financial object and an object entity vector of the financial object in the knowledge graph for the financial object in the knowledge graph; and a calculating sub-module, configured to calculate the target score value between the target user and the financial object under the target relation based on a preset scoring function, the object description vector, the object entity vector, the user description vector, a relation vector and a user entity vector, wherein the relation vector is a vector representation of the target relation.
[0115] Optionally, in the knowledge graph processing apparatus provided by the embodiment of the present application, the calculation sub-module further comprises: a first determination unit configured to determine a first sub-score value based on a first sub-function, the object entity vector, the user entity vector, and the relationship vector, wherein the first sub-function is used to evaluate the reliability of the target relationship between the target user and the financial object; a second determination unit configured to determine a second sub-score value based on a second sub-function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, wherein the second sub-function is used to evaluate the contribution of the object description vector and the user description vector to the prediction of the target relationship; and a third determination unit configured to determine the target score value based on the first sub-score value and the second sub-score value.
[0116] Optionally, in the knowledge graph processing apparatus provided by the embodiment of the present application, the knowledge graph processing apparatus further comprises: a second acquisition module configured to acquire demand description information corresponding to the target user; and a second determination module configured to determine the demand description information as the target relationship, and determine the relationship vector based on the demand description information.
[0117] Optionally, in the knowledge graph processing apparatus provided by the embodiment of the present application, the first processing module further comprises: a sorting module configured to sort the financial objects in the knowledge graph based on the size of the target score value to obtain sorted financial objects, wherein the association degrees between the sorted financial objects and the target user are from high to low; and a determination sub-module configured to determine the first P financial objects in the sorted financial objects as the target financial objects.
[0118] Optionally, in the knowledge graph processing apparatus provided by the embodiment of the present application, the knowledge graph processing apparatus further comprises: a second processing module configured to extract N triples from the knowledge graph, wherein the triples comprise a user, a financial object related to the user and a relationship representation; a generating module configured to determine N positive samples and M negative samples based on the N triples, and generate real labels corresponding to the positive samples and the negative samples respectively, wherein the real labels represent real score values of the association degrees between the users and the financial objects in the positive samples or the negative samples, and the real labels of the positive samples and the negative samples are different; a third processing module configured to process the knowledge graph and the description texts of the entities in the knowledge graph by using an initial neural network model to obtain a predicted score set, wherein the predicted score set comprises predicted score values between the users and the financial objects in the knowledge graph, and the predicted score values represent predicted association degrees between the users and the financial objects; and a fourth processing module configured to calculate a loss function value based on the predicted score set and the real labels corresponding to the positive samples and the negative samples respectively, update the initial neural network model when the loss function value is greater than a preset value, and repeatedly execute the step of determining the predicted score set based on the updated initial neural network model until the loss function value is less than or equal to the preset value, thereby obtaining a knowledge graph processing model.
[0119] Optionally, in the knowledge graph processing apparatus provided by the embodiment of the present application, the third processing module further comprises: a first processing submodule configured to process the knowledge graph by using an initial knowledge graph embedding model to obtain initial entity vectors of the entities and initial relationship vectors of the relationships, wherein the initial entity vectors comprise initial user entity vectors and initial object entity vectors; a second processing submodule configured to process the description texts of the entities by using an initial word embedding model to obtain initial entity description vectors of the entities, wherein the initial entity description vectors comprise initial user description vectors and initial object description vectors; a third processing submodule configured to determine predicted scores corresponding to the positive samples and the negative samples respectively based on a preset scoring function and the initial entity vectors, the initial relationship vectors and the initial entity description vectors corresponding to the positive samples and the negative samples respectively; and a fourth processing submodule configured to determine the predicted score set based on the predicted scores corresponding to the positive samples and the negative samples respectively.
[0120] It should be noted that the first acquisition module 301, the first determination module 302, and the first processing module 303 mentioned above correspond to steps S201 to S203 in Embodiment 1. The three modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0121] Example 3
[0122] Embodiments of this application may provide an electronic device. Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (Only one is shown) processor 1002, memory 1004, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0123] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0124] The processor can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining a knowledge graph to be completed by a financial institution, wherein the knowledge graph comprises an entity set and a relationship set, entities in the entity set are used to represent users or financial objects of the financial institution, and relationships in the relationship set are used to represent relationships between the users and the financial objects; for a target user in the knowledge graph, determining a target score value between the target user and each financial object based on a user description vector of the target user and a user entity vector of the target user in the knowledge graph through a knowledge graph processing model, wherein the target score value represents a degree of association between the target user and the financial object; determining a target financial object from the financial objects in the knowledge graph based on the target score value, adding a relationship edge between the entities of the target user and the target financial object in the knowledge graph, and obtaining a completed knowledge graph.
[0125] The processor can also call information and application programs stored in the memory through the transmission device to perform the following steps: for a financial object in the knowledge graph, obtaining an object description vector of the financial object and an object entity vector of the financial object in the knowledge graph; calculating a target score value between the target user and the financial object under a target relationship based on a preset scoring function, the object description vector, the object entity vector, the user description vector, a relationship vector and a user entity vector, wherein the relationship vector is a vector representation of the target relationship.
[0126] The processor can also call information and application programs stored in the memory through the transmission device to perform the following steps: determining a first sub-score value based on a first sub-function, the object entity vector, the user entity vector and the relationship vector, wherein the first sub-function is used to evaluate the reliability of the existence of the target relationship between the target user and the financial object; determining a second sub-score value based on a second sub-function, the object description vector, the object entity vector, the user description vector, the relationship vector and the user entity vector, wherein the second sub-function is used to evaluate the contribution of the object description vector and the user description vector to the prediction of the target relationship; determining the target score value based on the first sub-score value and the second sub-score value.
[0127] The processor can also call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining demand description information corresponding to the target user before calculating the target score value between the target user and the financial object under the target relationship based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector and the user entity vector; determining the demand description information as the target relationship, and determining the relationship vector based on the demand description information.
[0128] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: sorting the financial objects in the knowledge graph based on the size of the target score value to obtain sorted financial objects, wherein the association degree between the sorted financial objects and the target user is from high to low; and determining the first P financial objects in the sorted financial objects as the target financial objects.
[0129] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: extracting N triplets from the knowledge graph, wherein the triplets include a user, a financial object associated with the user, and a relationship representation; determining N positive samples and M negative samples based on the N triplets, and generating real labels corresponding to the positive samples and the negative samples, wherein the real labels represent real score values of the association degree between the user and the financial object in the positive samples or the negative samples, and the real labels of the positive samples and the negative samples are different; processing the knowledge graph and the description text of the entities in the knowledge graph through the initial neural network model to obtain a prediction score set, wherein the prediction score set includes prediction score values between the user and the financial object in the knowledge graph, and the prediction score values represent the predicted association degree between the user and the financial object; calculating a loss function value based on the prediction score set and the real labels corresponding to the positive samples and the negative samples, updating the initial neural network model if the loss function value is greater than a preset value, and repeating the step of determining the prediction score set based on the updated initial neural network model until the loss function value is less than or equal to the preset value to obtain the knowledge graph processing model.
[0130] The processor can further call information and application programs stored in the memory through the transmission device to perform the following steps: processing the knowledge graph through an initial knowledge graph embedding model to obtain initial entity vectors of each entity and initial relationship vectors of each relationship, wherein the initial entity vectors include an initial user entity vector and an initial object entity vector; processing the description text of the entities through an initial word embedding model to obtain initial entity description vectors of each entity, wherein the initial entity description vectors include an initial user description vector and an initial object description vector; determining prediction scores corresponding to each positive sample and negative sample based on a preset scoring function and the initial entity vectors, the initial relationship vectors, and the initial entity description vectors corresponding to each positive sample and negative sample; and determining a prediction score set based on the prediction scores corresponding to each positive sample and negative sample.
[0131] In the embodiment of the present application, the target score value between the target user and each financial object is determined based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph by using the knowledge graph processing model, the association degree between the target user and each financial object is determined in combination with the related description information of the target user outside the knowledge graph and the related entity information of the user in the knowledge graph, that is, the association degree is determined in combination with multi-dimensional information, so that the accuracy of the determined association can be improved. The target financial object is determined from the financial objects in the knowledge graph based on the target score value, so as to perform knowledge graph completion, and the knowledge graph completion is performed based on the association degree determined by the multi-dimensional information, so that the accuracy of the knowledge graph completion can be improved.
[0132] Therefore, the scheme provided in the present application achieves the purpose of performing knowledge graph completion based on multi-dimensional information, achieves the technical effect of improving the accuracy of knowledge graph completion, and solves the technical problem of low accuracy of knowledge graph completion when a user knowledge graph of a financial institution is completed in the related art.
[0133] Those skilled in the art can understand that Figure 4 The structure shown is only schematic, and the electronic device can also be a terminal device such as a smart phone, a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Figure 4 It does not limit the structure of the electronic device. For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 4 For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 4 For example, the electronic device can further include more or fewer components (such as a network interface, a display device, and the like) than those shown in the figure, or have a different configuration from that shown in the figure.
[0134] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by programs instructing the related hardware of the terminal device, and the programs can be stored in a computer readable storage medium, which can include a flash disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.
[0135] Embodiment 4
[0136] The embodiments of the present application also provide a storage medium. Optionally, in the present embodiment, the above storage medium can be used to save the program code executed by the knowledge graph processing method provided in Embodiment 1.
[0137] Optionally, in the embodiment, the storage medium can be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
[0138] The application further provides a computer program product, which is suitable for executing the steps of the knowledge graph processing method when executed on a data processing device.
[0139] The above embodiment numbers of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0140] In the above embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0141] In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit embodiment described above is only schematic. For example, the division of the units is only a logical function division. There can be another division manner for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interface, or electrical or other form.
[0142] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0143] In addition, each functional unit in each embodiment of the application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0144] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0145] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.
Claims
1. A method for processing knowledge graphs, characterized in that, include: Obtain the knowledge graph to be completed by the financial institution, wherein the knowledge graph includes an entity set and a relation set, the entities in the entity set are used to represent the users or financial objects of the financial institution, and the relations in the relation set are used to represent the relationship between the users and the financial objects; For a target user in the knowledge graph, the target rating value between the target user and each financial object is determined by the knowledge graph processing model based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph. The target rating value represents the degree of association between the target user and the financial object. Based on the target score, a target financial object is determined from the financial objects in the knowledge graph. Relationship edges are added between the target user and the target financial object in the knowledge graph to obtain a complete knowledge graph.
2. The method according to claim 1, characterized in that, Based on the target user's user description vector and the target user's user entity vector in the knowledge graph, a knowledge graph processing model is used to determine the target rating values between the target user and various financial objects, including: For a financial object in the knowledge graph, obtain the object description vector of the financial object and the object entity vector of the financial object in the knowledge graph; The target score value between the target user and the financial object is calculated based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, under the target relationship. The relationship vector is the vector representation of the target relationship.
3. The method according to claim 2, characterized in that, The scoring function includes a first sub-function and a second sub-function, wherein the target score value between the target user and the financial object under the target relationship is calculated based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, including: A first sub-score is determined based on the first sub-function, the object entity vector, the user entity vector, and the relationship vector, wherein the first sub-function is used to assess the reliability of the target relationship between the target user and the financial object; The second sub-score is determined based on the second sub-function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, wherein the second sub-function is used to evaluate the contribution of the object description vector and the user description vector to the prediction of the target relationship; The target score is determined based on the first sub-score and the second sub-score.
4. The method according to claim 2, characterized in that, Before calculating the target score between the target user and the financial object under the target relationship based on the preset scoring function, the object description vector, the object entity vector, the user description vector, the relationship vector, and the user entity vector, the method further includes: Obtain the demand description information corresponding to the target user; The requirement description information is determined as the target relationship, and the relationship vector is determined based on the requirement description information.
5. The method according to claim 1, characterized in that, Determining target financial objects from financial objects in the knowledge graph based on the target score includes: The financial objects in the knowledge graph are sorted based on the target score to obtain sorted financial objects, wherein the degree of association between the sorted financial objects and the target user is from high to low. The first P financial objects in the sorted financial objects are identified as the target financial objects.
6. The method according to claim 1, characterized in that, The knowledge graph processing model is obtained through the following method: N triples are extracted from the knowledge graph, wherein each triple includes the user, a financial object that has a relationship with the user, and a relationship representation; Based on the N triples, N positive samples and M negative samples are determined, and real labels corresponding to the positive samples and the negative samples are generated respectively. The real labels represent the true score of the degree of association between the user and the financial object in the positive samples or negative samples, and the real labels of the positive samples and the negative samples are different. The knowledge graph and the descriptive text of the entities in the knowledge graph are processed by an initial neural network model to obtain a set of predicted scores. The set of predicted scores includes the predicted score values between users and financial objects in the knowledge graph, and the predicted score values represent the degree of predicted association between the users and the financial objects. The loss function value is calculated based on the predicted score set and the true labels corresponding to the positive and negative samples. If the loss function value is greater than a preset value, the initial neural network model is updated, and the step of determining the predicted score set based on the updated initial neural network model is repeated until the loss function value is less than or equal to the preset value, thus obtaining the knowledge graph processing model.
7. The method according to claim 6, characterized in that, The initial neural network model includes: an initial knowledge graph embedding model and an initial word embedding model. The initial neural network model processes the knowledge graph and the descriptive text of entities within the knowledge graph to obtain a predicted score set, including: The knowledge graph is processed by the initial knowledge graph embedding model to obtain the initial entity vector of each entity and the initial relation vector of each relation. The initial entity vector includes the initial user entity vector and the initial object entity vector. The descriptive text of entities is processed by an initial word embedding model to obtain an initial entity description vector for each entity, wherein the initial entity description vector includes an initial user description vector and an initial object description vector. Based on the preset scoring function and the initial entity vector, the initial relation vector, and the initial entity description vector corresponding to each positive and negative sample, the predicted score corresponding to each positive and negative sample is determined. The predicted score set is determined based on the predicted scores corresponding to each positive and negative sample.
8. A knowledge graph processing apparatus, characterized in that, include: The first acquisition module is used to acquire the knowledge graph of the financial institution to be completed. The knowledge graph includes an entity set and a relation set. The entities in the entity set are used to represent the users or financial objects of the financial institution, and the relations in the relation set are used to represent the relationship between the users and the financial objects. The first determining module is used to determine, for a target user in the knowledge graph, a target score value between the target user and each financial object based on the user description vector of the target user and the user entity vector of the target user in the knowledge graph using a knowledge graph processing model, wherein the target score value represents the degree of association between the target user and the financial object; The first processing module is used to determine the target financial object from the financial objects in the knowledge graph based on the target score, and to add relationship edges between the target user and the target financial object in the knowledge graph to obtain the completed knowledge graph.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the knowledge graph processing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the knowledge graph processing method according to any one of claims 1 to 7.