CN117217303A - Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium - Google Patents

Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium Download PDF

Info

Publication number
CN117217303A
CN117217303A CN202310116522.7A CN202310116522A CN117217303A CN 117217303 A CN117217303 A CN 117217303A CN 202310116522 A CN202310116522 A CN 202310116522A CN 117217303 A CN117217303 A CN 117217303A
Authority
CN
China
Prior art keywords
entity
model
representation
parameters
sample
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310116522.7A
Other languages
Chinese (zh)
Inventor
庞皓宇
郭伟刚
赵哲
管仁初
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin University
Tencent Technology Shenzhen Co Ltd
Original Assignee
Jilin University
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin University, Tencent Technology Shenzhen Co Ltd filed Critical Jilin University
Priority to CN202310116522.7A priority Critical patent/CN117217303A/en
Publication of CN117217303A publication Critical patent/CN117217303A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application relates to a knowledge graph processing method which can be applied to the field of artificial intelligence. The method comprises the following steps: constructing a sample set based on the locally stored knowledge-graph; extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector; determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss; encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server; and training the representation learning model to be trained based on the global model parameters determined by the server until the global training stopping condition is met, and obtaining the representation learning model after training is completed. The training of the knowledge graph representation learning model is realized on the premise of ensuring the data safety.

Description

Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technology, and in particular, to a knowledge graph processing method, a knowledge graph processing device, a computer device, a storage medium, and a computer program product.
Background
The knowledge graph is a network for describing the knowledge relevance, the knowledge graph is composed of a huge number of entities and relations among the entities, and the knowledge graph needs to convert the entities, the relations or the triples contained in the knowledge graph into a vector form in the application process.
In the conventional technology, vector extraction by representing a learning model is a commonly used means at present, and in order to improve the accuracy of extracting vectors by representing the learning model, a large amount of knowledge patterns are generally required to be used as a training sample set. However, since the knowledge graph is a very important data resource owned by each organization, it is difficult to realize training of the representation learning model on the premise of ensuring data security in consideration of the requirement of data privacy. Therefore, how to realize the training of the knowledge graph representation learning model on the premise of ensuring the data safety becomes an urgent problem to be solved.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a knowledge-graph processing method, apparatus, computer device, computer-readable storage medium, and computer program product that can implement training representing a learning model while ensuring data security.
In one aspect, the application provides a knowledge graph processing method. The method comprises the following steps:
constructing a sample set based on the locally stored knowledge graph, the sample set comprising a plurality of multi-element samples;
extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector;
determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss;
encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters;
and continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
In a second aspect, the application further provides a knowledge graph processing device. The device comprises:
and the construction module is used for constructing a sample set based on the locally stored knowledge graph, wherein the sample set comprises a plurality of multi-group samples.
And the prediction module is used for extracting the representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained and determining the rationality prediction score of the multi-group sample based on the representation vector.
And the updating module is used for determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss.
And the encryption module is used for carrying out encryption processing on the updated model parameters to obtain encryption parameters, and sending the encryption parameters to the server so as to instruct the server to determine the global model parameters based on the received multiple groups of encryption parameters.
And the acquisition module is used for continuing training the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
In some embodiments, the multi-tuple samples comprise a multi-tuple positive sample and a multi-tuple negative sample, the construction module being specifically for: extracting a plurality of real multiple groups from a locally stored knowledge graph to serve as multiple group positive samples; extracting a plurality of entities without relations from the knowledge graph, and randomly selecting the relations from the knowledge graph; combining the extracted entities with the randomly selected relationship to obtain a plurality of false tuples, and taking the false tuples as a tuple negative sample; a sample set is constructed based on the multi-set positive samples and the multi-set negative samples.
In some embodiments, the prediction module is specifically configured to: splicing entities and relations contained in the multi-element group samples, inputting the splicing results into a hidden layer in a to-be-trained representation learning model, and extracting vectors from the splicing results through the hidden layer; the vector extracted by the hidden layer is used as the representation vector of the multi-element group sample.
In some embodiments, the prediction module is specifically configured to: respectively inputting entities and relations contained in the multi-element group sample into a hidden layer in a representation learning model to be trained, and respectively extracting vectors from the inputted entities and relations through the hidden layer to obtain entity representation vectors and relation representation vectors; and fusing the entity representation vector and the relation representation vector to obtain a representation vector of the multi-group sample.
In some embodiments, the update module is specifically configured to: obtaining a rationality prediction score corresponding to each of at least one multi-element group sample of batch training and a rationality labeling score corresponding to each of at least one multi-element group sample; for each multi-group sample, determining training loss of the aimed multi-group sample according to the rationality prediction score and the rationality labeling score of the aimed multi-group sample; and determining model loss according to the training loss corresponding to each of at least one multi-group sample trained in batch.
In some embodiments, the update module is specifically configured to: adjusting model parameters representing a learning model to be trained according to model loss; calculating model loss continuously based on the adjusted model and the sample set, and adjusting model parameters continuously based on the calculated model loss until the local training stopping condition is met; and taking the model parameters obtained when the local training is stopped as updated model parameters.
In some embodiments, the encryption module is specifically configured to: acquiring a plurality of noise values which are matched with the number of the updated model parameters and accord with preset distribution; and respectively carrying out encryption processing on the updated model parameters through the noise values to obtain encryption parameters.
In some embodiments, the plurality of sets of encryption parameters are obtained by performing model training on each of the plurality of clients locally on the client and then sending the model training to the server, and the global model parameters are obtained by performing fusion processing on the plurality of sets of encryption parameters by the server.
In some embodiments, the hidden layer is used for extracting a representation vector of each entity in the multiple groups, and the acquisition module is further used for extracting the vector of each entity contained in the knowledge graph through the hidden layer in the trained representation learning model to obtain the representation vector of each entity; clustering the representation vectors of the entities to obtain a plurality of clusters; wherein each cluster corresponds to an entity class; determining the entity category to which each entity belongs based on the cluster to which each entity belongs
In some embodiments, the hidden layer is used for extracting a representation vector of each entity in the multiple groups, and the acquisition module is further used for extracting the vector of the target entity marked with the category on the knowledge graph through the hidden layer in the trained representation learning model to obtain the representation vector of the target entity; training the entity classification model to be trained based on the representation vector of the target entity and the category of the target entity to obtain a trained entity classification model.
In some embodiments, the obtaining module is further configured to extract, through a hidden layer in the training-completed representation learning model, a representation vector of the to-be-predicted tuple; a rationality prediction score for the to-be-predicted tuple is determined based on the representation vector for the to-be-predicted tuple, and whether to supplement the to-be-predicted tuple to the knowledge-graph is determined based on the rationality prediction score for the to-be-predicted tuple.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
constructing a sample set based on the locally stored knowledge graph, the sample set comprising a plurality of multi-element samples;
Extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector;
determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss;
encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters;
and continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
In a fourth aspect, the present application also provides a computer-readable storage medium. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
constructing a sample set based on the locally stored knowledge graph, the sample set comprising a plurality of multi-element samples;
extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector;
Determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss;
encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters;
and continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
In a fifth aspect, the present application also provides a computer program product. Computer program product comprising a computer program which, when executed by a processor, realizes the steps of:
constructing a sample set based on the locally stored knowledge graph, the sample set comprising a plurality of multi-element samples;
extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector;
determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss;
Encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters;
and continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
The knowledge graph processing method, the device, the computer equipment, the storage medium and the computer program product construct a sample set based on the locally stored knowledge graph, wherein the sample set comprises a plurality of multi-element group samples, and the representation vectors of the multi-element group samples are extracted through the hidden layer in the representation learning model to be trained, so that the representation learning model to be trained has the characteristics of simple and flexible structure, small calculated amount, quick response and the like due to the structural design of the hidden layer. After the representation vector of the multi-group sample is obtained, determining a rationality prediction score of the multi-group sample based on the representation vector, determining model loss according to the rationality prediction score and the rationality labeling score of the multi-group sample, and updating model parameters representing a learning model to be trained based on the model loss. The updated model parameters are encrypted to obtain encrypted parameters, so that privacy protection is carried out on the model parameters obtained through local training, leakage of the model parameters in the training process is prevented, and after the encrypted parameters are obtained, the encrypted parameters are sent to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters. And finally, continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed. Under the condition that the local private knowledge graph does not need to be shared, the server is used as a bridge, multi-terminal collaborative training is realized, the representation effect of the representation learning model is realized and improved on the premise of protecting the privacy safety of data, and the data leakage is prevented.
Drawings
FIG. 1 is an application environment diagram of a knowledge graph processing method in one embodiment;
FIG. 2 is a flow chart of a knowledge graph processing method in one embodiment;
FIG. 3 is an exemplary diagram of a knowledge-graph in one embodiment;
FIG. 4 is an exemplary diagram of a knowledge graph in another embodiment;
FIG. 5 is an exemplary diagram of a knowledge-graph in yet another embodiment;
FIG. 6 is a schematic diagram of a mold structure in one embodiment;
FIG. 7 is a schematic diagram of a mold structure in another embodiment;
FIG. 8 is a flow chart of determining a category to which an entity belongs in one embodiment;
FIG. 9 is a schematic diagram of a clustering process in one embodiment;
FIG. 10 is a schematic diagram of a flow for obtaining an entity classification model in one embodiment;
FIG. 11 is a schematic diagram of a knowledge graph update process in one embodiment;
FIG. 12 is a flowchart of a knowledge graph processing method according to another embodiment;
FIG. 13 is a block diagram showing a knowledge-graph processing apparatus in one embodiment;
FIG. 14 is a block diagram showing a knowledge-graph processing apparatus according to another embodiment;
fig. 15 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The knowledge graph processing method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the application environment is made up of a plurality of terminals (such as terminals 102a and 102b shown in fig. 1, etc.) and a server 104. Each terminal may communicate with server 104 over a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on the cloud or other servers. Each terminal in fig. 1 may interact with the server 104 to implement the knowledge-graph processing method provided by the embodiment of the present application, so as to obtain a training-completed representation learning model. Taking one of the terminals 102a as an example: the terminal 102a may construct a sample set comprising a plurality of multi-tuple samples based on the locally stored knowledge-graph; extracting a representation vector of the multi-element group sample through a hidden layer in a representation learning model to be trained, and determining a rationality prediction score of the multi-element group sample based on the representation vector; and determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss. After obtaining the updated model parameters, the terminal 102a encrypts the updated model parameters to obtain encrypted parameters, and sends the encrypted parameters to the server 104 to instruct the server 104 to determine global model parameters based on the received multiple sets of encrypted parameters. The terminal 102a may continue training the representation learning model to be trained based on the global model parameters until the global training stop condition is met, thereby obtaining a trained representation learning model.
The terminal can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things equipment and portable wearable equipment, and the internet of things equipment can be smart speakers, smart televisions, smart air conditioners, smart vehicle-mounted equipment and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services.
The knowledge graph processing method provided by the embodiment of the application can be applied to the field of artificial intelligence (Artificial Intelligence, AI), wherein the artificial intelligence is the theory, method, technology and application system which utilizes a digital computer or a machine controlled by the digital computer to simulate, extend and expand the intelligence of a person, sense the environment, acquire knowledge and acquire the best result by using the knowledge. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The representation Learning model and the entity classification model related by the embodiment of the application can be realized through Machine Learning (ML), and the Machine Learning is a multi-field interdisciplinary and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, confidence networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
In one embodiment, as shown in fig. 2, a knowledge graph processing method is provided, and the method is applied to any terminal in fig. 1 for illustration, and includes the following steps:
step 202, constructing a sample set based on a locally stored knowledge-graph, the sample set comprising a plurality of multi-element samples.
The terminal for executing the knowledge graph processing method provided by the embodiment of the application can be deployed by a plurality of institutions with private knowledge graphs, and each institution can store the private knowledge graph in the local storage device. When the terminal executes the knowledge graph processing method provided by the embodiment of the application, a sample set can be constructed based on the private knowledge graph stored in the local storage device.
It should be noted that: the local storage device for storing the private knowledge graph may be a terminal deployed by a corresponding organization, or may be a storage device specially used for storing data, which is not limited in the embodiment of the present application.
The plurality of institutions with private knowledge patterns can belong to the same field, and the private knowledge patterns owned by the institutions can be crossed, that is, the same entity exists. For example, a plurality of institutions having private knowledge patterns may belong to the medical field, and the private knowledge patterns owned by each institution may include entities such as diseases, symptoms, medicines, medicine descriptions, medical instruments, and the like.
The following is illustrative:
mechanism 1, mechanism 2 and structure 3 are three mechanisms that belong to the medical field, see the private knowledge graph that mechanism 1 possess that the fig. 3 shows includes: entity 1, entity 2, entity 3, entity 4, entity 5, entity 6 and entity 7, the relationship between entity 1 and entity 2 being relationship 1, the relationship between entity 1 and entity 3 being relationship 3, the relationship between entity 1 and entity 4 being relationship 2, the relationship between entity 3 and entity 5 being relationship 4, the relationship between entity 3 and entity 6 being relationship 5, the relationship between entity 3 and entity 7 being relationship 6. Referring to fig. 4, the private knowledge graph owned by the organization 2 includes: entity 3, entity 5, entity 8, entity 9, entity 10, entity 11, entity 12 and entity 13, the relationship between entity 3 and entity 5 being relationship 4, the relationship between entity 3 and entity 8 being relationship 5, the relationship between entity 3 and entity 9 being relationship 6, the relationship between entity 5 and entity 10 being relationship 7, the relationship between entity 8 and entity 11 being relationship 8, the relationship between entity 8 and entity 12 being relationship 9, the relationship between entity 9 and entity 13 being relationship 10. Referring to fig. 5, the private knowledge graph owned by the organization 3 includes: entity 5, entity 14, entity 15, entity 16, entity 17 and entity 18, the relationship between entity 14 and entity 5 being relationship 4, the relationship between entity 5 and entity 15 being relationship 7, the relationship between entity 16 and entity 17 being relationship 8, the relationship between entity 16 and entity 18 being relationship 9. The private knowledge graph owned by the organization 1 and the private knowledge graph owned by the organization 2 both comprise an entity 3 and an entity 5, and the relationship between the entity 3 and the entity 5 is a relationship 4. The private knowledge graph owned by the organization 1 and the private knowledge graph owned by the organization 3 both comprise an entity 5, the relationship between the entity 3 and the entity 5 is a relationship 4 in the private knowledge graph owned by the organization 1, and the relationship between the entity 14 and the entity 5 is a relationship 4 in the private knowledge graph owned by the organization 3.
For example, in the private knowledge graph owned by the organization 1 illustrated in fig. 3, the entity 1 may be a disease 1, the entity 2 may be a symptom 1, and the relationship 1 may be a symptom related to the disease. Entity 3 may be treatment regimen 1 and relationship 3 may be a treatment regimen involved in the disease. Entity 4 may be complication 1 and relationship 2 may be a complication involved in the disease. Entity 5 may be drug 1 and relationship 4 may be a drug involved in a therapeutic regimen. The entity 6 may be a medical device 1 and the relationship 5 may be a medical device involved in a treatment regimen. Entity 7 may be at risk level 1 and relationship 6 may be at risk level of the treatment regimen. It should be noted that: this example is merely used to illustrate the meaning of a knowledge graph, which includes specific entities and relationships, and embodiments of the present application are not limited.
In some embodiments, the terminal may construct a sample set based on the entire knowledge-graph stored locally, or may extract a partial graph from the entire knowledge-graph stored locally, and construct a sample set based on the partial graph. The embodiment of the present application is not limited thereto.
The tuples mentioned in the embodiment of the present application may be adapted to a structural unit of a knowledge graph, and exemplary, the tuples referred in the embodiment of the present application may be triples, where the triples include a head entity, a tail entity, and a relationship between the head entity and the tail entity. The implementation of the present application is described below using a tuple as a triplet as an example.
In some embodiments, after the terminal extracts a partial graph from the locally stored entire knowledge graph, the extracted partial graph may be extracted into a form of a triplet set, each triplet in the triplet set may be used as a triplet positive sample, two entities that do not have a relationship are randomly selected from all the entities included in the triplet set, one of the relationships is randomly selected from all the relationships included in the triplet set, a triplet negative sample is constructed based on the two entities that do not have a relationship and the randomly selected relationship, and a sample set is constructed based on the triplet positive sample and the triplet negative sample.
The following is illustrative:
the sample set can be constructed by any terminal deployed by using the method provided by the implementation of the present application, taking the entity 1 having the private knowledge graph shown in fig. 3 as an example, the entity 1 deployed by the entity 1 can extract the private knowledge graph shown in fig. 1 into a form of a triplet set, and the obtained triplet set is { (head entity 1, relationship 1, tail entity 2), (head entity 1, relationship 3, tail entity 3), (head entity 1, relationship 2, tail entity 4), (head entity 3, relationship 4, tail entity 5), (head entity 3, relationship 5, tail entity 6), (head entity 3, relationship 6, tail entity 7) and then each triplet in the triplet set can be used as a triplet positive sample, and then the entity and the relationship can be randomly selected to construct a triplet negative sample, for example, (head entity 1, relationship 1, tail entity 5), (head entity 4, relationship 3, tail entity 3), (head entity 2, relationship 2, and tail entity 7) can be used as the triplet negative samples. Finally, (head entity 1, relation 1, tail entity 2), (head entity 1, relation 3, tail entity 3), (head entity 1, relation 2, tail entity 4), (head entity 3, relation 4, tail entity 5), (head entity 3, relation 5, tail entity 6), (head entity 3, relation 6, tail entity 7), (head entity 1, relation 1, tail entity 5), (head entity 4, relation 3, tail entity 3), (head entity 2, relation 2, tail entity 7) can be used as a triplet sample in the sample set, and these sample constitution sets can be referred to as sample sets.
Step 204, extracting a representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector.
The representation learning model to be trained can adopt a multi-layer perceptron structure, and the representation learning model to be trained can adopt a two-layer perceptron structure.
In some embodiments, the representation learning model to be trained includes two hidden layers, one for determining a representation vector of the triplet sample and the other for rationally predicting the triplet sample. For convenience of explanation, the former hidden layer is referred to as a first hidden layer, and the latter hidden layer is referred to as a second hidden layer. The terminal can input the triplet sample into a first hiding layer, determine the representation vector of the triplet sample through the first hiding layer, input the representation vector of the triplet sample into a second hiding layer, carry out rationality prediction on the triplet sample by the second hiding layer, and output the rationality prediction score of the triplet sample.
In some embodiments, the first hidden layer has a capability of extracting the whole expression vector of the triplet, the terminal may splice the entities and relations contained in the triplet sample, input the splice result into the first hidden layer, extract the vector of the splice result through the first hidden layer, and use the vector extracted by the first hidden layer as the expression vector of the triplet sample.
In some embodiments, the first hidden layer has a capability of extracting an entity representation vector and a relationship representation vector, the terminal may input the entity and the relationship included in the triplet sample into the first hidden layer respectively, perform vector extraction on the input entity and relationship through the first hidden layer respectively to obtain the entity representation vector and the relationship representation vector, and splice the entity representation vector and the relationship representation vector to obtain the representation vector of the triplet sample.
And 206, determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing the learning model to be trained based on the model loss.
The rationality labeling score of each triplet sample may be obtained through manual labeling or through a labeling algorithm, which is not limited in the embodiment of the present application.
In some embodiments, after obtaining the rationality prediction score and the rationality labeling score of the triplet sample, the terminal may bring the rationality prediction score and the rationality labeling score into corresponding loss functions to obtain training loss of the triplet sample, and determine model loss based on the training loss.
In some embodiments, the training process may be performed in batch, the number of a batch of triplet samples may be flexibly set according to an actual situation, when the terminal performs model training by using a certain batch of triplet samples, for each sample in the batch of triplet samples, the terminal may obtain a rationality prediction score of the sample by expressing a learning model, then calculate, based on the rationality prediction score and the rationality labeling score of the sample, a training loss of the sample, and finally determine a model loss according to the training loss corresponding to each triplet sample in the batch of triplet samples.
In some embodiments, after determining the model loss, the terminal may adjust the model parameters representing the learning model based on the model loss, repeat the batch training process based on the adjusted model until the local training stop condition is met, and use the model parameters obtained when the local training is stopped as updated model parameters.
The local training stop condition may be flexibly set according to actual situations, and exemplary, the local training stop condition may be that the number of adjustment times of the model parameter reaches a preset number of times threshold, or that the adjusted model prediction effect reaches a preset index, or the like.
And step 208, performing encryption processing on the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to the server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters.
The terminal can acquire noise values corresponding to the updated model parameters after obtaining the updated model parameters, and the updated model parameters are encrypted through the noise values to obtain encrypted parameters.
In some embodiments, after obtaining noise values corresponding to the plurality of updated model parameters, the terminal may add the corresponding noise values to the plurality of updated model parameters, respectively, and use the added result as the corresponding encryption parameter.
In some embodiments, after obtaining the encryption parameters, the terminal may send the encryption parameters to a server, where the server may receive multiple sets of encryption parameters sent from multiple terminals, and the server generates global model parameters based on the multiple sets of encryption parameters.
And 210, continuing training the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
The terminal can download global model parameters from the server, update model parameters in the representation learning model to the global model parameters, and continue training based on the updated model and the multi-group samples in the sample set until the global training stop condition is met, so that the trained representation learning model is obtained.
The global training stop condition may be that the number of times of adjustment of the model parameter reaches a preset number of times threshold, or loss decrease corresponding to continuous preset number of times of adjustment is lower than a preset decrease value.
In the above embodiment, the sample set is constructed based on the locally stored knowledge graph, and the sample set includes a plurality of multi-group samples, and the representation vectors of the multi-group samples are extracted through the hidden layer in the representation learning model to be trained, so that the representation learning model to be trained has the characteristics of simple and flexible structure, small calculation amount, quick response and the like due to the structural design of the hidden layer. After the representation vector of the multi-group sample is obtained, determining a rationality prediction score of the multi-group sample based on the representation vector, determining model loss according to the rationality prediction score and the rationality labeling score of the multi-group sample, and updating model parameters representing a learning model to be trained based on the model loss. The updated model parameters are encrypted to obtain encrypted parameters, so that privacy protection is carried out on the model parameters obtained through local training, leakage of the model parameters in the training process is prevented, and after the encrypted parameters are obtained, the encrypted parameters are sent to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters. And finally, continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed. Under the condition that the local private knowledge graph is not required to be shared, the server is used as a bridge, multi-terminal collaborative training is realized, the representation effect of the representation learning model is improved on the premise of protecting privacy, and data leakage is prevented.
In some embodiments, the multi-tuple samples comprise a multi-tuple positive sample and a multi-tuple negative sample, the step of constructing a sample set based on the locally stored knowledge-graph comprising: extracting a plurality of real multiple groups from a locally stored knowledge graph to serve as multiple group positive samples; extracting a plurality of entities without relations from the knowledge graph, and randomly selecting the relations from the knowledge graph; combining the extracted entities with the randomly selected relationship to obtain a plurality of false tuples, and taking the false tuples as a tuple negative sample; a sample set is constructed based on the multi-set positive samples and the multi-set negative samples.
The terminal can extract the triples from the locally stored knowledge graph, the extracted triples are used as real triples, and the extracted triples can be used as triples positive samples.
In order to construct a triplet positive sample, the terminal can extract two entities without relation from the locally stored knowledge-graph, randomly select a relation from the locally stored knowledge-graph, and combine the extracted two entities with the randomly selected relation to obtain the false triplet. The above process is repeatedly performed, so that a plurality of false triples can be obtained, and the false triples can be used as a triplet negative sample. The set of triple positive samples and triple negative samples may be referred to as a sample set.
The following is illustrative:
taking the organization 1 having the private knowledge graph shown in fig. 1 as an example, the terminal deployed by the organization 1 may extract (head entity 1, relationship 1, tail entity 2), (head entity 1, relationship 3, tail entity 3), (head entity 1, relationship 2, tail entity 4), (head entity 3, relationship 4, tail entity 5), (head entity 3, relationship 5, tail entity 6), (head entity 3, relationship 6, tail entity 7) from the private knowledge graph shown in fig. 1, and the 6 real triples may be taken as triple positive samples. Two entities which do not have a relation, such as entity 2 and entity 7, are extracted from 7 entities contained in the private knowledge graph shown in fig. 1, and one relation, such as relation 2, is randomly selected from 6 relations contained in the private knowledge graph shown in fig. 1, so that a false triplet (a head entity 2, a relation 2 and a tail entity 7) can be obtained by combining, and the false triplet can be used as a triplet negative sample. Finally, (head entity 1, relation 1, tail entity 2), (head entity 1, relation 3, tail entity 3), (head entity 1, relation 2, tail entity 4), (head entity 3, relation 4, tail entity 5), (head entity 3, relation 5, tail entity 6), (head entity 3, relation 6, tail entity 7), (head entity 2, relation 2, tail entity 7) can all be used as triple samples in the sample set, and these samples can be formed into a set called a sample set.
It should be noted that: in the above examples, only one false triplet is obtained by combining, and multiple false triples can be obtained by combining the same method.
In the above embodiment, on the one hand, the real triplet is extracted from the locally stored knowledge graph, the real triplet is used as the triplet positive sample, on the other hand, the false triplet is constructed based on the entity and the relation contained in the locally stored knowledge graph, the false triplet is used as the triplet negative sample, finally, the sample set is constructed based on the triplet positive sample and the triplet negative sample, and the sample set constructed in this way is used for training, so that the representation capability of the representation learning model is enhanced.
In some embodiments, the step of extracting the representation vector of the multi-element sample through the hidden layer in the representation learning model to be trained comprises: splicing entities and relations contained in the multi-element group samples, inputting the splicing results into a hidden layer in a to-be-trained representation learning model, and extracting vectors from the splicing results through the hidden layer; the vector extracted by the hidden layer is used as the representation vector of the multi-element group sample.
As shown in fig. 6, the representation learning model to be trained may be a two-layer perceptron structure, where the two-layer perceptron includes two hidden layers, one of which is referred to as a first hidden layer and the other hidden layer is referred to as a second hidden layer for convenience of description. Wherein the first hidden layer has the ability to extract the triplet global representation vector. The second hidden layer is used for reasonably predicting the multi-element group sample.
In some embodiments, the training process may be performed in batches, and the terminal, while training with a certain set of triplet samples, may determine its representation vector for each triplet sample in the set of triplet samples by: referring to fig. 6, the entity and the relation included in the triplet sample are spliced, the splicing result is input into a first hidden layer, the first hidden layer performs vector extraction on the splicing result, the vector output by the first hidden layer is used as the representation vector of the triplet sample, the vector output by the first hidden layer can be input into a second hidden layer, and the second hidden layer performs rationality prediction on the triplet sample based on the received vector to obtain the rationality prediction score of the triplet sample.
Wherein the rationality prediction score may be determined by equation 1:
f (h, r, t) =σ (Ag (B [ h, r, t ])) (equation 1)
Wherein f (h, r, t) represents a rationality prediction score of the triplet sample, [ h, r, t ] represents a splicing result of a head entity h, a tail entity t and a relation r between the head entity h and the tail entity t contained in the triplet sample, sigma represents a sigmoid activation function, g represents a tanh activation function, and A and B are model parameter matrixes.
The first hidden layer may perform vector extraction through g (B [ h, r, t ]), where g may be specifically expressed as:
the model parameter matrix B and the splicing result f (h, r, t) can be multiplied, and the multiplication result is substituted into g (x), so that the representation vector of the triplet sample can be obtained.
Wherein the second hidden layer may determine the rationality prediction score by σ (x) and the model parameter matrix a, and σ (x) may be specifically expressed as:
the model parameter matrix A and the vector output by the first hidden layer can be multiplied, and the multiplication result is substituted into sigma (x), so that the rationality prediction score of the triplet sample can be obtained.
In the above embodiment, the representation learning model to be trained is set to be a two-layer perceptron structure, wherein the first hidden layer has the capability of extracting the whole representation vector of the triplet, so that the representation vector of the triplet to be processed can be directly extracted by the first hidden layer in the reasoning stage for the downstream task.
In some embodiments, the step of extracting the representation vector of the multi-element sample through the hidden layer in the representation learning model to be trained comprises: respectively inputting entities and relations contained in the multi-element group sample into a hidden layer in a representation learning model to be trained, and respectively extracting vectors from the inputted entities and relations through the hidden layer to obtain entity representation vectors and relation representation vectors; and fusing the entity representation vector and the relation representation vector to obtain a representation vector of the multi-group sample.
Referring to fig. 7, the representation learning model to be trained may be a two-layer perceptron structure, where the two-layer perceptron includes two hidden layers, one of which is referred to as a first hidden layer and the other hidden layer is referred to as a second hidden layer for convenience of description. Wherein the first hidden layer has the ability to extract entity representation vectors as well as relationship representation vectors. The second hidden layer is used for reasonably predicting the multi-element group sample.
In some embodiments, the training process may be performed in batches, and the terminal, while training with a certain set of triplet samples, may determine its representation vector for each triplet sample in the set of triplet samples by: referring to fig. 7, entities and relations contained in the triplet sample are respectively input into first hidden layers, the first hidden layers respectively extract vectors of the input entities and relations to obtain entity expression vectors and relation expression vectors, and the obtained entity expression vectors and relation expression vectors are spliced to obtain expression vectors of the triplet sample. The representation vector of the triplet sample may be further input to a second concealment layer, which performs a rationality prediction on the triplet sample based on the received vector, resulting in a rationality prediction score for the triplet sample.
In the above embodiment, the representation learning model to be trained is set to a two-layer perceptron structure, where the first hidden layer has the capability of extracting the representation vector of the entity or the relationship, so that the representation vector of the entity or the representation vector of the relationship can be directly extracted through the first hidden layer in the reasoning stage for the downstream task. The model structure has the characteristics of simplicity, flexibility, small calculated amount, quick response and the like, and the training speed and the extraction speed of the expression vector in the reasoning stage are greatly improved.
In some embodiments, the step of determining the model loss based on the rationality prediction score and the rationality labeling score for the multi-component sample comprises: obtaining a rationality prediction score corresponding to each of at least one multi-element group sample of batch training and a rationality labeling score corresponding to each of at least one multi-element group sample; for each multi-group sample, determining training loss of the aimed multi-group sample according to the rationality prediction score and the rationality labeling score of the aimed multi-group sample; and determining model loss according to the training loss corresponding to each of at least one multi-group sample trained in batch.
The number of samples of each batch during batch training may be flexibly set according to practical situations, and for example, the number of samples of each batch may be 20, which is not limited in the embodiment of the present application.
In some embodiments, each time the terminal performs batch training, for each triplet sample in the batch, a rationality prediction score and a rationality label score corresponding to the triplet sample may be obtained, and model loss is determined based on the rationality prediction score and the rationality label score corresponding to each triplet sample in the batch, and the number of samples in the batch.
In some embodiments, the terminal may determine the model loss by the following formula:
wherein BCE represents model loss, y represents the rationality labeling score corresponding to the ith triplet sample,indicating the rationality prediction score corresponding to the ith triplet sample, N indicating the number of batch samples.
In the above embodiment, a batch training manner is adopted to calculate the model loss based on the multiple triples used by the current batch, so that the obtained model loss is derived from the contributions of the multiple triples, and the accuracy is higher.
In some embodiments, the step of updating model parameters representing the learning model to be trained based on model loss comprises: adjusting model parameters representing a learning model to be trained according to model loss; calculating model loss continuously based on the adjusted model and the sample set, and adjusting model parameters continuously based on the calculated model loss until the local training stopping condition is met; and taking the model parameters obtained when the local training is stopped as updated model parameters.
In some embodiments, after the model loss is calculated, the terminal may calculate a corresponding gradient by using a back propagation algorithm, and adjust model parameters representing the learning model to be trained by means of random gradient descent (Stochastic Gradient Descent, abbreviated as SGD).
The local training stopping condition can be that the model parameter adjustment times reach a preset time threshold.
After the model parameters representing the learning model to be trained are adjusted, the terminal can continue to perform batch training based on the adjusted model to obtain corresponding model loss, and adjust the model parameters representing the learning model to be trained again based on the obtained model loss until the number of times of model parameter adjustment reaches a preset number of times threshold. The terminal can use the model parameters obtained when the model parameter adjustment times reach the preset times threshold as updated model parameters.
In the above embodiment, in the local training process, the model parameters representing the learning model to be trained may be adjusted multiple times, the model parameters after the multiple adjustments are used as updated model parameters, the updated model parameters are subsequently encrypted, and the obtained encrypted parameters are sent to the server. Compared with the mode that the adjusted parameters are sent to the server once every time, the method reduces the interaction times of the server and improves training efficiency.
In some embodiments, the step of encrypting the updated model parameters to obtain encrypted parameters includes: acquiring a plurality of noise values which are matched with the number of the updated model parameters and accord with preset distribution; and respectively carrying out encryption processing on the updated model parameters through the noise values to obtain encryption parameters.
In the above embodiment, as shown in equation 1, the learning model to be trained has two model parameter matrices, namely, a model parameter matrix a and a model parameter matrix B. The model parameter matrix a includes a plurality of model parameters, the model parameter matrix B also includes a plurality of model parameters, and the adjustment of the model parameters in the embodiment of the present application refers to the adjustment of the model parameters in the model parameter matrix a and the model parameter matrix B.
In some embodiments, after obtaining the updated model parameters, the terminal may use a local differential privacy algorithm to encrypt the updated model parameters.
In some embodiments, after obtaining the updated model parameters, the terminal may transmit the number of model parameters to the noise generation interface, where the noise generation interface generates, through a preset function, a plurality of noise values that match the number of updated model parameters and conform to a preset distribution.
The preset function may be a laplace function, the mean and variance of the laplace function may be flexibly set according to actual conditions, and the corresponding preset distribution may be a laplace distribution.
In some embodiments, after obtaining a plurality of noise values that match the number of updated model parameters and conform to a preset distribution, the terminal may respectively add the plurality of noise values to the plurality of model parameters to obtain a plurality of encryption parameters, and the terminal further sends the encryption parameters to the server.
For example, assuming that the model parameter matrix a includes 9 model parameters, the model parameter matrix B includes 9 model parameters, the terminal sends the number 18 to the noise generation interface, the noise generation interface generates 18 noise values conforming to the laplace distribution through a laplace function with a mean value σ and a variance λ, and the 18 noise values can be added to the 18 model parameters respectively, so as to obtain 18 encryption parameters.
In the above embodiment, after obtaining the updated model parameters, the terminal encrypts the updated model parameters to obtain the encrypted parameters, and then sends the encrypted parameters to the server, so that privacy protection is performed on the model parameters obtained by local training, and leakage of the model parameters in the training process is prevented.
In some embodiments, the plurality of sets of encryption parameters are obtained by performing model training on each of the plurality of clients locally on the client and then sending the model training to the server, and the global model parameters are obtained by performing fusion processing on the plurality of sets of encryption parameters by the server.
When a plurality of institutions perform joint training, each of the terminals deployed by the institutions trains a to-be-trained representation learning model built locally based on a locally stored knowledge graph to obtain updated model parameters, and after the updated model parameters are encrypted, each of the terminals sends the encrypted parameters to a server, and the server can receive the encrypted parameters from a plurality of clients.
In some embodiments, after receiving the encryption parameters sent by the plurality of clients, that is, after receiving the plurality of sets of encryption parameters, the server may perform fusion processing on the plurality of sets of encryption parameters to obtain the global model parameters. The fusion process may be, for example, averaging, weighting, and the like, which is not limited in the embodiment of the present application.
In some embodiments, after the server receives multiple sets of encryption parameters, the global model parameters may be calculated by the following formula:
wherein P represents a global model parameter, P i Representing the i-th group plusThe secret parameter, N, represents the number of clients.
In some embodiments, the terminal may download global model parameters from the server and update model parameters representing the learning model to be trained to global model parameters; training is continued based on the updated model and the triplet samples in the sample set until the adjustment times of the model parameters reach a preset times threshold value, or loss reduction corresponding to continuous preset times of adjustment is lower than a preset reduction value.
In the above embodiment, after the server receives the encryption parameters sent from the plurality of clients, the server performs fusion processing on the plurality of groups of encryption parameters to obtain the global model parameters, the terminal may download the global model parameters from the server, and continuously train the representation learning model to be trained based on the global model parameters, and under the condition that the server is not required to share the local private knowledge graph, multi-terminal collaborative training is realized, and the representation effect of the representation learning model is improved on the premise of protecting privacy.
In some embodiments, the hidden layer is configured to extract a representation vector of each entity in the multi-element group, as shown in fig. 8, and the knowledge graph processing method provided by the embodiment of the present application further includes a step of determining a category to which the entity belongs, where the step specifically includes:
Step 801, extracting vectors of each entity included in the knowledge graph through a hidden layer in the training-completed representation learning model, so as to obtain a representation vector of each entity.
In the training stage, the representation learning model to be trained can be a two-layer perceptron structure, and the first hidden layer has the capability of extracting entity representation vectors and relationship representation vectors. The second hidden layer is used for reasonably predicting the multi-element group sample. In the reasoning stage after training is completed, vector extraction can be performed on the entity through the first hidden layer.
In some embodiments, all entities contained in the knowledge-graph may be extracted from the locally stored knowledge-graph, and for each entity extracted, the entity is input to a hidden layer in the trained representation learning model, which outputs an entity representation vector for the entity.
Step 802, clustering the representation vectors of the entities to obtain a plurality of clusters; wherein each cluster corresponds to an entity class.
Step 803, determining the entity category to which each entity belongs based on the cluster to which each entity belongs.
In some embodiments, after obtaining the entity expression vectors corresponding to the respective entities on the knowledge graph, the terminal may perform clustering processing on all the entity expression vectors, so as to obtain a plurality of clusters, where each cluster corresponds to one entity class, and for each entity on the knowledge graph, the cluster to which the entity expression vector of the entity belongs may be used as the cluster to which the entity belongs, and the entity type corresponding to the cluster to which the entity belongs may be used as the entity class to which the entity belongs.
The entity category corresponding to each cluster may be determined according to the commonality of the entity corresponding to each entity expression vector in the cluster, and for example, the entity category in the knowledge graph stored in the medical institution may include: diseases, symptoms, drugs, drug instructions, medical devices, etc.
The following is illustrative:
taking the knowledge graph shown in fig. 3 as an example, the knowledge graph shown in fig. 3 includes: entity 1, entity 2, entity 3, entity 4, entity 5, entity 6 and entity 7 are respectively input into hidden layers in the trained representation learning model, so that corresponding entity representation vector 1, entity representation vector 2, entity representation vector 3, entity representation vector 4, entity representation vector 5, entity representation vector 6 and entity representation vector 7 can be obtained. Referring to fig. 9, clustering is performed on entity expression vector 1, entity expression vector 2, entity expression vector 3, entity expression vector 4, entity expression vector 5, entity expression vector 6, and entity expression vector 7 to obtain cluster 1, cluster 2, and cluster 3, where cluster 1 includes entity expression vector 1, cluster 2 includes entity expression vector 2, entity expression vector 3, and entity expression vector 4, cluster 3 includes entity expression vector 5, entity expression vector 6, and entity expression vector 7, the entity class corresponding to cluster 1 is a disease, the entity class corresponding to cluster 2 is a symptom, the entity class corresponding to cluster 2 is a drug, and it can be determined that the entity class corresponding to entity 1 is a disease, the entity classes corresponding to entity 2, entity 3, and entity 4 are symptoms, and the entity classes corresponding to entity 5, entity 6, and entity 7 are drugs.
In some embodiments, after determining the entity class to which each entity in the locally stored knowledge graph belongs, the terminal may store the entity included in each entity class to obtain an entity search library. The entity category of the entity to be searched can be obtained, and whether the entity to be searched exists in the entity search library or not is searched based on the entity category of the entity to be searched.
In some embodiments, the terminal may search for an entity class to which the entity to be searched belongs from the entity search library, and search for whether the entity to be searched exists in the entity included in the searched entity class. Compared with the mode of searching the entity on the whole knowledge graph, the method reduces the searching range and greatly improves the searching efficiency.
For example, in the case that the locally stored knowledge graph includes three entity categories of a disease, a symptom and a drug, the entity included in the disease in the knowledge graph may be stored, the entity included in the symptom may be stored, and the entity included in the drug may be stored, so as to obtain the entity search library. The entity category of the entity to be searched can be obtained, and if the entity category of the entity to be searched is a disease, whether the entity to be searched exists in the entities contained in the disease in the entity search library is searched. And under the condition that the entity category to which the entity to be searched belongs is the symptom, searching whether the entity to be searched exists in the entity contained in the symptom in the entity search library. And searching whether the entity to be searched exists in the entities contained in the medicines in the entity search library under the condition that the entity category to which the entity to be searched belongs is the medicine.
In the above embodiment, after training to obtain the representation learning model with the capability of extracting the entity representation vector, vector extraction is performed on each entity on the knowledge graph through the representation learning model to obtain the entity representation vector corresponding to each entity, clustering is performed on each entity representation vector to obtain a plurality of clusters, the entity category to which each entity belongs is determined based on the entity category corresponding to each of the plurality of clusters, and the entity on the knowledge graph can be classified based on the entity category to which each entity belongs, so that the entity classification efficiency is greatly improved.
In some embodiments, the hidden layer is configured to extract a representation vector of each entity in the multi-element group, as shown in fig. 10, and the knowledge graph processing method provided by the embodiment of the present application further includes an acquisition step of an entity classification model, where the step specifically includes:
in step 1001, vector extraction is performed on the target entity marked with the category on the knowledge graph through the hidden layer in the training-completed representation learning model, so as to obtain the representation vector of the target entity.
Step 1002, training the entity classification model to be trained based on the representation vector of the target entity and the class of the target entity, to obtain a trained entity classification model.
In the training stage, the representation learning model to be trained can be a two-layer perceptron structure, and the first hidden layer has the capability of extracting entity representation vectors and relationship representation vectors. The second hidden layer is used for reasonably predicting the multi-element group sample. And in the reasoning stage after training is completed, vector extraction is carried out on the target entities marked with the categories on the knowledge graph through the first hidden layer.
In some embodiments, the terminal may extract the target entity labeled with the category from the knowledge graph, input the target entity to a hidden layer in the trained representation learning model, where the hidden layer outputs a representation vector of the target entity, construct a training sample set based on the representation vectors corresponding to the target entities, and train to obtain the entity classification model based on the training sample set and the category of the target entity.
In some embodiments, the terminal may input the representation vector in the training sample set to the entity classification model to be trained, the entity classification model to be trained outputs a prediction class, determines a loss function based on the prediction class and a labeling class of a corresponding entity, adjusts model parameters of the entity classification model to be trained based on the loss function, and continues training based on the adjusted model until reaching a training stop condition, thereby obtaining a trained entity classification model.
In some embodiments, after obtaining the trained entity classification model, the terminal may input the entities with unlabeled categories in the locally stored knowledge graph into the entity classification model respectively, so as to obtain entity categories to which the entities with unlabeled categories belong. After obtaining the entity category to which each entity in the knowledge graph belongs, the terminal can store the entity contained in each entity category to obtain an entity retrieval library. The entity category of the entity to be searched can be obtained, the entity category of the entity to be searched is searched from the entity search library, and whether the entity to be searched exists is searched in the entity contained in the searched entity category. Compared with the mode of searching the entity on the whole knowledge graph, the method reduces the searching range and greatly improves the searching efficiency.
In the above embodiment, based on the target entity marked with the category on the knowledge graph, the entity classification model is obtained through training, and the entity classification model can be used for classifying the entity without the marked category, so that the entity classification efficiency is greatly improved.
In some embodiments, referring to fig. 11, the method for processing a knowledge graph provided in the embodiment of the present application further includes a knowledge graph updating step, where the step specifically includes:
Step 1101, extracting a representation vector of the to-be-predicted multi-element group through a hidden layer in the trained representation learning model, and determining a rational prediction score of the to-be-predicted multi-element group based on the representation vector of the to-be-predicted multi-element group.
In the case that the model structure used in the training stage is the structure shown in fig. 6, the entity and the relation included in the to-be-predicted triplet may be spliced, the spliced result is input to a first hidden layer in the training-completed representation learning model, the first hidden layer performs vector extraction on the spliced result, the vector extracted by the first hidden layer is input to a second hidden layer, and the second hidden layer outputs the rational prediction score of the to-be-predicted triplet.
In the case that the model structure used in the training stage is the structure shown in fig. 7, the entity and the relationship included in the triplet to be predicted may be respectively input into the first hidden layer in the training-completed representation learning model, the first hidden layer respectively performs vector extraction on the input entity and relationship to obtain a corresponding entity representation vector and a corresponding relationship representation vector, the entity representation vector and the relationship representation vector may be fused to obtain a representation vector of the triplet to be predicted, and further the representation vector of the triplet to be predicted is input into the second hidden layer, where the second hidden layer outputs the rational prediction score of the multiple to be predicted.
In some embodiments, after extracting the representation vector of the to-be-predicted multi-element group through the first hidden layer, the terminal inputs the representation vector of the to-be-predicted multi-element group to the second hidden layer, and the second hidden layer performs rational prediction on the to-be-predicted multi-element group to obtain a rational prediction score of the to-be-predicted multi-element group.
Step 1102, determining whether to supplement the to-be-predicted tuples to the knowledge graph based on the rationality prediction scores of the to-be-predicted tuples.
In some embodiments, when obtaining the rationality prediction score of the to-be-predicted tuple, the terminal may determine whether the rationality prediction score meets a preset condition, if so, supplement the to-be-predicted tuple to the knowledge graph, and if not, not supplement the to-be-predicted tuple.
The preset condition may be that the rationality prediction score is greater than a preset score threshold, or that the rationality prediction score is within a preset score range, or the like, which is not limited in the embodiment of the present application.
In the above embodiment, the rationality of the to-be-predicted multi-element group in the training-completed representation learning model is used for prediction, so as to obtain the rationality prediction score of the to-be-predicted multi-element group, when the rationality prediction score meets a certain condition, the to-be-predicted multi-element group is considered to be reasonable, and then the to-be-predicted tri-element group is supplemented to the knowledge graph, so that the knowledge quantity of the knowledge graph is expanded.
In some embodiments, a knowledge graph processing method is provided, which is described by a terminal executing the method as an example, and the method includes:
extracting a plurality of real multiple groups from a locally stored knowledge graph to serve as multiple group positive samples; extracting a plurality of entities without relations from the knowledge graph, and randomly selecting the relations from the knowledge graph; combining the entities and the relations to obtain a plurality of false tuples, and taking the false tuples as a tuple negative sample; a sample set is constructed based on the multi-set positive samples and the multi-set negative samples.
Splicing entities and relations contained in the multi-element group samples, inputting the splicing results into a hidden layer in a to-be-trained representation learning model, and extracting vectors from the splicing results through the hidden layer; the vector extracted by the hidden layer is used as the representation vector of the multi-element group sample. Or respectively inputting the entities and the relations contained in the multi-element group sample into a hidden layer in the representation learning model to be trained, and respectively extracting vectors from the inputted entities and relations through the hidden layer to obtain entity representation vectors and relation representation vectors; and fusing the entity representation vector and the relation representation vector to obtain a representation vector of the multi-group sample. A rationality prediction score for the multi-tuple samples is determined based on the representation vector.
Obtaining a rationality prediction score corresponding to each of at least one multi-element group sample of batch training and a rationality labeling score corresponding to each of at least one multi-element group sample; for each multi-group sample, determining training loss of the aimed multi-group sample according to the rationality prediction score and the rationality labeling score of the aimed multi-group sample; and determining model loss according to the training loss corresponding to each of at least one multi-group sample trained in batch.
Adjusting model parameters representing a learning model to be trained according to model loss; calculating model loss continuously based on the adjusted model and the sample set, and adjusting model parameters continuously based on the calculated model loss until the local training stopping condition is met; and taking the model parameters obtained when the local training is stopped as updated model parameters.
Acquiring a plurality of noise values which are matched with the number of the updated model parameters and accord with preset distribution; and respectively carrying out encryption processing on the updated model parameters through the noise values to obtain encryption parameters. Transmitting the encryption parameters to a server to instruct the server to determine global model parameters based on the received multiple sets of encryption parameters; the multiple groups of encryption parameters are obtained by the fusion processing of the multiple groups of encryption parameters by the server, wherein the multiple groups of encryption parameters are obtained by the fusion processing of the multiple groups of encryption parameters by the server, and the multiple groups of encryption parameters are transmitted to the server after the multiple clients perform model training locally on the client.
And continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
Respectively extracting vectors of all entities contained in the knowledge graph through a hidden layer in the training-completed representation learning model to obtain representation vectors of all the entities; clustering the representation vectors of the entities to obtain a plurality of clusters; wherein each cluster corresponds to an entity class; and determining the entity category of each entity based on the cluster to which each entity belongs.
Extracting vectors of target entities marked with categories on the knowledge graph through a hidden layer in the training-completed representation learning model to obtain a representation vector of the target entities; training the entity classification model to be trained based on the representation vector of the target entity and the category of the target entity to obtain a trained entity classification model.
Extracting a representation vector of a to-be-predicted multi-element group through a hidden layer in the representation learning model after training; a rationality prediction score for the to-be-predicted tuple is determined based on the representation vector for the to-be-predicted tuple, and whether to supplement the to-be-predicted tuple to the knowledge-graph is determined based on the rationality prediction score for the to-be-predicted tuple.
In the above embodiment, the sample set is constructed based on the locally stored knowledge graph, and the sample set includes a plurality of multi-group samples, and the representation vectors of the multi-group samples are extracted through the hidden layer in the representation learning model to be trained, so that the representation learning model to be trained has the characteristics of simple and flexible structure, small calculation amount, quick response and the like due to the structural design of the hidden layer. After the representation vector of the multi-group sample is obtained, determining a rationality prediction score of the multi-group sample based on the representation vector, determining model loss according to the rationality prediction score and the rationality labeling score of the multi-group sample, and updating model parameters representing a learning model to be trained based on the model loss. The updated model parameters are encrypted to obtain encrypted parameters, so that privacy protection is carried out on the model parameters obtained through local training, leakage of the model parameters in the training process is prevented, and after the encrypted parameters are obtained, the encrypted parameters are sent to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters. And finally, continuing to train the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed. Under the condition that the local private knowledge graph is not required to be shared, the server is used as a bridge, multi-terminal collaborative training is realized, and the representation effect of the representation learning model is improved on the premise of protecting privacy.
In some embodiments, the knowledge graph processing method provided by the embodiment of the present application may be applied in a medical scenario, where a plurality of medical institutions in the medical field all store private knowledge graphs, the knowledge graphs include relationships among diseases, symptoms, medicines, etc., the knowledge graphs are very precious data resources for the medical institutions, and in order to jointly train and represent a learning model in combination with knowledge graphs stored in each institution under the condition of not sharing the data resources, the knowledge graph processing method provided by the embodiment of the present application may be adopted, as shown in fig. 12, so that the medical institutions participating in the co-training have: medical facility 1, medical facility 2, and medical facility 3 are examples, with each medical facility deploying a corresponding client. The client corresponding to the medical institution 1 is a client A, the client corresponding to the medical institution 2 is a client B, and the client corresponding to the medical institution 3 is a client C. The private knowledge graph locally stored in the medical institution 1 is a knowledge graph A, the private knowledge graph locally stored in the medical institution 2 is a knowledge graph B, and the private knowledge graph locally stored in the medical institution 3 is a knowledge graph C. Medical facility 1 may deploy local model a in client a, medical facility 2 may deploy local model B in client B, and medical facility 3 may deploy local model C in client C, with the same structure as local model a, local model B, and local model C. Client a, client B, and client C may federally train their respective local models using the methods provided by embodiments of the present application. Taking the client a as an example, the client a first constructs a sample set based on the knowledge-graph a, where the sample set includes a plurality of triplet samples. After initializing the model parameters in the local model A, extracting a representation vector of a triplet sample through a hidden layer in the local model A, determining a rationality prediction score of the triplet sample based on the representation vector, determining model loss according to the rationality prediction score and a rationality labeling score of the triplet sample, updating the model parameters of the local model A based on the model loss, encrypting the updated model parameters by adopting local differential privacy to obtain encryption parameters, and transmitting the encryption parameters to a server. The client B and the client C execute the same operation as the client A, and after receiving three sets of encryption parameters from the client A, the client B and the client C, the server determines global model parameters based on the three sets of encryption parameters. The client A, the client B and the client C download the global model parameters from the server, update the model parameters of the local model to the global model parameters, and repeat the training process based on the updated local model until the adjustment times of the model parameters reach a preset time threshold or loss reduction corresponding to continuous preset times of adjustment is lower than a preset reduction value.
It should be noted that, the application scenario provided above is only used for explaining the knowledge graph processing method of the present application, and the application of the knowledge graph processing method provided by the present application is not limited to the application scenario provided above. For example, the method and the device can be applied to a financial scene, in which a financial institution locally stores a knowledge graph related to financial knowledge, and can also be applied to a scientific scene, an educational scene and the like, and the embodiment of the application is not limited to the above.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a knowledge graph processing device for realizing the knowledge graph processing method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation of one or more embodiments of the knowledge-graph processing device provided below may refer to the limitation of the knowledge-graph processing method, which is not described herein.
In one embodiment, as shown in fig. 13, there is provided a knowledge-graph processing apparatus, including:
a construction module 1301 is configured to construct a sample set based on the locally stored knowledge-graph, where the sample set includes a plurality of multi-tuple samples.
A prediction module 1302 is configured to extract a representation vector of the multi-tuple samples through a hidden layer in the representation learning model to be trained, and determine a rational prediction score of the multi-tuple samples based on the representation vector.
The updating module 1303 is configured to determine a model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and update model parameters to be trained for representing the learning model based on the model loss.
The encryption module 1304 is configured to encrypt the updated model parameters to obtain encrypted parameters, and send the encrypted parameters to the server to instruct the server to determine global model parameters based on the received multiple sets of encrypted parameters.
And the obtaining module 1305 is used for continuing training the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
In some embodiments, the multi-tuple samples include a multi-tuple positive sample and a multi-tuple negative sample, construction module 1301 is specifically configured to: extracting a plurality of real multiple groups from a locally stored knowledge graph to serve as multiple group positive samples; extracting a plurality of entities without relations from the knowledge graph, and randomly selecting the relations from the knowledge graph; combining the extracted entities with the randomly selected relationship to obtain a plurality of false tuples, and taking the false tuples as a tuple negative sample; a sample set is constructed based on the multi-set positive samples and the multi-set negative samples.
In some embodiments, the prediction module 1302 is specifically configured to: splicing entities and relations contained in the multi-element group samples, inputting the splicing results into a hidden layer in a to-be-trained representation learning model, and extracting vectors from the splicing results through the hidden layer; the vector extracted by the hidden layer is used as the representation vector of the multi-element group sample.
In some embodiments, the prediction module 1302 is specifically configured to: respectively inputting entities and relations contained in the multi-element group sample into a hidden layer in a representation learning model to be trained, and respectively extracting vectors from the inputted entities and relations through the hidden layer to obtain entity representation vectors and relation representation vectors; and fusing the entity representation vector and the relation representation vector to obtain a representation vector of the multi-group sample.
In some embodiments, the update module 1303 is specifically configured to: obtaining a rationality prediction score corresponding to each of at least one multi-element group sample of batch training and a rationality labeling score corresponding to each of at least one multi-element group sample; for each multi-group sample, determining training loss of the aimed multi-group sample according to the rationality prediction score and the rationality labeling score of the aimed multi-group sample; and determining model loss according to the training loss corresponding to each of at least one multi-group sample trained in batch.
In some embodiments, the update module 1303 is specifically configured to: adjusting model parameters representing a learning model to be trained according to model loss; calculating model loss continuously based on the adjusted model and the sample set, and adjusting model parameters continuously based on the calculated model loss until the local training stopping condition is met; and taking the model parameters obtained when the local training is stopped as updated model parameters.
In some embodiments, the encryption module 1304 is specifically configured to: acquiring a plurality of noise values which are matched with the number of the updated model parameters and accord with preset distribution; and respectively carrying out encryption processing on the updated model parameters through the noise values to obtain encryption parameters.
In some embodiments, the plurality of sets of encryption parameters are obtained by performing model training on each of the plurality of clients locally on the client and then sending the model training to the server, and the global model parameters are obtained by performing fusion processing on the plurality of sets of encryption parameters by the server.
In some embodiments, the hidden layer is configured to extract a representation vector of each entity in the multi-element group, as shown in fig. 14, and the knowledge-graph processing apparatus provided by the embodiment of the present application further includes: the application module 1306 is configured to extract, by using a hidden layer in the training-completed representation learning model, vectors of each entity included in the knowledge graph, so as to obtain a representation vector of each entity; clustering the representation vectors of the entities to obtain a plurality of clusters; wherein each cluster corresponds to an entity class; determining the entity category to which each entity belongs based on the cluster to which each entity belongs
In some embodiments, the hidden layer is used for extracting a representation vector of each entity in the multiple groups, and the application module 1306 is further used for extracting a vector of the target entity marked with the category on the knowledge graph through the hidden layer in the trained representation learning model, so as to obtain a representation vector of the target entity; training the entity classification model to be trained based on the representation vector of the target entity and the category of the target entity to obtain a trained entity classification model.
In some embodiments, the application module 1306 is further configured to extract a representation vector of the to-be-predicted tuple through a hidden layer in the trained representation learning model; a rationality prediction score for the to-be-predicted tuple is determined based on the representation vector for the to-be-predicted tuple, and whether to supplement the to-be-predicted tuple to the knowledge-graph is determined based on the rationality prediction score for the to-be-predicted tuple.
The above-mentioned individual modules in the knowledge-graph processing apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and an internal structure diagram thereof may be as shown in fig. 15. The computer device includes a processor, a memory, an input/output interface, and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program when executed by a processor implements a knowledge-graph processing method.
It will be appreciated by those skilled in the art that the structure shown in fig. 15 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements are applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (15)

1. A knowledge graph processing method, characterized in that the method comprises:
constructing a sample set based on a locally stored knowledge graph, the sample set comprising a plurality of multi-tuple samples;
extracting a representation vector of the multi-group sample through a hidden layer in a representation learning model to be trained, and determining a rationality prediction score of the multi-group sample based on the representation vector;
Determining model loss according to the rationality prediction score and the rationality labeling score of the multi-element sample, and updating model parameters representing a learning model to be trained based on the model loss;
encrypting the updated model parameters to obtain encrypted parameters, and sending the encrypted parameters to a server to instruct the server to determine global model parameters based on the received multiple groups of encrypted parameters;
and training the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
2. The method of claim 1, wherein the multi-tuple samples comprise a multi-tuple positive sample and a multi-tuple negative sample, the constructing a sample set based on the locally stored knowledge-graph comprising:
extracting a plurality of real multiple groups from a locally stored knowledge graph to serve as multiple group positive samples;
extracting a plurality of entities without relations from the knowledge graph, and randomly selecting the relations from the knowledge graph;
combining the extracted entities with the randomly selected relationship to obtain a plurality of false tuples, and taking the false tuples as tuple negative samples;
A sample set is constructed based on the multi-set positive samples and the multi-set negative samples.
3. The method of claim 1, wherein extracting the representation vector of the multi-tuple sample by a hidden layer in a representation learning model to be trained comprises:
splicing entities and relations contained in the multi-group samples, inputting a splicing result into a hidden layer in a to-be-trained representation learning model, and extracting vectors from the splicing result through the hidden layer;
and taking the vector extracted by the hidden layer as a representation vector of the multi-group sample.
4. The method of claim 1, wherein extracting the representation vector of the multi-tuple sample by a hidden layer in a representation learning model to be trained comprises:
respectively inputting entities and relations contained in the multi-element group sample into a hidden layer in a representation learning model to be trained, and respectively extracting vectors from the inputted entities and relations through the hidden layer to obtain entity representation vectors and relation representation vectors;
and fusing the entity representation vector and the relation representation vector to obtain the representation vector of the multi-element group sample.
5. The method of claim 1, wherein the determining a model loss from the rationality prediction score and the rationality labeling score for the tuple of samples comprises:
obtaining a rationality prediction score corresponding to each of at least one multi-element group sample of batch training and a rationality labeling score corresponding to each of at least one multi-element group sample;
for each multi-group sample, determining training loss of the aimed multi-group sample according to the rationality prediction score and the rationality labeling score of the aimed multi-group sample;
and determining model loss according to the training loss corresponding to each of at least one multi-group sample trained in batch.
6. The method of claim 1, wherein updating model parameters representing a learning model to be trained based on the model loss comprises:
according to the model loss, adjusting model parameters representing a learning model to be trained;
calculating model loss continuously based on the adjusted model and the sample set, and adjusting model parameters continuously based on the calculated model loss until the local training stopping condition is met;
And taking the model parameters obtained when the local training is stopped as updated model parameters.
7. The method according to claim 1, wherein the updated model parameters are plural, and the encrypting the updated model parameters to obtain the encrypted parameters includes:
acquiring a plurality of noise values which are matched with the number of the updated model parameters and accord with preset distribution;
and respectively carrying out encryption processing on the updated model parameters through the noise values to obtain encryption parameters.
8. The method of claim 1, wherein the plurality of sets of encryption parameters are sent to the server after model training by each of the plurality of clients locally at the client, and the global model parameters are obtained by fusion processing of the plurality of sets of encryption parameters by the server.
9. The method according to any one of claims 1 to 8, wherein the hidden layer is used to extract a representation vector for each entity in the multi-tuple, the method further comprising:
respectively extracting vectors of all entities contained in the knowledge graph through a hidden layer in the trained representation learning model to obtain a representation vector of each entity;
Clustering the representation vectors of the entities to obtain a plurality of clusters; wherein each cluster corresponds to an entity class;
and determining the entity category of each entity based on the cluster to which each entity belongs.
10. The method according to any one of claims 1 to 8, wherein the hidden layer is used to extract a representation vector for each entity in the multi-tuple, the method further comprising:
extracting vectors of the target entities marked with the categories on the knowledge graph through a hidden layer in the training-completed representation learning model to obtain a representation vector of the target entities;
and training the entity classification model to be trained based on the representation vector of the target entity and the category of the target entity to obtain a trained entity classification model.
11. The method according to any one of claims 1 to 8, further comprising:
extracting a representation vector of a to-be-predicted multi-element group through a hidden layer in the representation learning model after training;
determining a rationality prediction score of the to-be-predicted tuple based on the representation vector of the to-be-predicted tuple, and determining whether to supplement the to-be-predicted tuple to the knowledge-graph based on the rationality prediction score of the to-be-predicted tuple.
12. A knowledge-graph processing apparatus, comprising:
a building module for building a sample set based on a locally stored knowledge-graph, the sample set comprising a plurality of multi-tuple samples;
the prediction module is used for extracting the representation vector of the multi-group sample through a hidden layer in the representation learning model to be trained, and determining the rationality prediction score of the multi-group sample based on the representation vector;
the updating module is used for determining model loss according to the rationality prediction score and the rationality labeling score of the multi-group sample, and updating model parameters representing a learning model to be trained based on the model loss;
the encryption module is used for carrying out encryption processing on the updated model parameters to obtain encryption parameters, and sending the encryption parameters to the server so as to instruct the server to determine global model parameters based on the received multiple groups of encryption parameters;
and the acquisition module is used for continuously training the representation learning model to be trained based on the global model parameters until the global training stopping condition is met, and obtaining the representation learning model after training is completed.
13. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 11 when the computer program is executed.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 11.
CN202310116522.7A 2023-01-30 2023-01-30 Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium Pending CN117217303A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310116522.7A CN117217303A (en) 2023-01-30 2023-01-30 Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310116522.7A CN117217303A (en) 2023-01-30 2023-01-30 Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117217303A true CN117217303A (en) 2023-12-12

Family

ID=89044914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310116522.7A Pending CN117217303A (en) 2023-01-30 2023-01-30 Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117217303A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117708680A (en) * 2024-02-06 2024-03-15 青岛海尔科技有限公司 Method and device for improving accuracy of classification model, storage medium and electronic device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117708680A (en) * 2024-02-06 2024-03-15 青岛海尔科技有限公司 Method and device for improving accuracy of classification model, storage medium and electronic device

Similar Documents

Publication Publication Date Title
Sreedevi et al. Application of cognitive computing in healthcare, cybersecurity, big data and IoT: A literature review
Zhang et al. Privacy-preserving double-projection deep computation model with crowdsourcing on cloud for big data feature learning
Liu et al. Keep your data locally: Federated-learning-based data privacy preservation in edge computing
WO2022105118A1 (en) Image-based health status identification method and apparatus, device and storage medium
WO2023179429A1 (en) Video data processing method and apparatus, electronic device, and storage medium
WO2022057433A1 (en) Machine learning model training method and related device
CN113191479B (en) Method, system, node and storage medium for joint learning
CN113822315A (en) Attribute graph processing method and device, electronic equipment and readable storage medium
Jiang et al. Distributed deep learning optimized system over the cloud and smart phone devices
WO2023213157A1 (en) Data processing method and apparatus, program product, computer device and medium
CN112257841A (en) Data processing method, device and equipment in graph neural network and storage medium
CN114742210A (en) Hybrid neural network training method, traffic flow prediction method, apparatus, and medium
CN117217303A (en) Knowledge graph processing method, knowledge graph processing device, computer equipment and storage medium
Gayakwad et al. Training time reduction in transfer learning for a similar dataset using deep learning
CN114334029A (en) Compound activity prediction method, network training method, device, medium, and apparatus
Ahmadi et al. Inductive and transductive link prediction for criminal network analysis
Krishnan et al. Federated Learning
Nguyen et al. Meta-learning and personalization layer in federated learning
CN114638823B (en) Full-slice image classification method and device based on attention mechanism sequence model
CN116523001A (en) Method, device and computer equipment for constructing weak line identification model of power grid
Khatun et al. Machine Learning based Advanced Crime Prediction and Analysis
Goyal et al. Internet of things information analysis using fusion based learning with deep Neural Network
CN114358186A (en) Data processing method and device and computer readable storage medium
Dagli et al. A proposed solution to build a breast cancer detection model on confidential patient data using federated learning
Tang [Retracted] Analysis of English Multitext Reading Comprehension Model Based on Deep Belief Neural Network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication