CN113033914A - Entity and relation prediction method for machining process knowledge graph - Google Patents

Entity and relation prediction method for machining process knowledge graph Download PDF

Info

Publication number
CN113033914A
CN113033914A CN202110411649.2A CN202110411649A CN113033914A CN 113033914 A CN113033914 A CN 113033914A CN 202110411649 A CN202110411649 A CN 202110411649A CN 113033914 A CN113033914 A CN 113033914A
Authority
CN
China
Prior art keywords
entity
machining process
many
relation
hyperplane
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
CN202110411649.2A
Other languages
Chinese (zh)
Other versions
CN113033914B (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.)
Harbin Institute of Technology
Original Assignee
Harbin Institute of Technology
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 Harbin Institute of Technology filed Critical Harbin Institute of Technology
Priority to CN202110411649.2A priority Critical patent/CN113033914B/en
Publication of CN113033914A publication Critical patent/CN113033914A/en
Application granted granted Critical
Publication of CN113033914B publication Critical patent/CN113033914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • General Business, Economics & Management (AREA)
  • Game Theory and Decision Science (AREA)
  • Operations Research (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

An entity and relation prediction method for a machining process knowledge graph belongs to the technical field of entity and relation prediction in the machining process knowledge graph. The invention solves the problem of low accuracy of entity and relation prediction in a machining process by adopting the current translation model. The invention extends the complex relation of the machining process knowledge graph into one-to-many, many-to-one, many-to-one-to-many, one-to-many-to-one, one-to-many, many-to-many and many-to-many types. An entity relation double-projection hyperplane model is provided based on the complex relation of extension and the characteristics of the mechanical processing technology field to realize the accurate prediction of the processing technology entity and the processing technology relation. The method can be used for predicting the entity and the relation in the machining process knowledge graph.

Description

Entity and relation prediction method for machining process knowledge graph
Technical Field
The invention belongs to the technical field of entity and relation prediction in a machining process knowledge graph, and particularly relates to an entity and relation prediction method for the machining process knowledge graph.
Background
Knowledge maps have become an important source of information in both academia and industry. The simple and efficient knowledge organization mode of the knowledge graph draws attention of the industry. Combining the domain with the knowledge graph, establishing a domain-based knowledge graph has become an important way to organize domain knowledge. In recent years, knowledge representation methods for knowledge maps in the field of machining processes have been studied in order to improve the quality of machining process design and improve the efficiency of machining process planning. In the knowledge representation method, the translation model is well known for less optimization parameters and simple and efficient model. The current translation model mainly faces to the problem of complex relationships between entities, such as one-to-many, many-to-one and many-to-many. However, the machining process relationships themselves are complex and diverse, for example, there are a variety of relationships "drilling, boring, drawing, grinding" between solid "forgings" and solid "holes".
Therefore, accurate prediction of the entity and the relation in the machining process cannot be guaranteed by adopting the current translation model, and the accuracy of the entity and the relation prediction in the machining process by adopting the current translation model is low.
Disclosure of Invention
The invention aims to provide an entity and relation prediction method for a machining process knowledge graph, which aims to solve the problem of low accuracy of entity and relation prediction in a machining process by adopting the current translation model.
The technical scheme adopted by the invention for solving the technical problems is as follows: a method for predicting entities and relations of a machining process knowledge graph specifically comprises the following steps:
step one, extending entity relation in machining process knowledge graph
And (3) representing the triples in the machining process knowledge graph as (h, r, t), wherein h, r and t are head entities, entity relations and tail entities of the triples respectively, and extending the quantity relations among the head entities, the entity relations and the tail entities as follows: one to many, many to one, one to many to one, many to one to many, many to one, one to many, many to many;
step two, constructing a solid relation double-projection hyperplane model
For a triple (h, r, t), an embedded representation of the entity relationship r
Figure BDA0003024419940000011
Projecting to a hyperplane S corresponding to the entity relation rrIn the method, the entity relation r in the hyperplane S is obtainedrProjection vector of
Figure BDA0003024419940000012
Embedded representation of head entity h
Figure BDA0003024419940000013
Embedded representation of a tail entity t
Figure BDA0003024419940000014
Is projected to
Figure BDA0003024419940000015
In the hyperplane WrIn, memory
Figure BDA0003024419940000016
And
Figure BDA0003024419940000017
in a hyperplane WrRespectively, of
Figure BDA0003024419940000018
And
Figure BDA0003024419940000019
hyperplane WrHas a unit normal vector of
Figure BDA00030244199400000110
Hyperplane SrHas a unit normal vector of
Figure BDA00030244199400000111
And according to
Figure BDA0003024419940000021
And
Figure BDA0003024419940000022
establishing a score function of the triples (h, r, t);
step three, training of entity relation double-projection hyperplane model
Respectively generating a corresponding error triple for each triple (h, r, t) in the machining process knowledge graph, establishing a target function of the entity relationship double-projection hyperplane model according to the score function, and training the entity relationship double-projection hyperplane model by utilizing the triple (h, r, t) in the machining process knowledge graph and the generated error triple;
and fourthly, predicting the tail entity, the head entity or the entity relationship of the triple by using the trained entity relationship double-projection hyperplane model.
The invention has the beneficial effects that: the invention provides an entity and relationship prediction method for a machining process knowledge graph. An entity relation double-projection hyperplane (ERTransH) model is provided based on the complex relation of extension and the characteristics of the mechanical processing technology field to realize the accurate prediction of the processing technology entity and the processing technology relation.
Drawings
FIG. 1 is a flow chart of a machining process knowledge-graph oriented entity and relationship prediction method of the present invention;
FIG. 2a) is a schematic diagram of a one-to-many relationship;
FIG. 2b) is a schematic diagram of a many-to-one relationship;
FIG. 2c) is a schematic illustration of a one-to-many-to-one relationship;
FIG. 2d) is a schematic diagram of a many-to-one-to-many relationship;
FIG. 2e) is a schematic diagram of a many-to-one relationship;
FIG. 2f) is a schematic illustration of a one-to-many relationship;
FIG. 2g) is a schematic of a many-to-many relationship;
FIG. 3 is a diagram of a solid-relationship dual-projection hyperplane model;
α1、β1are respectively a relation vector
Figure BDA0003024419940000023
And
Figure BDA0003024419940000024
subspace of, alpha2Is that
Figure BDA0003024419940000025
At α1Corresponding to the projection of (b)2Is that
Figure BDA0003024419940000026
At beta1The projection of (a) corresponds to a hyperplane.
Detailed Description
First embodiment this embodiment will be described with reference to fig. 1. The method for predicting the entity and the relation of the machining process knowledge graph comprises the following steps:
step one, extending entity relation in machining process knowledge graph
And (3) representing the triples in the machining process knowledge graph as (h, r, t), wherein h, r and t are head entities, entity relations and tail entities of the triples respectively, and extending the quantity relations among the head entities, the entity relations and the tail entities as follows: one to many, many to one, one to many to one, many to one to many, many to one, one to many, many to many;
step two, constructing a solid relation double-projection hyperplane model
For a triple (h, r, t), an embedded representation of the entity relationship r
Figure BDA0003024419940000031
Projecting to a hyperplane S corresponding to the entity relation rrIn the method, the entity relation r in the hyperplane S is obtainedrProjection vector of
Figure BDA0003024419940000032
Embedded representation of head entity h
Figure BDA0003024419940000033
Embedded representation of a tail entity t
Figure BDA0003024419940000034
Is projected to
Figure BDA0003024419940000035
In the hyperplane WrIn, memory
Figure BDA0003024419940000036
And
Figure BDA0003024419940000037
in a hyperplane WrRespectively, of
Figure BDA0003024419940000038
And
Figure BDA0003024419940000039
hyperplane WrHas a unit normal vector of
Figure BDA00030244199400000310
Hyperplane SrHas a unit normal vector of
Figure BDA00030244199400000311
And according to
Figure BDA00030244199400000312
And
Figure BDA00030244199400000313
establishing a score function of the triples (h, r, t);
step three, training of entity relation double-projection hyperplane model
Respectively generating a corresponding error triple for each triple (h, r, t) in the machining process knowledge graph, establishing a target function of the entity relationship double-projection hyperplane model according to the score function, and training the entity relationship double-projection hyperplane model by utilizing the triple (h, r, t) in the machining process knowledge graph and the generated error triple;
and fourthly, predicting the tail entity, the head entity or the entity relationship of the triple by using the trained entity relationship double-projection hyperplane model.
For the triple to be predicted of the tail entity, the score value corresponding to each entity as the tail entity can be calculated respectively, and since the score value of the correct triple is as small as possible and the score value of the wrong triple is as large as possible, the correct tail entity can be predicted according to the score values. The prediction method of the head entity and the entity relationship is the same.
The invention establishes an entity relation double-projection hyperplane model. Firstly, a processing technology relation space is established, a subspace is distributed to each processing technology relation in the relation space, and the relation is projected in the relation subspace, so that the distinguishability of the relation is enhanced, and the problems of complexity and diversity of the relation are solved. Then, the entity is projected in the hyperplane where the relation projection is located by the model, so that the distinguishability of the entity is enhanced, and the problems of complexity and diversity of the entity are solved. And finally, completing the translation process from the head entity to the tail entity in the hyperplane, and accurately learning the embedded expression of the process knowledge entity and the relationship. The method takes the prediction relation and the entity as the standard, and evaluates the accuracy of the entity prediction and the relation prediction of the model.
The second embodiment is as follows: the present embodiment is different from the first embodiment in that
Figure BDA00030244199400000314
And
Figure BDA00030244199400000315
establishing a score function of the triples (h, r, t), which comprises the following specific processes:
Figure BDA00030244199400000316
wherein f isr(h, t) is the score value of the triplet (h, r, t),
Figure BDA00030244199400000317
represents L1Norm or L2And (4) norm.
The third concrete implementation mode: the second difference between the present embodiment and the present embodiment is that
Figure BDA0003024419940000041
In a hyperplane WrProjection vector of
Figure BDA0003024419940000042
The expression of (a) is:
Figure BDA0003024419940000043
where the superscript T represents transpose.
The fourth concrete implementation mode: the second difference between the present embodiment and the present embodiment is that
Figure BDA0003024419940000044
In a hyperplane WrProjection vector of
Figure BDA0003024419940000045
The expression of (a) is:
Figure BDA0003024419940000046
where the superscript T represents transpose.
The fifth concrete implementation mode: the second difference between the present embodiment and the present embodiment is thatSaid
Figure BDA0003024419940000047
In the hyperplane SrProjection vector of
Figure BDA0003024419940000048
The expression of (a) is:
Figure BDA0003024419940000049
where the superscript T represents transpose.
The sixth specific implementation mode: the second difference between this embodiment and the second embodiment is that, for each triplet (h, r, t) in the machining process knowledge map, a corresponding error triplet is generated, and the specific process is as follows:
the error triplets are generated in two ways:
the first generation mode is as follows: randomly extracting an entity from the entity set to replace a head entity of the triplet (h, r, t);
the second generation mode is as follows: randomly extracting an entity from the entity set to replace a tail entity of the triplet (h, r, t);
both generation modes occur with a certain probability and not simultaneously.
The seventh embodiment: the present embodiment is different from the sixth embodiment in that the probability of occurrence of the first generation mode is:
counting the average number of tail entities corresponding to one head entity in all triples containing the entity relationship r, and recording the average number as tph;
counting the number of head entities corresponding to one tail entity in all triples containing the entity relation r, and marking as hpt;
then to
Figure BDA00030244199400000410
Replaces the head entity in the triplet (h, r, t).
The specific implementation mode is eight: the seventh embodiment is different from the seventh embodiment in that the second generation mode occursThe probability is: to be provided with
Figure BDA00030244199400000411
Replaces the tail entity in the triplet (h, r, t).
By adopting the method for generating the error triple, the quality of the error triple can be greatly improved, and support is provided for improving the knowledge representation capability of the translation model.
The specific implementation method nine: the difference between this embodiment and the eighth embodiment is that the objective function L of the entity-relationship double-projection hyperplane model is:
Figure BDA0003024419940000051
wherein f isr(h, t) represents the score value of the triplet (h, r, t) (h ', r, t ') ∈ Δ '(h,r,t),Δ'(h,r,t)Is a set of erroneous triples generated from triples in the machining process knowledge map, fr(h ', t') represents the score value of the error triplet (h ', r, t'), Δ is the triplet set in the machining process map, γ is the boundary hyperparameter, and γ > 0, max (x,0) represents taking the maximum value between x and 0, E represents the entity set of the machining process map,
Figure BDA0003024419940000052
r represents the entity relation set of the machining process knowledge graph,
Figure BDA0003024419940000053
c denotes a weight, and e denotes a number greater than 0, which is set to 0.0000001 in the experiment.
In this embodiment, the norm of the embedding vector of the entity and the relationship is limited to a small range. The score value of the correct triplet will be as small as possible while the score value of the wrong triplet will be as large as possible. The embedded vector of the learned entities and relations is made to contain more semantic information.
The detailed implementation mode is ten: this embodiment and concrete examplesIn a ninth embodiment, Δ'(h,r,t)Is constructed by the following steps:
Δ'(h,r,t)={(h',r,t)|h'∈E}∪{(h,r,t')|t'∈E}
wherein, (h ', r, t) | h' E represents the head entity of the replacement triplet (h, r, t), and (h, r, t ') | t' E represents the tail entity of the replacement triplet (h, r, t).
Examples
According to the invention, the digitalized vector representation of the machining process entity and the machining process relation is accurately and effectively realized, the prediction of the machining process entity and the machining process relation is completed, and the machining process is completed for a technician, namely, for a given triplet (h, r, and is), a tail entity is predicted, for a given triplet (?, r, and t), a head entity is predicted, and for a given triplet (h, and is, t), the relation between the entity pair h and the entity pair t is predicted. The specific implementation process is as follows:
(1) extending complex relationships of entities
Most current translation models begin with solutions to one-to-many and many-to-one relationships of entities, without considering the complexity and diversity of the relationships themselves, as if a pair of entities might contain many different relationships between them. There may be a variety of relationships between the same pair of entities in the knowledge-graph, for example: in the triad (forging, drawing, hole) and the triad (forging, drilling, hole), "drawing" and "drilling" are two different machining process relations, so the complex relation of the machining process knowledge graph also includes the complexity and diversity of the machining process relation. Further, the complex relationships of the machining process knowledge maps can be extended to one-to-many, many-to-one, one-to-many-to-one, many-to-one-to-many, many-to-one, one-to-many, many-to-many. The complex relationship types of the machining process knowledge maps correspond to the examples in fig. 2a) to 2g), one for one, respectively.
(2) Constructing a solid-relationship dual-projection hyperplane model
First, the general concepts and symbols of the present invention are defined. The positive body (h, r, t) represents the triplet in the machining process knowledge graph, wherein h, r and t are respectively the head entity of the triplet and the relationAnd a tail entity. In a corresponding manner, the first and second electrodes are,
Figure BDA0003024419940000061
an embedded vector representation representing a triplet (h, r, t), wherein
Figure BDA0003024419940000062
A representation is embedded for the header entity of the triplet,
Figure BDA0003024419940000063
a representation is embedded for the relationship of the triples,
Figure BDA0003024419940000064
a representation is embedded for the tail entity of the triplet. E represents the entity set of the machining process knowledge graph, and R represents the relation set of the machining process knowledge graph. Delta represents a positive triad set of the machining process, Delta 'represents a wrong triad set of the machining process, namely (h, r, t) epsilon Delta is a correct triad in a machining process knowledge map, and (h', r, t ') epsilon Delta'(h,r,t)Are triplets that are absent or erroneous in the machining process knowledge map.
In the knowledge base, many-to-one, one-to-many, many-to-many relationships are essentially relationships between entities, and in addition, the machining process relationships themselves are complex and diverse. Thus, the complex relationship of the machining process can be extended to: n-1-1,1-1-N, N-1-N,1-M-1,1-M-N, N-M-1, N-M-N relationships. In order to solve the complex relationship after extension, the invention establishes an entity relationship double projection hyperplane (ERTransH) model, and the model diagram is shown in FIG. 3.
In the ERTarnsH model, for a triple (h, r, t), the embedded representation of the relationship is first put in place
Figure BDA0003024419940000065
Projected to the corresponding hyperplane SrThen the embedded representation of the head entity
Figure BDA0003024419940000066
Embedded representation of a tail entity
Figure BDA0003024419940000067
Is projected to rIn the hyperplane WrIn which
Figure BDA0003024419940000068
Is the unit normal vector of the hyperplane. W with head entity h and tail entity t in hyperplanerProjection vectors are respectively
Figure BDA0003024419940000069
Relation r in the hyperplane SrThe projection vector in (1) is recorded as
Figure BDA00030244199400000610
Is easy to obtain:
Figure BDA00030244199400000611
then, the score function is as shown in equation (1).
Figure BDA00030244199400000612
(3) Model training
The scoring function is a distance function. For the correct triples, the scoring function is expected to be as small as possible, so that the correct translation is ensured; for incorrect triples, it is desirable that the scoring function be a little larger, i.e., increase the irrationality of the translation process. We have established a margin-based objective function as shown in equation (2).
Figure BDA0003024419940000071
Furthermore, in minimizing the objective function L, the following soft constraints should be considered:
Figure BDA0003024419940000072
Figure BDA0003024419940000073
in order to simplify the solving process, the objective function L is rewritten as formula (3) by adding soft constraint conditions to the objective function instead of directly optimizing the objective function L by using soft constraints.
Figure BDA0003024419940000074
Where max (x,0) denotes taking the maximum value between x and 0. f. ofr(h, t) represents the score value of the score function of the correct triplet in the ERTRansH model, fr(h ', t') represents the score value of the scoring function of the error triplet in the ERTRansH model. γ is a boundary hyperparameter greater than 0. Delta is the correct triplet set, Delta'(h,r,t)Is an error triplet, Δ ', generated by the triplet (h, r, t)'(h,r,t)Constructed by equation (4).
Δ'(h,r,t)={(h',r,t)|h'∈E}∪{(h,r,t')|t'∈E} (4)
As shown in formula (3), for a training triplet (h, r, t), an error triplet is generated during training, and the training is performed on the model together. The error triplets are generated in two ways: (1) randomly extracting an entity in the entity set to replace a head entity of the correct triple; (2) one entity in the set of randomly drawn entities replaces the tail entity of the correct triplet (both ways occur with a certain probability and not at the same time). In generating the error triples, the head entity and the tail entity cannot be replaced with the same probability. On the one hand, a relationship may correspond to a plurality of head entities and a plurality of tail entities, and on the other hand, the number of head entities and tail entities corresponding to a relationship is not necessarily equal. The TransH model indicates that: if the relationship is one-to-many, we tend to give more opportunities to replace the head entity; if the relationship is many-to-one, we tend to give more opportunities to replace the tail entity.
Given a training triplet (h, r, t), its error triplet is constructed in three steps: (1) counting the number of tail entities which are averagely corresponding to one head entity in all the triples containing the relation r and recording the number as tph; (2) counting the number of head entities which are averagely corresponding to one tail entity in all the triples containing the relation r and recording the number as hpt; (3) to be provided with
Figure BDA0003024419940000081
Replaces the head entity in the triplet (h, r, t) to
Figure BDA0003024419940000082
Replaces the tail entity in the triplet (h, r, t). The quality of the error triples is greatly improved, and support is provided for improving the knowledge representation capability of the translation model.
(4) Results of the experiment
We apply the ERTransH model and the associated alignment method to the link prediction. In link prediction, entity prediction and relationship prediction between entities are included, i.e. for a given triplet (h, r,; for a given triplet (; for a given triplet (h,. The ERTransH model and other comparative methods were evaluated from the perspective of entity prediction and relationship prediction. In the experiments, we used the pytorech framework and the Adam optimization method. (4.1) experimental data and model evaluation methods are introduced; (4.2) is an entity prediction experiment; (4.3) is a relation prediction experiment.
(4.1) evaluation of Experimental data and model
In the experiment, a database commonly used by a translation model is adopted for the experiment, and five data sets are adopted in total, wherein the five data sets comprise two sub data sets WN18 data sets and WN11 data sets of Wordnet; the three subdata sets of Freebase have a dense relationship of the FB15K dataset, the FB15K-237 dataset, and the FB13 dataset. Table 1 shows specific information for five data sets, including the number of relationships, the number of entities, the data size of the training set, the data size of the validation set, and the data size of the test set.
TABLE 1 Experimental data
Figure BDA0003024419940000083
In the entity prediction, the traditional evaluation indexes are adopted to represent the prediction accuracy of the entity, namely Mean Rank, Filt Mean Rank, Hits @10 and Filt Hits @ 10. In the relation prediction, a method for evaluating indexes of entity prediction accuracy is adopted to calculate Filt Mean Rank, Filt Hits @1, Filt Hits @3 and Filt Hits @10 of the relation prediction to evaluate the relation prediction accuracy.
(4.2) comparative experiments on entity prediction
In the process of entity prediction, we select two data set experiments of a classical data set WN18 and an FB15K of entity prediction. Selecting an untranstructed model, an RESCAL model, an SE model, an SME (Linear) model, an SME (Bilinear) model, an LFM model, a TransE model and a TransH model as baseline models, and directly using the result of the baseline models as the result of a comparison method because the experimental data are the same.
We choose the Adam algorithm to train the ERTrasH model under the pyrrch framework. The parameter optimization range of the ERTrasH model on the FB15K is set as follows: the learning rate lr {0.01,0.001,0.0005}, the boundary γ value range {0.5,1,2}, the embedding dimension k value range {50,100}, the weight C value range {0.25,0.5,1}, the batch size B value is {2400, 4800,9600}, and the training round number epochc is 500. The parameter optimization range of the ERTransH model on WN18 is set as follows: the learning rate lr {0.01,0.001,0.0005}, the boundary γ value range {0.5,1,2}, the embedding dimension k value range {50,100}, the weight C value range {0.25,0.5,1}, the batch size B value {1200,2400, 4800}, and the training round number C is 500. The final parameters selected are as follows. Selecting optimized parameters on FB 15K: c is 500, lr is 0.0005, γ is 2, k is 100, C is 0.25, and B is 9600. Selecting optimization parameters on WN 18: c is 500, lr is 0.001, γ is 2, k is 50, C is 1, and B is 4800. The results of entity predictions for ERTransH and each alignment method on WN18 and FB15K are shown in table 2.
TABLE 2 entity prediction results
Figure BDA0003024419940000091
The results of entity prediction are shown in table 2. Compared with the Unstructured, RESCAL, SE, SME, LFM and TransE, on the WN18 dataset, ERTransH of the invention obtains the second best result under the evaluation indexes of Raw Mean rank, Filter Mean rank, Raw Hits @10, Filter Hits @10 and the like, and ERTranH of the invention obtains the best result under the evaluation indexes of Raw Mean rank, Filter Mean rank, Raw Hits @10, Filter Hits @10 and the like on the FB15K dataset. The experimental results show that the ERTrasH model has obvious effect on the aspect of processing complex relation compared with the baseline model. On the WN18 dataset, the Raw Mean Rank, Filt Mean Rank, Raw Hits @10 and Filter Hits @10 obtained by TransH were 400.8, 388, 73%, 82.3%, respectively, and the ERTrasH was 320, 307, 79.6% and 91.3%, respectively. On the FB15K dataset, the Raw Mean Rank, Filt Mean Rank, Raw rests @10 and Filter rests @10 obtained by TransH were 121, 87, 45.7%, 64.4%, respectively, and the ERTrasH was 202, 106, 51.0% and 68.9%, respectively. This shows that the ERTrasH method improves the accuracy of the entity prediction of the TransH model. The entity prediction result shows that the complexity and diversity of the relation are considered, so that the prediction accuracy of the model in the entity prediction is improved.
(4.3) relational prediction comparative experiment
In the entity relationship prediction, the prediction precision of TransH and ERTransH is emphasized and compared. Four classical databases WN18RR, FB15K, FB15K-237 and FB13 were chosen as comparative experimental data for TransH and ERTransH. The parameter optimization spaces of the two models are the same under the same data set, as shown in table 3. The optimal parameters of the TransH model and the ERTrasH model on each data set are shown in Table 4.
TABLE 3 parameter optimization space for data sets
Figure BDA0003024419940000101
Table 4 parameters selected for the experiments
Figure BDA0003024419940000102
Figure BDA0003024419940000111
TransH and ERTrasH respectively use the parameters selected in the table 4 to perform comparison experiments on WN18RR, FB15K, FB15K-237 and FB13 data sets, Filt Mean Rank, Filt Hits @1, Filt Hits @3 and Filt Hits @10 are used as evaluation indexes of the relation prediction precision, and the experimental results are shown in the table 5.
TABLE 5 comparative experimental results
Figure BDA0003024419940000112
The results of the relationship prediction are shown in table 5. Compared with Mean Rank, Hits @1, Hits @3 and Hits @10 of TransH and ERTrasH, the Mean Rank, Hits @1, Hits @3 and Hits @10 of ERTrasH are improved by 3 points, 15.1%, 31% and 30.1% respectively, and the Mean Rank, Hits @1, Hits @3 and Hits @10 of ERTrasH are improved to 2, 58.3%, 85% and 99.9% on the WN18RR data set. Compared with Mean Rank, Hits @1, Hits @3 and Hits @10 of TransH and ERTrasH, the Mean Rank, Hits @1, Hits @3 and Hits @10 of ERTrasH are improved by 32 points, 22.2%, 16.9% and 12.1% respectively, and the Mean Rank, Hits @1, Hits @3 and Hits @10 of ERTrasH are improved to 11%, 77.2%, 87.0% and 92.0% on the FB15K data set. On the FB15K-237 data set, the Mean Rank, Hits @1, Hits @3, Hits @10 of ERTrasH were improved by 16 points, 26.9%, 15.4% and 11.9%, respectively, compared with the Mean Rank, Hits @1, Hits @3, and Hits @10 of TransH, ERTrasH, to 2, 88.9%, 94.0% and 96.0%. On the FB13 data set, the relation prediction precision of TransH and ERTransH is very accurate, and the relation prediction effect of ERTransH is still improved. This shows that, compared to the TransH, the ERTransH model can solve the problem of complex relationships by allocating a relationship subspace to each relationship, and thus, accurate prediction of the relationship is achieved.
The above analysis shows that the ERTransH model can increase the degree of relationship differentiation by assigning a relationship subspace for each relationship. The ERTransH model obviously improves the prediction precision of the entity relationship and simultaneously improves the prediction precision of the entity. On the other hand, the ERTransH model is more suitable for being applied to data sets with complex and diverse relationships than the TransH model. In the real world, the relationship of the entities is more complex and diversified, so the ERTrasH model established by the invention is more consistent with the real situation.
The above-described calculation examples of the present invention are merely to explain the calculation model and the calculation flow of the present invention in detail, and are not intended to limit the embodiments of the present invention. It will be apparent to those skilled in the art that other variations and modifications of the present invention can be made based on the above description, and it is not intended to be exhaustive or to limit the invention to the precise form disclosed, and all such modifications and variations are possible and contemplated as falling within the scope of the invention.

Claims (10)

1. A method for predicting entities and relations of a machining process knowledge graph is characterized by comprising the following steps:
step one, extending entity relation in machining process knowledge graph
And (3) representing the triples in the machining process knowledge graph as (h, r, t), wherein h, r and t are head entities, entity relations and tail entities of the triples respectively, and extending the quantity relations among the head entities, the entity relations and the tail entities as follows: one to many, many to one, one to many to one, many to one to many, many to one, one to many, many to many;
step two, constructing a solid relation double-projection hyperplane model
For a triple (h, r, t), an embedded representation of the entity relationship r
Figure FDA0003024419930000011
Projecting to a hyperplane S corresponding to the entity relation rrIn the method, the entity relation r in the hyperplane S is obtainedrProjection vector of
Figure FDA0003024419930000012
Embedded representation of head entity h
Figure FDA0003024419930000013
Embedded representation of a tail entity t
Figure FDA0003024419930000014
Is projected to
Figure FDA0003024419930000015
In the hyperplane WrIn, memory
Figure FDA0003024419930000016
And
Figure FDA0003024419930000017
in a hyperplane WrRespectively, of
Figure FDA0003024419930000018
And
Figure FDA0003024419930000019
hyperplane WrHas a unit normal vector of
Figure FDA00030244199300000110
Hyperplane SrHas a unit normal vector of
Figure FDA00030244199300000111
And according to
Figure FDA00030244199300000112
And
Figure FDA00030244199300000113
establishing a score function of the triples (h, r, t);
step three, training of entity relation double-projection hyperplane model
Respectively generating a corresponding error triple for each triple (h, r, t) in the machining process knowledge graph, establishing a target function of the entity relationship double-projection hyperplane model according to the score function, and training the entity relationship double-projection hyperplane model by utilizing the triple (h, r, t) in the machining process knowledge graph and the generated error triple;
and fourthly, predicting the tail entity, the head entity or the entity relationship of the triple by using the trained entity relationship double-projection hyperplane model.
2. The machine-processing-process-knowledge-graph-oriented entity and relationship prediction method according to claim 1, characterized in that the basis is
Figure FDA00030244199300000114
And
Figure FDA00030244199300000115
establishing a score function of the triples (h, r, t), which comprises the following specific processes:
Figure FDA00030244199300000116
wherein f isr(h, t) is the score value of the triplet (h, r, t),
Figure FDA00030244199300000117
represents L1Norm or L2And (4) norm.
3. The method of claim 2, wherein the method of predicting the machining process knowledge-graph entity and relationship comprises
Figure FDA00030244199300000118
In a hyperplane WrProjection vector of
Figure FDA00030244199300000119
The expression of (a) is:
Figure FDA00030244199300000120
where the superscript T represents transpose.
4. The method of claim 2, wherein the method of predicting the machining process knowledge-graph entity and relationship comprises
Figure FDA00030244199300000121
In a hyperplane WrProjection vector of
Figure FDA00030244199300000122
The expression of (a) is:
Figure FDA00030244199300000123
where the superscript T represents transpose.
5. The method of claim 2, wherein the method of predicting the machining process knowledge-graph entity and relationship comprises
Figure FDA0003024419930000021
In the hyperplane SrProjection vector of
Figure FDA0003024419930000022
The expression of (a) is:
Figure FDA0003024419930000023
where the superscript T represents transpose.
6. The method for predicting the entity and relationship of the machining process knowledge graph according to claim 2, wherein the step of generating a corresponding error triple for each triple (h, r, t) in the machining process knowledge graph comprises the following specific steps:
the error triplets are generated in two ways:
the first generation mode is as follows: randomly extracting an entity from the entity set to replace a head entity of the triplet (h, r, t);
the second generation mode is as follows: randomly extracting an entity from the entity set to replace a tail entity of the triplet (h, r, t);
both generation modes occur with a certain probability and not simultaneously.
7. The method for predicting the entity and the relation of the machining process knowledge-graph according to claim 6, wherein the probability of the first generation mode is as follows:
counting the average number of tail entities corresponding to one head entity in all triples containing the entity relationship r, and recording the average number as tph;
counting the number of head entities corresponding to one tail entity in all triples containing the entity relation r, and marking as hpt;
then to
Figure FDA0003024419930000024
Replaces the head entity in the triplet (h, r, t).
8. The method of claim 7, wherein the probability of the second generation mode is: to be provided with
Figure FDA0003024419930000025
Replaces the tail entity in the triplet (h, r, t).
9. The method of claim 8, wherein the objective function L of the entity-relationship bi-projection hyperplane model is as follows:
Figure FDA0003024419930000026
wherein f isr(h, t) represents the score value of the triplet (h, r, t) (h ', r, t ') ∈ Δ '(h,r,t),Δ'(h,r,t)Is a set of erroneous triples generated from triples in the machining process knowledge map, fr(h ', t') represents the score value of the error triplet (h ', r, t'), Δ is the triplet set in the machining process map, γ is the boundary hyperparameter, and γ > 0, max (x,0) represents taking the maximum value between x and 0, E represents the entity set of the machining process map,
Figure FDA0003024419930000031
r represents the entity relation set of the machining process knowledge graph,
Figure FDA0003024419930000032
c represents a weight, and ε represents a number greater than 0.
10. The machining process knowledge-graph-oriented entity and relationship prediction method of claim 9, wherein Δ'(h,r,t)Is constructed by the following steps:
Δ'(h,r,t)={(h',r,t)|h'∈E}∪{(h,r,t')|t'∈E}
wherein, (h ', r, t) | h' E represents the head entity of the replacement triplet (h, r, t), and (h, r, t ') | t' E represents the tail entity of the replacement triplet (h, r, t).
CN202110411649.2A 2021-04-16 2021-04-16 Entity and relation prediction method for machining process knowledge graph Active CN113033914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110411649.2A CN113033914B (en) 2021-04-16 2021-04-16 Entity and relation prediction method for machining process knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110411649.2A CN113033914B (en) 2021-04-16 2021-04-16 Entity and relation prediction method for machining process knowledge graph

Publications (2)

Publication Number Publication Date
CN113033914A true CN113033914A (en) 2021-06-25
CN113033914B CN113033914B (en) 2022-03-25

Family

ID=76458011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110411649.2A Active CN113033914B (en) 2021-04-16 2021-04-16 Entity and relation prediction method for machining process knowledge graph

Country Status (1)

Country Link
CN (1) CN113033914B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113946695A (en) * 2021-12-20 2022-01-18 山东新希望六和集团有限公司 Method and device for generating animal pedigree and computer equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150347480A1 (en) * 2014-05-30 2015-12-03 Georgetown University Process and Framework For Facilitating Data Sharing Using a Distributed Hypergraph
CN105824802A (en) * 2016-03-31 2016-08-03 清华大学 Method and device for acquiring knowledge graph vectoring expression
CN106934042A (en) * 2017-03-16 2017-07-07 中国人民解放军国防科学技术大学 A kind of knowledge mapping represents model and its method
CN107885759A (en) * 2016-12-21 2018-04-06 桂林电子科技大学 A kind of knowledge mapping based on multiple-objection optimization represents learning method
CN109840282A (en) * 2019-03-01 2019-06-04 东北大学 A kind of knowledge mapping optimization method based on fuzzy theory
CN110378489A (en) * 2019-07-30 2019-10-25 哈尔滨工程大学 Representation of knowledge learning model based on the projection of entity hyperplane
CN110647620A (en) * 2019-09-23 2020-01-03 中国农业大学 Knowledge graph representation learning method based on confidence hyperplane and dictionary information
CN111209408A (en) * 2019-12-23 2020-05-29 华东师范大学 Time-carrying knowledge graph embedding method based on hybrid translation model

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150347480A1 (en) * 2014-05-30 2015-12-03 Georgetown University Process and Framework For Facilitating Data Sharing Using a Distributed Hypergraph
CN105824802A (en) * 2016-03-31 2016-08-03 清华大学 Method and device for acquiring knowledge graph vectoring expression
CN107885759A (en) * 2016-12-21 2018-04-06 桂林电子科技大学 A kind of knowledge mapping based on multiple-objection optimization represents learning method
CN106934042A (en) * 2017-03-16 2017-07-07 中国人民解放军国防科学技术大学 A kind of knowledge mapping represents model and its method
CN109840282A (en) * 2019-03-01 2019-06-04 东北大学 A kind of knowledge mapping optimization method based on fuzzy theory
CN110378489A (en) * 2019-07-30 2019-10-25 哈尔滨工程大学 Representation of knowledge learning model based on the projection of entity hyperplane
CN110647620A (en) * 2019-09-23 2020-01-03 中国农业大学 Knowledge graph representation learning method based on confidence hyperplane and dictionary information
CN111209408A (en) * 2019-12-23 2020-05-29 华东师范大学 Time-carrying knowledge graph embedding method based on hybrid translation model

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113946695A (en) * 2021-12-20 2022-01-18 山东新希望六和集团有限公司 Method and device for generating animal pedigree and computer equipment

Also Published As

Publication number Publication date
CN113033914B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN110147450B (en) Knowledge complementing method and device for knowledge graph
CN111090461B (en) Code annotation generation method based on machine translation model
US7085690B2 (en) Unsupervised machine learning-based mathematical model selection
Jaeger et al. Mixed effect models for genetic and areal dependencies in linguistic typology
CN111753101B (en) Knowledge graph representation learning method integrating entity description and type
CN111259085B (en) Relation prediction method of time perception translation model based on relation hyperplane
CN110990580A (en) Knowledge graph construction method and device, computer equipment and storage medium
CN113033914B (en) Entity and relation prediction method for machining process knowledge graph
Davarynejad et al. A novel general framework for evolutionary optimization: Adaptive fuzzy fitness granulation
CN110909881A (en) Knowledge representation method for cross-media knowledge reasoning task
CN112800770A (en) Entity alignment method based on heteromorphic graph attention network
US20230197205A1 (en) Bioretrosynthetic method and system based on and-or tree and single-step reaction template prediction
CN110765788A (en) Knowledge graph embedding method based on implicit translation model
CN108052683B (en) Knowledge graph representation learning method based on cosine measurement rule
CN111339320A (en) Knowledge graph embedding and reasoning method introducing entity type automatic representation
CN116361697A (en) Learner learning state prediction method based on heterogeneous graph neural network model
Abbas et al. Bayesian Analysis of Three‐Parameter Frechet Distribution with Medical Applications
CN113377991B (en) Image retrieval method based on most difficult positive and negative samples
Kalantari et al. The unreasonable effectiveness of inverse reinforcement learning in advancing cancer research
Lonij et al. Open-world visual recognition using knowledge graphs
Zou et al. A multiobjective particle swarm optimization algorithm based on grid technique and multistrategy
CN112115230B (en) Knowledge graph construction method based on hierarchical category information
CN116186278A (en) Knowledge graph completion method based on hyperplane projection and relational path neighborhood
CN115098699A (en) Link prediction method based on knowledge graph embedded model
CN116108189A (en) Quaternion-based knowledge graph embedding method and system

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