CN115221334A - Quantum computation-based knowledge graph completion method, device and system - Google Patents

Quantum computation-based knowledge graph completion method, device and system Download PDF

Info

Publication number
CN115221334A
CN115221334A CN202210720744.5A CN202210720744A CN115221334A CN 115221334 A CN115221334 A CN 115221334A CN 202210720744 A CN202210720744 A CN 202210720744A CN 115221334 A CN115221334 A CN 115221334A
Authority
CN
China
Prior art keywords
quantum
entity
knowledge graph
knowledge
data
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.)
Granted
Application number
CN202210720744.5A
Other languages
Chinese (zh)
Other versions
CN115221334B (en
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.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202210720744.5A priority Critical patent/CN115221334B/en
Publication of CN115221334A publication Critical patent/CN115221334A/en
Application granted granted Critical
Publication of CN115221334B publication Critical patent/CN115221334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Computational Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method, a device and a system for complementing a knowledge graph based on quantum computation, wherein the method comprises the following steps: inputting a triple, representing a head entity and a tail entity as quantum states, representing a relation as a quantum gate, initializing quantum parameters according to a preset rule, and generating the quantum states specific to the entities and the quantum gates specific to the relation; mapping the head entity of the triple into a target Hilbert space through a relationship, namely applying a quantum gate to a quantum state to execute quantum computation to obtain predicted entity embedding; and calculating the distance between the predicted entity embedded expression and the embedded expressions of all the entities in the knowledge graph, and optimizing through a loss function to ensure that the knowledge graph embedded expression model is converged, thereby completing the knowledge graph. The invention designs a knowledge graph embedding representation model QubitE, can keep quantum advantages, is light-weight and high-performance, and can be applied to knowledge graph automatic completion tasks in various scenes.

Description

Quantum computation-based knowledge graph completion method, device and system
Technical Field
The invention relates to the technical field of big data, artificial intelligence and knowledge maps, in particular to a method, a device and a system for complementing a knowledge map based on quantum computation.
Background
The knowledge graph is composed of points (entities) and edges (relationships between the entities), and is widely applied to knowledge-driven AI tasks, such as question-answering models, recommendation systems, search engines and the like. However, the knowledge-graph in the real world is always incomplete, missing many necessary edges. This problem can greatly affect the performance of downstream correlation algorithms. Knowledge Graph Embedding (KGE) is an effective method for predicting missing edges, and this task is called a link prediction task. Therefore, the KGE model is used for predicting missing edges in the knowledge graph and completing the knowledge graph, so that knowledge is more complete, and the method has special significance for improving the performance of downstream tasks.
Quantum-based KGE is an application of quantum mechanics in the field of knowledge representation. The two most classical quantum-based KGEs include QCEs and F-QCEs.
The QCE takes the hidden information of the entity as parameters to construct quantum states, and the prediction process is the process of acting the parameterized quantum gates on the quantum states. The fraction of a triplet depends on the measurement of the quantum state. However, measurements can lead to information loss, and then quantum dominance (i.e., the normalization constraints of quantum states and quantum gates resulting from probabilistic interpretation of quantum mechanics) can disappear with model optimization.
QCEs generate physical embedding through parameterized quantum gates acting on pure state quantum states. Entity embedding can be efficiently trained, and quantum advantages can be guaranteed. However, it is exposed to parameter explosion because it is expensive to prepare multiple quantum states.
In addition, these two methods perform poorly on the knowledge-graph completion (KGC) task.
Disclosure of Invention
The present invention is directed to solving, at least in part, one of the technical problems in the related art.
Therefore, the first objective of the invention is to provide a knowledge graph completion method based on quantum computation, which abstracts a knowledge graph data source into description data, automatically operates a completion device to complete a knowledge graph, and automatically releases the completed knowledge graph to serve data, so that a third party can conveniently obtain complete large-scale knowledge graph data resources, and a model can keep quantum advantages, and is light-weight and high in performance.
The second purpose of the invention is to provide a knowledge graph spectrum complementing device based on quantum computation.
The third purpose of the invention is to provide a data service system of a knowledge graph spectrum complementing device based on quantum computation.
In order to achieve the above object, a first aspect of the present invention provides a method for complementing a knowledge graph based on quantum computation, including the following steps:
inputting a triple, representing a head entity and a tail entity as quantum states, representing a relation as a quantum gate, initializing quantum parameters according to a preset rule, and generating the quantum states specific to the entities and the quantum gates specific to the relation; mapping the head entity of the triplet into a target hilbert space through a relationship based on the entity-specific quantum state and the relationship-specific quantum gate to apply the quantum gate to the quantum state to perform quantum computation, obtaining a predicted entity-embedded representation; and performing distance calculation on the predicted entity embedded expression and the embedded expressions of all the entities in the knowledge graph, and optimizing through a loss function to complement the knowledge graph.
The knowledge graph complementing method based on quantum computing, disclosed by the embodiment of the invention, is based on the knowledge graph complementing model Qubite, quantum advantages can be kept, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources.
The second aspect of the present invention provides a knowledge graph spectrum complementing device based on quantum computation, including:
the parameter initialization module is used for inputting the triples, representing the head entity and the tail entity as quantum states, representing the relationship as a quantum gate, initializing quantum parameters according to a preset rule and generating the quantum states specific to the entities and the quantum gates specific to the relationship;
a quantum computation module for mapping a head entity of the triplet into a target hilbert space via a relationship based on an entity-specific quantum state and a relationship-specific quantum gate to apply the quantum gate to the quantum state to perform quantum computation to obtain a predicted entity-embedded representation;
and the knowledge graph completion module is used for calculating the distance between the predicted entity embedded representation and the embedded representations of all the entities in the knowledge graph and optimizing through a loss function so as to complete the knowledge graph.
The knowledge graph complementing device based on quantum computing, disclosed by the embodiment of the invention, is based on the knowledge graph complementing model Qubite, the quantum advantages can be kept, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources.
The third aspect of the present invention provides a data service system of a knowledge graph spectrum complementing device based on quantum computation, including:
the knowledge graph data source management module is used for acquiring knowledge graph original data according to a plurality of knowledge graph data sources;
the data management module is used for reading the original data of the knowledge graph stored in the server side, generating first knowledge graph data through data conversion, and combining the first knowledge graph data to obtain second knowledge graph data;
the knowledge graph embedding representation module is used for carrying out iterative training on the knowledge graph embedding representation model by utilizing second knowledge graph data based on the knowledge graph supplementing device, predicting by utilizing the trained knowledge graph embedding representation model to obtain predicted triples, and fusing and outputting the second knowledge graph data and the predicted triples to obtain third knowledge graph data;
and the complemented knowledge-graph management module is used for receiving and issuing third knowledge-graph data.
The data service system of the knowledge graph complementing device based on quantum computing, disclosed by the embodiment of the invention, is based on the knowledge graph complementing model QubitE, quantum advantages can be kept, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flow diagram of a method for knowledgegraph completion based on quantum computing in accordance with an embodiment of the present invention;
FIG. 2 is an architecture diagram of a quantum-computation-based knowledge-graph completion according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a knowledge-map complementing device based on quantum computation according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data service system of a quantum-computing-based knowledge-graph completion apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of the data service system of fig. 4.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
The method, apparatus and system for quantum-computation-based knowledgegraph completion proposed according to an embodiment of the present invention will be described below with reference to the accompanying drawings, and first, the method for quantum-computation-based knowledgegraph completion proposed according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 2 is a diagram of a knowledge-graph completion architecture based on quantum computation, as shown in fig. 2, the upper part of the diagram is a quantum circuit, explaining a quantum computation module and a scoring module of a knowledge-graph completion method QubitE; the lower part is another quantum wire, where X is the quantum logic gate NOT gate, explaining how to manipulate the entity semantics without involvement of the relationship, a new entity NOT (h) can be created whose semantics in the entity semantic space are exactly opposite to the semantics of the h entity. In fig. 2, there are mainly 3 parts: the device comprises a quantum computing module, a triple scoring module and a quantum state and quantum gate preparation module. A quantum computing module: quantum computation is performed, responsible for acting relationship-specific quantum gates on entity-specific quantum states, providing an acted-on quantum state, i.e., a predicted entity-embedded representation. The triple scoring module: and carrying out triple scoring, wherein the triple scoring is calculated based on the embedded representation predicted by the quantum calculation module and the embedded representation of each entity in the knowledge graph, and the triple with the highest score is selected for completion. Quantum state and quantum gate fabrication module: and the auxiliary module is responsible for initializing quantum states and quantum gates in the quantum computing module. The module can ensure that the prepared quantum state and quantum gate meet the normalized constraint, thereby having quantum advantages.
FIG. 1 is a flow chart of a method for knowledgegraph completion based on quantum computing in accordance with an embodiment of the present invention.
As shown in fig. 1, the method for complementing a knowledge graph based on quantum computation comprises the following steps:
s1, inputting a triple, representing a head entity and a tail entity as quantum states, representing a relation as a quantum gate, initializing quantum parameters according to a preset rule, and generating the quantum states specific to the entities and the quantum gates specific to the relation.
As an example, this step is used to perform quantum state and quantum gate fabrication.
In particular, in order to efficiently prepare the quantum state and the quantum gate and ensure that the model can keep the quantum advantage in the process of model optimization, the invention provides a quantum state and quantum gate preparation module. This is an auxiliary module to speed up model convergence and improve model performance. The initialization of the entity parameters uses the following rules:
a real =cos(θ)
a img =sin(θ)cos(φ)
b real =sin(θ)sin(φ)cos(φ)
b img =sin(θ)sin(φ)sin(φ)
wherein a is real ,a img ,b real ,b img Are the real and imaginary parts of a and b, respectively. Theta, phi is the range from [ -pi, pi [ -pi [ ]]Generated by random sampling. The initialization of the relationship parameters is based on the extension of the entity parameter initialization method. The parameters a and b are the same as the entity parameter initialization method, the angle psi is from the range [ -pi, pi [ -pi [, ]]Generated by random sampling.
To initialize quantum parameters according to preset rules, generating entity-specific quantum states and relationship-specific quantum gates.
And S2, mapping the head entity of the triplet into a target Hilbert space through a relation based on the entity-specific quantum state and the relation-specific quantum gate so as to apply the quantum gate to the quantum state to execute quantum computation and obtain predicted entity embedded representation.
Specifically, a triplet (h, r, t) is given, wherein a head entity h, a relation r, and a tail entity t. Head and tail entities h and t are embedded into d-dimensional Hilbert space
Figure BDA0003711188280000041
Wherein each element of the d-dimensional vector is a 2-dimensional complex vector; the relation r is embedded as a d-dimensional vector r, each element of which is a 2x2 complex unitary matrix. r comprises two complex vectors r a And r b . We use r ai ,r bi ,h ai ,h bi ,t ai ,t bi Respectively represent r a ,r b ,h a ,h b ,t a ,t b The ith element of (1).
Further, the entity of the embodiment of the invention is in Hilbert space
Figure BDA0003711188280000043
The quantum state representation method in (1). The ith bit element of the entity embedding vector h is:
Figure BDA0003711188280000042
Figure BDA0003711188280000051
where d is the embedding dimension, h ai
Figure BDA0003711188280000052
And | h ai | 2 +|h bi | 2 =1, such that h = [ h = 1 ,h 2 ,...,h d ]。
The density matrix corresponding to entity h is:
Figure BDA0003711188280000053
the relationship-specific quantum gate of an embodiment of the present invention maps head entity h to a relationship-specific transformation of the target hilbert space. Since the quantum gate is unitary, the parameterized unitary matrix of the ith element with the relation embedded in the vector r is written as:
Figure BDA0003711188280000054
where d is the embedding dimension, r ai
Figure BDA0003711188280000055
And r ai | 2 +|r bi | 2 =1, such that r = [ r = 1 ,r 2 ,...,r d ]. This means that the determinant
Figure BDA00037111882800000510
Namely, it is
Figure BDA00037111882800000511
And (4) the reverse is realized.
Quantum gates are applied to the quantum states to perform quantum computation, i.e., a transformation r of a particular relationship is applied to the head entity h. The invention uses element-level transformations, i.e. a matrix multiplication is calculated for each bit element:
Figure BDA0003711188280000056
the converted quantum state is h r =[h r1 ,h r2 ,…,h rd ]。
And S3, performing distance calculation on the predicted entity embedded representation and the embedded representations of all the entities in the knowledge graph, and optimizing through a loss function to complete the knowledge graph.
In particular, the quantum states and quantum gates used in the present invention lie in a supercomplex space, and there is no need to actually measure the quantum states, but rather to distinguish the quantum states by a nuclear method. The triple fraction in the knowledge graph is a predicted quantum state h after the relation transformation acts on the head entity r Similarity with tail entity t<h r ,t>. In the training process, the similarity is maximized for positive example triples, and the similarity is minimized for negative example triples.
The distance function employed by the present invention is:
Figure BDA0003711188280000057
where Re (x) is a two-dimensional complex vector
Figure BDA0003711188280000058
The real-valued part of (1).
Figure BDA0003711188280000059
Is an element-level inner product that is performed per element of the vector.
Further, in order to optimize the model, the invention models the link prediction task into a classification task. The optimized loss function of the embodiment of the invention is as follows:
Figure BDA0003711188280000061
where γ is the hyperparameter, K is the number of negative samples, (h) i ,r i ,t i ) Is the ith negative sample triplet, σ is the sigmoid function, p (h) i ,r i ,t i ) Is a distribution function of the sampled negative samples, which depends on the negative sampling strategy. The embodiment of the invention adopts a uniform sampling strategy, namely, K negative samples are uniformly sampled from triples except the positive sample triples.
And finally calculating the triple scores, selecting the triple with the highest score, and completing the knowledge graph based on the triple with the highest score.
According to the knowledge graph complementing method based on quantum computing, quantum advantages can be kept based on the knowledge graph complementing model Qubite, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources.
In order to implement the foregoing embodiment, as shown in fig. 3, a second aspect of the present embodiment further provides a knowledge graph complementing apparatus 10 based on quantum computation, where the apparatus 10 includes: the system comprises a parameter initialization module 100, a quantum computation module 200 and a knowledge graph completion module 300.
A parameter initialization module 100, configured to input a triple, represent a head entity and a tail entity as quantum states, represent a relationship as a quantum gate, initialize quantum parameters according to a preset rule, and generate an entity-specific quantum state and a relationship-specific quantum gate;
a quantum computation module 200 for mapping the head entity of the triplet into a target hilbert space via a relationship based on the entity-specific quantum states and the relationship-specific quantum gates, to apply the quantum gates to the quantum states to perform quantum computation, to obtain a predicted entity-embedded representation;
a knowledge graph completion module 300, configured to perform distance calculation on the predicted entity embedded representation and the embedded representations of all entities in the knowledge graph, and perform optimization through a loss function to complete the knowledge graph.
As an example, assume that a knowledge-graph is stored in the form of triples, the knowledge-graph containing one triplet (apple, color, red), where "apple" and "red" are the head and tail entities, respectively, and "color" is the relationship. In the model training process, the head entity 'apple' and the relation 'color' are given, and the tail entity 'red' is hopefully predicted. Firstly, respectively embedding the 'apple' and the 'red' into quantum states, setting the quantum states as h Apple (Malus pumila) And t Red colour "color" is embedded as a quantum gate, set as r Colour(s) . Then quantum gate is acted on the head entity to obtain quantum state t for prediction Prediction =r Colour(s) h Apple (Malus pumila) . Finally, the predicted quantum state and the quantum states of all the entities are scored through a triple scoring module 200, and if a certain entity is a target entity, namely, the entity is red, the score is close to 1; otherwise the score for a non-target entity is close to 0. The highest scoring entity is the entity we have predicted. After the model is trained, the predicted entity is the target entity with higher probability.
According to the knowledge graph complementing device based on quantum computation, quantum advantages can be kept based on the knowledge graph complementing model QubitE, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources.
In order to implement the foregoing embodiments, as shown in fig. 4, a third aspect of the present embodiment further provides a data service system 400 of a knowledge graph spectrum complement apparatus based on quantum computation, including:
the knowledge graph data source management module 401 is used for acquiring knowledge graph original data according to a plurality of knowledge graph data sources;
the data management module 402 is configured to read original data of the knowledge-graph stored in the server, generate first knowledge-graph data through data conversion, and merge the first knowledge-graph data to obtain second knowledge-graph data;
the knowledge graph complementing module 403 is configured to perform iterative training on the knowledge graph embedded representation model by using the second knowledge graph data based on the knowledge graph complementing device, perform prediction by using the trained knowledge graph embedded representation model to obtain predicted triples, and perform fusion output on the second knowledge graph data and the predicted triples to obtain third knowledge graph data;
a completed knowledge-graph management module 404 for accepting and publishing the third knowledge-graph data.
Specifically, as shown in fig. 5, the data service system 400 of the present invention is divided into four main modules:
the to-be-supplemented knowledge graph data source management module 401: and storing and managing a plurality of knowledge graph data sources, and taking the knowledge graph data sources as agents to obtain knowledge graph original data from real data sources for the data management module to use. This module does not store the knowledge-graph data, but rather the description data of the data source. The data management module 402 requests the source data from the delegation module 401 according to the description of the data source, and then forwards the source data back to the data management module 402.
Data management module 402: and three core functions of data reading, data conversion and data transmission are provided. The data reading is mainly to obtain the knowledge graph data to be complemented, which is stored in the server end, then the input data format of the complementing method is generated through data conversion, and finally the data is transmitted to the knowledge fusion module for combination.
Knowledge completion module 403: and providing three core modules, namely a training module, a prediction module and a completion module. The training module carries out iterative training by using the method and the device for complementing the knowledge graph based on the quantum computation and utilizing the processed knowledge graph data, so that the model has the capability of complementing the knowledge graph. And the prediction module predicts by using the trained model to obtain a triple predicted by the model. And the completion module fuses the knowledge graph data and the predicted triple into a knowledge graph according to the prediction result and outputs the knowledge graph.
Complemented knowledge-graph management module 404: the data of the knowledge graph from the knowledge completion module 403 is received, the data of the unified knowledge graph is stored and managed, description data describing the knowledge graph as a data source is provided, and the knowledge graph is published as data service for downstream tasks to use.
As an example, assume that there are two data sources: and the source A and the source B are respectively positioned at the server A and the server B.
The server 1 runs a to-be-supplemented knowledge graph data source management module 401, and the description data records stored in the module are similar to those in table 1:
Figure BDA0003711188280000071
Figure BDA0003711188280000081
TABLE 1
Server 2 runs data management module 402.
The server 3 runs a knowledge complementing module 403.
Server 4 runs complemented knowledge-graph management module 404.
Operation of the data service system:
1) The server 2 initiates a request to the server 1 to obtain the description data of all the data sources for dynamically assembling the data conversion module. The client server 1 then requests the data of source a and the data of source B in turn.
2) Server 1 will in turn initiate a request to 123.123.123.1 and 123.123.123.123.2.
3) The server 2 receives the data of the server 1, executes a data reading module, a data conversion module and a data transmission module, converts the original knowledge graph data into a standard format, and forwards a plurality of knowledge graph data in the standard format to the server 3.
4) The server 3 receives the standard data of the server 2; firstly, operating a training module to enable a neural network model to have the capability of complementing a knowledge graph; then, a prediction module is operated to enable the trained neural network model to predict missing triples in the knowledge graph; and finally, operating a fusion module to fuse the original knowledge graph and the predicted triple into a knowledge graph and sending the knowledge graph to the server 4.
5) The server 4 receives the unified knowledge graph of the server 3 and publishes the knowledge graph as a data service. Third parties may subscribe to the service, pulling the knowledge graph onto their servers. The server 4 can be used as a data source to continuously provide data for the next data service system for automatic completion of the knowledge graph so as to construct a larger and more complete knowledge graph.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
According to the data service system of the knowledge graph complementing device based on quantum computing, quantum advantages can be kept based on the knowledge graph complementing model QubitE, and the model is light in weight and high in performance, so that a third party can conveniently obtain complete large-scale knowledge graph data resources, and the data service system can be applied to knowledge graph automatic complementing tasks in various scenes.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A knowledge graph complementing method based on quantum computation is applied to a knowledge graph embedded representation model, and comprises the following steps:
inputting a triple, representing a head entity and a tail entity as quantum states, representing a relation as a quantum gate, initializing quantum parameters according to a preset rule, and generating the quantum states specific to the entities and the quantum gates specific to the relation;
mapping the head entity of the triplet into a target hilbert space via a relationship based on the entity-specific quantum states and the relationship-specific quantum gates to perform quantum computation by applying the quantum gates to the quantum states to obtain a predicted entity-embedded representation;
and performing distance calculation on the predicted entity embedded expression and the embedded expressions of all the entities in the knowledge graph, and optimizing through a loss function to complement the knowledge graph.
2. The method according to claim 1, characterized by presetting a triplet (h, r, t) in which a head entity h, a relation r, a tail entity t, embedding the head and tail entities h and t into a d-dimensional Hilbert space
Figure FDA0003711188270000011
And each element of the d-dimensional vector is a 2-dimensional complex vector, the relation r is embedded into the d-dimensional vector r, each element of the vector r is a 2x2 complex unitary matrix, and r comprises two complex vectors r a And r b By r, using ai ,r bi ,h ai ,h bi ,t ai ,t bi Respectively represent r a ,r b ,h a ,h b ,t a ,t b The ith element of (2).
3. The method of claim 2, wherein the relational mapping of the head entity of the triplet into the target hilbert space based on the entity-specific quantum states and the relationship-specific quantum gates comprises:
the ith bit element of the entity embedding vector h is:
Figure FDA0003711188270000012
where d is the dimension of the embedding,
Figure FDA0003711188270000013
and | h ai | 2 +|h bi | 2 =1, such that h = [ h = 1 ,h 2 ,...,h d ];
The density matrix corresponding to entity h is:
Figure FDA0003711188270000014
mapping the head entity h to a relationship-specific transform of the target hilbert space through a relationship-specific quantum gate, writing the ith element parameterized unitary matrix of the relationship-embedded vector r as:
Figure FDA0003711188270000015
where d is the embedding dimension,
Figure FDA0003711188270000021
and r ai | 2 +|r bi | 2 =1, such that r = [ r = 1 ,r 2 ,...,r d ]Determinant
Figure FDA0003711188270000022
4. The method of claim 3, wherein applying quantum gates to the quantum states to perform quantum computations to obtain the predicted entity-embedded representation comprises:
applying quantum gates to the quantum states to perform quantum computation, applying a specific relationship transform r to the head entity h, computing a matrix multiplication for each bit element using an element-level transform:
Figure FDA0003711188270000023
the converted quantum state is h r =[h r1 ,h r2 ,…,h rd ]。
5. The method of claim 1, wherein the distance calculating the predicted embedded representation of the entity and the embedded representations of all entities in the knowledge-graph, and optimizing the distance calculating by a loss function to complement the knowledge-graph, comprises:
the preset distance function:
Figure FDA0003711188270000024
wherein Re (x) is a two-dimensional complex vector
Figure FDA0003711188270000025
The real-valued part of (a) is,
Figure FDA0003711188270000026
is an element-level inner product, which is performed per element of the vector;
optimizing the knowledge graph embedding representation model according to a loss function:
Figure FDA0003711188270000027
where γ is the hyperparameter, K is the number of negative samples, (h) i ,r i ,t i ) Is the ith negative sample triplet, σ is the sigmoid function, p (h) i ,r i ,t i ) The method is a distribution function of sampled negative samples, and adopts a uniform sampling strategy to uniformly sample K negative samples from triples except a positive sample triplet.
6. The method according to claim 1, wherein the preset rule is:
a real =cos(θ)
a img =sin(θ)cos(φ)
Figure FDA0003711188270000031
Figure FDA0003711188270000032
wherein, a real ,a img ,b real ,b img Is the real and imaginary parts of a and b, respectively, theta, phi being the range from [ -pi, pi [ -pi [ ], phi]The initialization of the relation parameter is based on the expansion of the entity parameter initialization method, the parameters a and b are the same as the entity parameter initialization method, and the angle psi is from the interval [ -pi, pi ^ pi]Generated by random sampling.
7. A knowledge graph spectrum complementing device based on quantum computation is characterized by comprising:
the parameter initialization module is used for inputting the triples, representing the head entity and the tail entity as quantum states, representing the relationship as quantum gates, initializing quantum parameters according to a preset rule and generating the quantum states specific to the entities and the quantum gates specific to the relationship;
a quantum computation module for mapping a head entity of the triplet into a target hilbert space via a relationship based on an entity-specific quantum state and a relationship-specific quantum gate to apply the quantum gate to the quantum state to perform quantum computation to obtain a predicted entity-embedded representation;
and the knowledge graph completion module is used for calculating the distance between the predicted entity embedded representation and the embedded representations of all the entities in the knowledge graph and optimizing through a loss function so as to complete the knowledge graph.
8. A data service system including the quantum computing-based knowledge-graph complementing device of claim 7, wherein the system further comprises:
the knowledge graph data source management module is used for acquiring knowledge graph original data according to a plurality of knowledge graph data sources;
the data management module is used for reading the original data of the knowledge graph stored in the server side, generating first knowledge graph data through data conversion, and combining the first knowledge graph data to obtain second knowledge graph data;
the knowledge complementing module is used for iteratively training the knowledge map embedded representation model by using the second knowledge map data based on the knowledge map complementing device, predicting by using the trained knowledge map embedded representation model to obtain a predicted triple, and fusing and outputting the second knowledge map data and the predicted triple to obtain third knowledge map data;
and the complemented knowledge-graph management module is used for receiving and issuing third knowledge-graph data.
CN202210720744.5A 2022-06-23 2022-06-23 Knowledge graph completion method, device and system based on quantum computation Active CN115221334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210720744.5A CN115221334B (en) 2022-06-23 2022-06-23 Knowledge graph completion method, device and system based on quantum computation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210720744.5A CN115221334B (en) 2022-06-23 2022-06-23 Knowledge graph completion method, device and system based on quantum computation

Publications (2)

Publication Number Publication Date
CN115221334A true CN115221334A (en) 2022-10-21
CN115221334B CN115221334B (en) 2024-07-16

Family

ID=83610794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210720744.5A Active CN115221334B (en) 2022-06-23 2022-06-23 Knowledge graph completion method, device and system based on quantum computation

Country Status (1)

Country Link
CN (1) CN115221334B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112182245A (en) * 2020-09-28 2021-01-05 中国科学院计算技术研究所 Knowledge graph embedded model training method and system and electronic equipment
US20210232915A1 (en) * 2020-01-23 2021-07-29 UMNAI Limited Explainable neural net architecture for multidimensional data
CN113742488A (en) * 2021-07-30 2021-12-03 清华大学 Embedded knowledge graph completion method and device based on multitask learning
CN113792881A (en) * 2021-09-17 2021-12-14 北京百度网讯科技有限公司 Model training method and device, electronic device and medium
CN114461816A (en) * 2022-01-27 2022-05-10 南京邮电大学 Realization method of information supplement semantic communication system based on knowledge graph
CN114511098A (en) * 2022-02-02 2022-05-17 上海图灵智算量子科技有限公司 Federal learning model based on quantum computation
CN114610900A (en) * 2022-03-14 2022-06-10 上海交通大学 Knowledge graph complementing method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210232915A1 (en) * 2020-01-23 2021-07-29 UMNAI Limited Explainable neural net architecture for multidimensional data
CN112182245A (en) * 2020-09-28 2021-01-05 中国科学院计算技术研究所 Knowledge graph embedded model training method and system and electronic equipment
CN113742488A (en) * 2021-07-30 2021-12-03 清华大学 Embedded knowledge graph completion method and device based on multitask learning
CN113792881A (en) * 2021-09-17 2021-12-14 北京百度网讯科技有限公司 Model training method and device, electronic device and medium
CN114461816A (en) * 2022-01-27 2022-05-10 南京邮电大学 Realization method of information supplement semantic communication system based on knowledge graph
CN114511098A (en) * 2022-02-02 2022-05-17 上海图灵智算量子科技有限公司 Federal learning model based on quantum computation
CN114610900A (en) * 2022-03-14 2022-06-10 上海交通大学 Knowledge graph complementing method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PANFENG CHEN ET AL: "QLogicE: Quantum Logic Empowered Embedding for Knowledge Graph Completion", 《KNOWLEDGE-BASED SYSTEMS》, 5 March 2022 (2022-03-05) *
王子涵;邵明光;刘国军;郭茂祖;毕建东;刘扬;: "基于实体相似度信息的知识图谱补全算法", 计算机应用, no. 11, 10 November 2018 (2018-11-10) *

Also Published As

Publication number Publication date
CN115221334B (en) 2024-07-16

Similar Documents

Publication Publication Date Title
CN113641826A (en) Entity alignment method, device and system for multi-source knowledge graph fusion
JP2022056316A (en) Character structuring extraction method and device, electronic apparatus, storage medium, and computer program
WO2019043540A1 (en) Text data representation learning using random document embedding
US20240233877A1 (en) Method for predicting reactant molecule, training method, apparatus, and electronic device
JP2023549070A (en) Face recognition from Unseen domain via learning semantic features
US20230117973A1 (en) Data processing method and apparatus
CN115937644B (en) Point cloud feature extraction method and device based on global and local fusion
CN114529757B (en) Cross-modal single-sample three-dimensional point cloud segmentation method
CN113254716B (en) Video clip retrieval method and device, electronic equipment and readable storage medium
CN110597956A (en) Searching method, searching device and storage medium
Mengoni et al. Facial expression recognition on a quantum computer
CN118075267A (en) Digital back-end service platform construction method based on design circuit
CN115221334B (en) Knowledge graph completion method, device and system based on quantum computation
CN116797850A (en) Class increment image classification method based on knowledge distillation and consistency regularization
CN115809322A (en) GPT 3-based question-answering system text generation method and device
Ren et al. On-device Online Learning and Semantic Management of TinyML Systems
Chen et al. Explainable Digital Currency Candlestick Pattern AI Learner
Jiang et al. LG-MLFormer: local and global MLP for image captioning
Wacker Random features for dot product kernels and beyond
Dong et al. Large Language Models (LLMs): Deployment, Tokenomics and Sustainability
Miao et al. A Renovated CNN‐Based Model Enhances KGC Task Performance
US20240127005A1 (en) Translating text using generated visual representations and artificial intelligence
Stein Quantum computing aided machine learning through quantum state fidelity
Wang et al. Self-Supervised Latent Space Optimization With Nebula Variational Coding
Li et al. Text-guided dual-branch attention network for visual question answering

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant