CN111523669A - Knowledge graph meta-information-based least-order relation model training method - Google Patents

Knowledge graph meta-information-based least-order relation model training method Download PDF

Info

Publication number
CN111523669A
CN111523669A CN202010151753.8A CN202010151753A CN111523669A CN 111523669 A CN111523669 A CN 111523669A CN 202010151753 A CN202010151753 A CN 202010151753A CN 111523669 A CN111523669 A CN 111523669A
Authority
CN
China
Prior art keywords
meta
model
training
parameters
knowledge graph
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
CN202010151753.8A
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.)
State Grid Zhejiang Yuhuan Power Supply Co ltd
Marketing Service Center of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
State Grid Zhejiang Yuhuan Power Supply Co ltd
Electric Power Research Institute of State Grid Zhejiang Electric Power 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 State Grid Zhejiang Yuhuan Power Supply Co ltd, Electric Power Research Institute of State Grid Zhejiang Electric Power Co Ltd filed Critical State Grid Zhejiang Yuhuan Power Supply Co ltd
Priority to CN202010151753.8A priority Critical patent/CN111523669A/en
Publication of CN111523669A publication Critical patent/CN111523669A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • 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
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/01Probabilistic graphical models, e.g. probabilistic networks

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)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Algebra (AREA)
  • Probability & Statistics with Applications (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a few-time relation model training method based on knowledge graph meta-information, and relates to a training method. Currently, relational model training requires a large amount of data. The invention comprises the following steps: 1) initializing meta-model parameters; 2) performing iterative multi-round training on the common relation to obtain trained meta-model parameters, wherein the training loop comprises the following steps: 201) randomly sampling the common relation and the corresponding support set and query set; 202) applying a loss gradient on the support set to obtain a temporary model parameter; 203) calculating gradient loss on the query set and the temporary model parameters, and applying and updating the meta-model parameters; 3) and training the few-time relation model by using the meta-model parameters as initialization parameters. The technical scheme divides the relationship into a common relationship and a few-time relationship, performs differential treatment, and corrects the hypothesis that each relationship has enough data for training; the model of the few-time relationship can be trained well only by needing little data, and the efficiency and the accuracy are improved.

Description

Knowledge graph meta-information-based least-order relation model training method
Technical Field
The invention relates to a training method, in particular to a few-time relation model training method based on knowledge graph meta-information.
Background
With the popularization and development of big data, large-scale knowledge maps storing a large amount of knowledge are more and more emphasized by people. Most knowledge maps are stored in the form of triples, for example, a triplet (Sichuan, province, and achievement) is a triplet, where Sichuan is a head entity, achievement is a tail entity, and province is a relationship between the head and tail entities, and the triplet represents the fact that the province of Sichuan is an achievement. This storage format is advantageous for storage on the internet. However, this form is discrete and thus not conducive to the computation of a knowledge graph. To address the computability problem of knowledge-graphs, methods of knowledge-graph representation learning are proposed, which aim to represent entities and relationships in knowledge-graphs as vectors in vector space. For a query (Sichuan, province, are), the representation learning method can easily give the predicted result of the tail entity, but lacks interpretability. Thus a multi-hop inference method of knowledge graph is proposed.
Specifically, for a query (head entity, relationship, are), the multi-hop inference of the knowledge-graph can be regarded as starting from the head entity (node in the graph), selecting the next relationship (edge in the graph) as an outgoing edge, and jumping to the next entity until the maximum number of hops is reached, the last located entity is the predicted tail entity, and the multi-hop path is an interpretable path.
A rare relationship is a definition in a knowledge graph, and specific meanings are those relationships that possess a small number of triples. In particular, a relationship may be considered a small-order relationship if the number of triples in the knowledge-graph to which it corresponds is less than a certain threshold.
MINERVA published on the 2017 NIPS conference was the earliest method to use reinforcement learning for knowledgegraph multi-hop inference. The method learns an agent (agent) which gives the probability of selecting each relationship as the next hop under the current entity, only the maximum number of hops is reached, if the correct tail entity stays at last, 1 is returned as feedback, otherwise 0 is returned as feedback. The MultiHop method disclosed in EMNLP of 2018 is an improvement on MINERVA, and provides a continuous feedback strategy for the problem of slow convergence caused by only two kinds of feedback, namely 0 and 1, of MINERVA, i.e. for paths which do not reach the correct tail entity, a feedback between 0 and 1 is also given, which is shown by learning through a knowledge graph.
The prior art methods MINERVA and MultiHop are designed according to most relations in the knowledge graph, and are based on an assumption that sufficient data exist in the knowledge graph to train a better model. However, the minority relation only has a very small amount of training data, and cannot meet the assumption of the existing method, and the experimental result also shows that the performance of the prior art on the minority relation is sharply reduced.
Disclosure of Invention
The technical problem to be solved and the technical task to be solved by the invention are to perfect and improve the prior technical scheme, and provide a less-order relational model training method based on knowledge graph meta-information so as to achieve the aim that good training can be realized by a small amount of data. Therefore, the invention adopts the following technical scheme.
A few-time relation model training method based on knowledge graph meta-information is characterized by comprising the following steps:
1) initializing meta-model parameters;
2) performing iterative multi-round training on the common relation to obtain trained meta-model parameters, and circulating the steps as follows:
201) randomly sampling the common relation and the corresponding support set and query set;
202) applying a loss gradient on the support set to obtain a temporary model parameter;
203) calculating gradient loss on the query set and the temporary model parameters, and applying and updating the meta-model parameters;
3) and training the few-time relation model by using the meta-model parameters as initialization parameters.
According to the technical scheme, the relationships are divided into common relationships and less-order relationships, and are treated differently, so that the assumption that each relationship of the previous model has enough data to train is corrected.
The technical scheme uses the common relations to carry out meta-learning, and because the common relations contain enough data, great help can be provided for learning of the relations for a few times. The invention can learn common characteristics between different common relations which are irrelevant to the relations, and the common characteristics are embodied as parameters of the meta-model.
The technical scheme uses the parameters of the meta-model as initialization, the model with few relationships can have a good starting point, and the training can be well realized only by little data.
As a preferable technical means: in step 1), parameters of the meta-model are initialized randomly as a basis for the subsequent cyclic training.
As a preferable technical means: in step 2), this step consists of 3 cyclically executed substeps 201), 202) and 203), terminating the exit until a set training round is reached.
As a preferable technical means: in step 201), the general random sampling relationship is r, and for the general random sampling relationship, triples containing r are respectively formed into support sets
Figure BDA0002402691810000031
And query set
Figure BDA0002402691810000032
Wherein
Figure BDA0002402691810000033
And
Figure BDA0002402691810000034
the same number of triplets is contained and there is no intersection between the two.
As a preferable technical means: in step 202), the meta-model parameters θ and the support set
Figure BDA0002402691810000035
Training is carried out, and the loss function is applied to obtain the corresponding loss
Figure BDA0002402691810000041
And using the loss to calculate a gradient, obtaining new temporary parameters as follows:
Figure BDA0002402691810000042
where α is a learning rate parameter.
As a preferable technical means: in step 203), temporary meta-model parameter θ'rAnd query set
Figure BDA0002402691810000043
Training is carried out, and the loss function is applied to obtain the corresponding loss
Figure BDA0002402691810000044
And using the loss to calculate a gradient, updating θ, which is defined as:
Figure BDA0002402691810000045
where β is another learning rate parameter.
As a preferable technical means: in step 3), for a small-order relation rsInitializing a few-time relation model by taking the finally obtained trained meta-model parameter theta in the step 2) as an initialization parameter, and then initializing all the contained rsTraining is performed on the triplets of (1).
Has the advantages that:
the invention distinguishes the common relation and the few-time relation, and overcomes the problem that the prior art does not distinguish the common relation and the few-time relation, but assumes that the common relation and the few-time relation have enough data for training, and the assumption is not true in the few-time relation, so that the model has poor performance in the few-time relation; according to the technical scheme, some characteristics irrelevant to the relation can be learned through a large amount of data of the common relation, and the characteristics can well guide the learning of the relation for a few times. The specific embodiment of the characteristics is the parameters of the meta-model, and the correspondingly guided embodiment is that the parameters of the meta-model can be used as the initialization of the least-order relation model; by using the parameters of the meta-model as initialization, the model with the few-time relationship can have a good starting point, and can be trained well only by little data.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the drawings in the specification.
Before introducing specific steps, a multi-hop inference model in the knowledge graph needs to be introduced, and specifically, an agent (agent) is learned by using the idea of reinforcement learning to search for an inference path on the knowledge graph. The process of this search is a typical Markov Decision Process (MDP) which can be defined as:
the state is as follows: the state of the t-th hop may be defined as a triplet
Figure BDA0002402691810000059
Wherein r isqIs a relation of a query, esIs the head entity of the query and,
Figure BDA0002402691810000051
is the entity where the current hop is located.
The actions are as follows: for state stThere will be corresponding action space
Figure BDA0002402691810000052
Comprises a
Figure BDA0002402691810000053
All outgoing edges and corresponding next entities. In addition, a return edge pointing to itself is added for each action space, since the number of hops is fixed, and the return edge is similar to a terminating action.
Transferring: for state stIf the agent selects an action space
Figure BDA0002402691810000054
An action in
Figure BDA0002402691810000055
Then the corresponding transfer function is defined as
Figure BDA0002402691810000056
And (3) feedback: if the entity is located when the maximum number of hops T is reached
Figure BDA0002402691810000057
Is the correct tail entity etThen the feedback is 1, otherwise a feedback between 0 and 1
Figure BDA0002402691810000058
Where f is a scoring function of the knowledge graph representation learning.
To address the MDP problem described above, the present invention uses a policy network to provide the agent with a probability of selecting each action. Wherein, a long-time memory network (LSTM) is used to store historical multi-hop path information, which is specifically defined as follows:
ht=LSTM(ht-1,at-1)
then we superimpose all the actions in the action space together, denoted At. The probability of each action given by the policy network is defined as:
Figure BDA0002402691810000061
wherein W1And W2Is the weight to be learned, ReLU is the activation function, and softmax is the logistic regression function.
Finally, a relationship r and a data set are given
Figure BDA0002402691810000062
The overall loss function is defined as:
Figure BDA0002402691810000063
after defining a multi-hop inference model in the knowledge graph, we present specific steps of the method, wherein both the meta model and the least-order relation model refer to the defined multi-hop inference model, as shown in fig. 1, the steps of the invention include:
a: random initialization of meta-model parameters
B: performing iterative multi-round training on the common relation to obtain trained meta-model parameters, and circulating the steps as follows:
b1: randomly sampling the common relation r and the corresponding support set and query set;
b2: applying a loss gradient to the support set to obtain temporary model parameters
B3: computing gradient penalties on the query set and the temporary model parameters, applying and updating meta-model parameters
C: training a hypo-relational model using meta-model parameters as initialization parameters
Further, in the step A, the step B,
and randomly initializing parameters of the meta-model as a basis for the subsequent cyclic training.
Further, in the step B,
this step consists of 3 substeps (B1, B2, and B3) performed in cycles until the exit is terminated after a certain training round is reached.
Further, in the step B1,
randomly sampling a common relation r, and for the common relation, randomly sampling a triple containing r to respectively form a support set
Figure BDA0002402691810000071
And query set
Figure BDA0002402691810000072
Wherein
Figure BDA0002402691810000073
And
Figure BDA0002402691810000074
the same number of triplets is contained and there is no intersection between the two.
Further, in the step B2,
in the existing meta-model parameters θ and support set
Figure BDA0002402691810000075
Training is carried out, and the corresponding loss is obtained by applying the previously defined loss function
Figure BDA0002402691810000076
And using the loss to calculate a gradient, obtaining new temporary parameters as follows:
Figure BDA0002402691810000077
where α is a learning rate parameter.
Further, in the step B3,
in temporary Meta-model parameter θ'rAnd query set
Figure BDA0002402691810000078
Training is carried out, and the corresponding loss is obtained by applying the previously defined loss function
Figure BDA0002402691810000079
And calculating the gradient by using the loss, and updating theta, wherein the specific definition is as follows:
Figure BDA00024026918100000710
where β is another learning rate parameter.
Further, in the step C,
for a small order relation rsTaking the finally obtained trained meta-model parameter theta in the step B as an initialization parameter, initializing a less-order relation model, and then, initializing all the contained rsTraining on the triplets of (a).
In this embodiment:
1. the relationships are divided into common relationships and few-time relationships, and the relationships are treated differently, so that the assumption that each relationship of the previous model has enough data to train is corrected.
2. Meta-learning is performed using common relationships, which can provide great help for learning relationships a small number of times because common relationships contain a sufficient amount of data. The invention can learn common characteristics between different common relations which are irrelevant to the relations, and the common characteristics are embodied as parameters of the meta-model.
3. By using the parameters of the meta-model as initialization, the model with few relationships can have a good starting point and can be trained well with only little data.
The invention can design corresponding characteristics according to different less-order relations and then carry out training and learning. However, the overhead of manually generalizing features is very large, and there is no way to adapt to various knowledge maps well. Therefore, the invention can automatically learn common characteristics among common relations and be applied to the relations of few times so as to further efficiently save manpower.
The method for training a few-time relationship model based on knowledge graph spectral meta-information shown in fig. 1 is a specific embodiment of the present invention, has embodied the substantial features and advances of the present invention, and can be modified equivalently according to the practical use requirements and under the teaching of the present invention, which is within the scope of protection of the present solution.

Claims (7)

1. A few-time relation model training method based on knowledge graph meta-information is characterized by comprising the following steps:
1) initializing meta-model parameters;
2) performing iterative multi-round training on the common relation to obtain trained meta-model parameters, and circulating the steps as follows:
201) randomly sampling the common relation and the corresponding support set and query set;
202) applying a loss gradient on the support set to obtain a temporary model parameter;
203) calculating gradient loss on the query set and the temporary model parameters, and applying and updating the meta-model parameters;
3) and training the few-time relation model by using the meta-model parameters as initialization parameters.
2. The method of claim 1, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 1), parameters of the meta-model are initialized randomly as a basis for the subsequent cyclic training.
3. The method of claim 2, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 2), this step consists of 3 cyclically executed substeps 201), 202) and 203), terminating the exit until a set training round is reached.
4. The method of claim 3, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 201), the general random sampling relationship is r, and for the general random sampling relationship, triples containing r are respectively formed into support sets
Figure FDA0002402691800000011
And query set
Figure FDA0002402691800000012
Wherein
Figure FDA0002402691800000013
And
Figure FDA0002402691800000014
the same number of triplets is contained and there is no intersection between the two.
5. The method of claim 4, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 202), the meta-model parameters θ and the support set
Figure FDA0002402691800000015
Training is carried out, and the loss function is applied to obtain the corresponding loss
Figure FDA0002402691800000021
And using the loss to calculate a gradient, obtaining new temporary parameters as follows:
Figure FDA0002402691800000022
where α is a learning rate parameter.
6. The method of claim 5, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 203), temporary meta-model parameter θ'rAnd query set
Figure FDA0002402691800000023
Training is carried out, and the loss function is applied to obtain the corresponding loss
Figure FDA0002402691800000024
And using the loss to calculate a gradient, updating θ, which is defined as:
Figure FDA0002402691800000025
where β is another learning rate parameter.
7. The method of claim 6, wherein the knowledge graph meta-information-based least-order relationship model training method comprises: in step 3), for a small-order relation rsInitializing a few-time relation model by taking the finally obtained trained meta-model parameter theta in the step 2) as an initialization parameter, and then initializing all the contained rsTraining is performed on the triplets of (1).
CN202010151753.8A 2020-03-06 2020-03-06 Knowledge graph meta-information-based least-order relation model training method Pending CN111523669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010151753.8A CN111523669A (en) 2020-03-06 2020-03-06 Knowledge graph meta-information-based least-order relation model training method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010151753.8A CN111523669A (en) 2020-03-06 2020-03-06 Knowledge graph meta-information-based least-order relation model training method

Publications (1)

Publication Number Publication Date
CN111523669A true CN111523669A (en) 2020-08-11

Family

ID=71910328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010151753.8A Pending CN111523669A (en) 2020-03-06 2020-03-06 Knowledge graph meta-information-based least-order relation model training method

Country Status (1)

Country Link
CN (1) CN111523669A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112180726A (en) * 2020-09-29 2021-01-05 北京航空航天大学 Spacecraft relative motion trajectory planning method based on meta-learning
CN113239131A (en) * 2021-06-18 2021-08-10 国网湖南省电力有限公司 Low-sample knowledge graph completion method based on meta-learning

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112180726A (en) * 2020-09-29 2021-01-05 北京航空航天大学 Spacecraft relative motion trajectory planning method based on meta-learning
CN113239131A (en) * 2021-06-18 2021-08-10 国网湖南省电力有限公司 Low-sample knowledge graph completion method based on meta-learning

Similar Documents

Publication Publication Date Title
CN109992670B (en) Atlas completion method based on knowledge atlas neighborhood structure
Ding et al. Deep reinforcement learning for router selection in network with heavy traffic
CN110704636B (en) Improved Node2 vec-based knowledge graph vector representation method
CN110852448A (en) Cooperative intelligent agent learning method based on multi-intelligent agent reinforcement learning
CN111523669A (en) Knowledge graph meta-information-based least-order relation model training method
CN113098714A (en) Low-delay network slicing method based on deep reinforcement learning
CN111027663A (en) Method for improving algorithm of goblet sea squirt group
Bosman et al. An algorithmic framework for density estimation based evolutionary algorithms
CN101616074B (en) Multicast routing optimization method based on quantum evolution
CN109787696B (en) Cognitive radio resource allocation method based on case reasoning and cooperative Q learning
CN114253265B (en) On-time arrival probability maximum path planning algorithm and system based on fourth-order moment
CN113784410A (en) Heterogeneous wireless network vertical switching method based on reinforcement learning TD3 algorithm
US20230289618A1 (en) Performing knowledge graph embedding using a prediction model
CN111177578B (en) Search method for most influential community around user
CN116384480A (en) Deep reinforcement learning decision interpretation system
Xu et al. Living with artificial intelligence: A paradigm shift toward future network traffic control
Ma et al. Like attracts like: Personalized federated learning in decentralized edge computing
CN117520956A (en) Two-stage automatic feature engineering method based on reinforcement learning and meta learning
CN105373804B (en) A kind of human body localization method and system based on hyperspace quick clustering
Fortier et al. Learning Bayesian classifiers using overlapping swarm intelligence
CN112528033A (en) Knowledge graph multi-hop inference method and device, electronic equipment and storage medium
Qian et al. Deep learning for a low-data drug design system
Bhatnagar et al. Stochastic approximation algorithms
CN116776950A (en) Lifelong learning method based on sample replay and knowledge distillation
CN110995375A (en) Method and device for extracting fading characteristics of wireless channel

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
TA01 Transfer of patent application right

Effective date of registration: 20210201

Address after: 311100 Building 5, 138 Yunlian Road, Yuhang District, Hangzhou City, Zhejiang Province

Applicant after: Marketing service center of State Grid Zhejiang Electric Power Co.,Ltd.

Applicant after: STATE GRID ZHEJIANG YUHUAN POWER SUPPLY CO.,LTD.

Address before: The eight district of Hangzhou city in Zhejiang province 310014 Huadian Zhaohui under No. 1 Lane

Applicant before: STATE GRID ZHEJIANG ELECTRIC POWER COMPANY LIMITED ELECTRIC POWER Research Institute

Applicant before: STATE GRID ZHEJIANG YUHUAN POWER SUPPLY Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20200811

RJ01 Rejection of invention patent application after publication