CN110516078A - Alignment schemes and device - Google Patents
Alignment schemes and device Download PDFInfo
- Publication number
- CN110516078A CN110516078A CN201910797439.4A CN201910797439A CN110516078A CN 110516078 A CN110516078 A CN 110516078A CN 201910797439 A CN201910797439 A CN 201910797439A CN 110516078 A CN110516078 A CN 110516078A
- Authority
- CN
- China
- Prior art keywords
- triple
- alignment
- entity
- aligned
- vector
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Machine Translation (AREA)
Abstract
This application discloses a kind of alignment schemes and devices.Wherein, this method comprises: obtaining the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, alignment relation is determined based on first triple and second triple;According to first triple, the second triple, alignment seed and alignment relation, positive sample set is obtained;Establish instantiation regular collection;Entity is carried out to first triple and second triple with the instantiation regular collection based on the positive sample set to be aligned.The information content in knowledge mapping being related to present application addresses entity alignment thereof in the prior art is less, the lower technical problem of the accuracy of entity alignment.
Description
Technical field
This application involves knowledge mapping technical fields, in particular to a kind of alignment schemes and device.
Background technique
Recently, knowledge mapping receives academia and widely pays close attention to industry, and it is relevant perhaps to be applied to artificial intelligence
It applies, such as: knowledge acquisition, knowledge question, recommender system more.Due to haveing the characteristics that multi-source heterogeneous, In between different knowledge mappings
During the more complete richer knowledge mapping of building one, integrates the heterogeneous entities in more knowledge mappings and obtain consistent shape
Formula is particularly important, i.e., entity is aligned.
Traditional entity alignment schemes depend on symbolic feature, may not be able to send out well when encountering literal heterogeneous scenarios
The effect of waving.These methods generally use the mode based on similarity calculation or propagation.According to calculating character string, attribute, Lin Jujie
Point is equal or similar judges whether two entities are equal.
In order to consider the expression form of entity, it is suggested based on the entity alignment schemes for indicating study.Based on table
The technology shown to low-dimensional vector space, is modeled entity and relationship map using the structural information between entity, pass through to
Distance between amount finds character, word, the even literal feature such as language of the peer items of entity without considering description entity.Example
Such as: being mapped by the multilingual expression of different transition matrixes.But traditional entity alignment, depend on symbolic feature, application
Language contexts it is limited, in addition, based on indicate study entity alignment, the information content in knowledge mapping being related to is less, entity
The accuracy of alignment is lower.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the present application provides a kind of alignment schemes and device, at least to solve entity alignment side in the prior art
The information content in knowledge mapping that formula is related to is less, the lower technical problem of the accuracy of entity alignment.
According to the one aspect of the embodiment of the present application, a kind of alignment schemes are provided, comprising: obtain to be aligned first and know
Know map and the second knowledge mapping, and alignment seed, wherein it include multiple first triples in first knowledge mapping,
In second knowledge mapping include multiple second triples, it is described alignment seed include be aligned first alignment entity with
Second alignment entity, the first alignment entity belong to first triple, and the second alignment entity belongs to described second
Triple;Determine that alignment relation, the alignment relation include first pair based on first triple and second triple
Homogeneous relation, with the second alignment relation, first alignment relation belongs to first triple, and second alignment relation belongs to
Second triple;It the identical entity of entity will be aligned in first triple with first replaces with described second and be aligned reality
Body obtains third triple;The identical entity of entity will be aligned in second triple with described second and replaces with described
One alignment entity, obtains the 4th triple, by the first relationship identical with first alignment relation in first triple
Second alignment relation is replaced with, the 5th triple is obtained;By in second triple with the second alignment relation phase
The second same relationship replaces with first alignment relation, obtains the 6th triple;Calculate first triple, described second
Triple, the third triple, the 4th triple, the 5th triple, the union of the 6th triple, obtain
Positive sample set;Instantiation regular collection, the instantiation rule set are established according to first triple and the second triple
Conjunction includes: between correspondence relationship information and multiple second triples between the multiple first triple
Correspondence relationship information;The first object of the first instance is determined based on the positive sample set and the instantiation regular collection
The value of second object vector of the value of vector and the second instance;Value based on the first object vector and described the
The value of two object vectors carries out entity alignment to first triple and second triple.
Optionally, determine that alignment relation includes: to obtain described the based on first triple and second triple
Third relationship in one triple;It calculates between the third relationship and the character string of the 4th relationship in second triple
Editing distance;Judge whether the editing distance is 0, if so, the third relationship is aligned with the 4th relationship,
Obtain the alignment relation.
Optionally, the first mesh of the first instance is determined based on the positive sample set and the instantiation regular collection
The value for marking the value of vector and the second object vector of the second instance includes: initialization step, by the positive sample set
In entity to be aligned in each triple assign the value of initial primary vector, by each ternary in the positive sample set
Relationship to be aligned in group assigns the value of initial secondary vector;The first variable is set as 0, the second variable is 0;First variable is more
New step, first variable add 1;Arest neighbors triple obtaining step, the value based on the primary vector obtain and each institute
The multiple first arest neighbors neighbours' triples for stating entity to be aligned, the value based on the secondary vector obtain each described to be aligned
Multiple second arest neighbors neighbours' triples of relationship;
Second variable update step, second variable add 1;Negative sample generation step carries out the positive sample set
Sampling, obtains multiple sampling triples, is that the generation of each sampling triple is multiple according to the first arest neighbors neighbours' triple
First negative sample triple is sampled the instantiation regular collection, obtains multiple sampling prescriptions, most according to described second
Neighbour neighbours' triple is that each sampling prescription generates multiple negative sample example rules;Score step, calculates the positive sample collection
Close corresponding first scoring, corresponding second scoring of the multiple first negative sample triple, the instantiation regular collection pair
Third scoring, corresponding 4th scoring of the multiple negative sample example rule answered;Initial target function determines step, is based on institute
It states the first scoring and second scoring determines the value of first object function, being scored based on the third, it is true to score with the described 4th
The value of fixed second objective function;Catalogue scalar functions determine step, according to the value of the first object function and second target
The value of function and default weight determine third objective function;Step is minimized, the third objective function is minimized, obtains
Of entity to be aligned in the value of the third vector of entity to be aligned in first triple, with second triple
The value of four vectors;Circulation terminates to determine step, judges second variable whether less than the first preset threshold, if so, returning
Step S110 is executed, if it is not, then judging that first variable whether less than the second preset threshold, if being less than, returns and executes step
Rapid S106 executes following steps S122 if being not less than;Object vector value determines step, respectively by the value of the third vector
Value with the value of the 4th vector as the first object vector, the value with second object vector.
Optionally, the value of value and second object vector based on the first object vector, to first ternary
Group, second triple carry out entity alignment include: calculate the first object vector and second object vector to
Span from, judge whether the vector distance is less than default vector distance, obtain judging result, if judging result be designated as be,
Then by the reality in the first object vector the first triple corresponding with second object vector and the second triple
Body is aligned.
Optionally, the value based on the primary vector obtains adjacent with multiple first arest neighbors of each entity to be aligned
Occupy the primary vector that triple includes: other entities in the primary vector and the positive sample set for obtain the entity to be aligned
First distance;By the ascending sequence of the first distance, other corresponding described realities of the first default ranking will be ordered as
Triple where body, as the first arest neighbors neighbours' triple;Value based on the secondary vector obtains each described
Multiple second arest neighbors neighbours' triples of relationship to be aligned include: obtain the secondary vector of the relationship to be aligned with it is described
The second distance of the secondary vector of other relationships in positive sample set;By the ascending sequence of the second distance, will be ordered as
Triple where other corresponding described relationships of second default ranking, as the second arest neighbors neighbours' triple.
Optionally, the value based on the primary vector obtains adjacent with multiple first arest neighbors of each entity to be aligned
Before occupying triple, the method also includes: based on the entity to be aligned in the positive sample set it is total, described to
The sum of alignment relation determines the described first default ranking and the described second default ranking with parameter preset.
Optionally, the vector distance for calculating the first object vector and second object vector includes: described in calculating
The m-cosine distance of first object vector and second object vector.
According to the one aspect of the embodiment of the present application, a kind of alignment means are provided, comprising: module is obtained, for obtaining
First knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein include more in first knowledge mapping
A first triple includes multiple second triples in second knowledge mapping, and the alignment seed includes being aligned
First alignment entity is aligned entity with second, and the first alignment entity belongs to first triple, and second alignment is real
Body belongs to second triple;First determining module, for being determined based on first triple and second triple
Alignment relation, the alignment relation include the first alignment relation, and with the second alignment relation, first alignment relation belongs to described
First triple, second alignment relation belong to second triple;Replacement module, being used for will be in first triple
The identical entity of entity is aligned with first replaces with described second and be aligned entity, obtain third triple;By second ternary
With described second the identical entity of entity is aligned in group replaces with described first and be aligned entity, obtain the 4th triple, it will be described
The first relationship identical with first alignment relation replaces with second alignment relation in first triple, obtains the five or three
Tuple;Second relationship identical with second alignment relation in second triple is replaced with described first and is aligned pass
System, obtains the 6th triple;Computing module, for calculating first triple, second triple, the third ternary
Group, the 4th triple, the 5th triple, the union of the 6th triple, obtain positive sample set;Establish mould
Block, for establishing instantiation regular collection, the instantiation regular collection packet according to first triple and the second triple
It includes: the correspondence between correspondence relationship information and multiple second triples between the multiple first triple
Relation information;Second determining module, for determining described first based on the positive sample set and the instantiation regular collection
The value of second object vector of the value and second instance of the first object vector of entity;Alignment module, for being based on institute
State the value of first object vector and the value of second object vector, to first triple and second triple into
The alignment of row entity.
According to the one aspect of the embodiment of the present application, a kind of storage medium is provided, the storage medium includes storage
Program, wherein equipment where controlling the storage medium in described program operation executes above-mentioned alignment schemes.
According to the one aspect of the embodiment of the present application, a kind of processor is provided, the processor is used to run program,
In, described program executes above-mentioned alignment schemes when running.
In the embodiment of the present application, first knowledge mapping and second knowledge mapping to be aligned using acquisition, and alignment
Seed, wherein include multiple first triples in first knowledge mapping, include multiple second in second knowledge mapping
Triple, the alignment seed include that the first alignment entity being aligned is aligned entity, the first alignment entity with second
Belong to first triple, the second alignment entity belongs to second triple;Based on first triple and institute
It states the second triple and determines alignment relation, the alignment relation includes the first alignment relation, and the second alignment relation, and described first
Alignment relation belongs to first triple, and second alignment relation belongs to second triple;By first ternary
With first the identical entity of entity is aligned in group replaces with described second and be aligned entity, obtain third triple;By described second
With described second the identical entity of entity is aligned in triple replaces with described first and be aligned entity, obtain the 4th triple, it will
The first relationship identical with first alignment relation replaces with second alignment relation in first triple, obtains
Five triples;Second relationship identical with second alignment relation in second triple is replaced with described first to be aligned
Relationship obtains the 6th triple;Calculate first triple, second triple, the third triple, the described 4th
Triple, the 5th triple, the union of the 6th triple, obtain positive sample set;According to first triple
Instantiation regular collection is established with the second triple, the instantiation regular collection includes: the multiple first triple
Between correspondence relationship information and multiple second triples between correspondence relationship information;Based on the positive sample collection
Close with the instantiation regular collection determine the first instance first object vector value and the second instance the
The value of two object vectors;The value of value and second object vector based on the first object vector, to first ternary
Group and second triple carry out the mode of entity alignment, by the way that traditional entity based on similarity to be aligned and be based on
The entity alignment of expression combines, and combines based on the higher feature of similarity based method precision and the method applied field based on expression
The wider feature of scape improves the precision of entity alignment.Meanwhile logic rules are introduced in indicating model, enhance expression
The predictive ability of model, obtaining more believable entity vector indicates, has reached the technology effect for the accuracy for improving entity alignment
Fruit, and then the information content solved in the knowledge mapping that entity alignment thereof in the prior art is related to is less, entity alignment
The lower technical problem of accuracy.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present application, constitutes part of this application, this Shen
Illustrative embodiments and their description please are not constituted an undue limitation on the present application for explaining the application.In the accompanying drawings:
Fig. 1 is the flow diagram according to a kind of optional alignment schemes of the embodiment of the present application;
Fig. 2 is the flow diagram according to a kind of optional alignment schemes of the embodiment of the present application;
Fig. 3 is the structural schematic diagram according to a kind of optional alignment means of the embodiment of the present application.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only
The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people
Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection
It encloses.
It should be noted that the description and claims of this application and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to embodiments herein described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
According to the embodiment of the present application, a kind of alignment schemes embodiment is provided, it should be noted that in the flow chart of attached drawing
The step of showing can execute in a computer system such as a set of computer executable instructions, although also, in flow chart
In show logical order, but in some cases, shown or described step can be executed with the sequence for being different from herein
Suddenly.
Fig. 1 is according to the flow diagram of the alignment schemes of the embodiment of the present application, as shown in Figure 1, this method includes at least
Following steps:
Step 102, the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed are obtained, wherein described
Include multiple first triples in first knowledge mapping, includes multiple second triples in second knowledge mapping, it is described right
Neat seed includes that the first alignment entity being aligned is aligned entity with second, and the first alignment entity belongs to the described 1st
Tuple, the second alignment entity belong to second triple;
Optionally, the first knowledge mapping can be with are as follows: KG1={ (hn, rn, tn)}(hnReferred to as head entity, rnReferred to as relationship, tn
Referred to as tail entity);Second knowledge mapping can be with are as follows: KG2={ (hm, rm, tm), alignment seed set can be { (sn, sm)};
(hn, rn, tn) it is the first triple, (hm, rm, tm) it is the second triple.
Wherein, SnFor the first alignment entity, the first triple, S can be belonged tomFor the second alignment entity, the second ternary can be belonged to
Group.
In some optional embodiments of the application, the first knowledge mapping can be with are as follows: { (Xiao Ming, birthplace, China)
(Xiao Ming, father are small rigid) (Xiao Ming, country of being born, China) (small rigid, mother tongue is Chinese) (small rigid, wife, little Hua) (little Hua, it is female
Parent spends flower)., wherein (Xiao Ming, birthplace, China) (Xiao Ming, father are small rigid) (Xiao Ming, birth country, China) is (small
Just, mother tongue, Chinese) (just small, wife, little Hua) (little Hua, mother spend flower) be the first triple;
Second knowledge mapping can be with are as follows: { (small rigid son, birthplace, the People's Republic of China (PRC)) (Xiao Ming, mother tongue, Chinese)
(Xiao Ming, father are small rigid) (small rigid, first language, Chinese) (small rigid, wife, little Hua)., wherein (small rigid son, birth
Ground, the People's Republic of China (PRC)) (Xiao Ming, mother tongue, Chinese) (Xiao Ming, father are small rigid) (small rigid, first language, Chinese) (it is small rigid,
Wife, little Hua) it is the second triple.
If alignment seed is the entity pair being aligned in the first knowledge mapping and the second knowledge mapping.Such as:
It is aligned seed (Xiao Ming, small rigid son), wherein Xiao Ming is the first alignment entity, small from the first knowledge mapping
Rigid son is the second alignment entity from the second knowledge mapping.
Step 104, alignment relation, the alignment relation packet are determined based on first triple and second triple
The first alignment relation is included, with the second alignment relation, first alignment relation belongs to first triple, second alignment
Relationship belongs to second triple;
In some optional embodiments of the application, the method based on similarity of character string can use to the first knowledge
Map is aligned with the relationship in the second knowledge mapping, specifically, is recognized if the editing distance between two relation character strings is 0
Determining them can be aligned, and obtain alignment relation set { (rn, rm), wherein rnFor the first alignment relation, belong to the first triple, rm
For the second alignment relation, belong to the second triple.
Optionally, alignment relation can be (father, father), and wherein father comes from the first knowledge mapping, and father is from the
Two knowledge mappings.
Alignment relation can also be (mother tongue, first language).
Step 106, it the identical entity of entity will be aligned in first triple with first replaces with described second and be aligned
Entity obtains third triple;To be aligned in second triple with described second the identical entity of entity replace with it is described
First alignment entity, obtains the 4th triple, and in first triple identical with first alignment relation first is closed
System replaces with second alignment relation, obtains the 5th triple;By in second triple with second alignment relation
Identical second relationship replaces with first alignment relation, obtains the 6th triple;
Wherein, it can be head entity that the identical entity of entity is aligned with first, or tail entity is aligned reality with second
The identical entity of body can be head entity, or tail entity.
Step 108, first triple, second triple, the third triple, the 4th ternary are calculated
Group, the 5th triple, the union of the 6th triple, obtain positive sample set;
In some optional embodiments of the application, first triple, second triple, described the are calculated
Three triples, the 4th triple, the 5th triple, the union of the 6th triple, obtaining positive sample set can
To be obtained in the following manner, firstly, computational entity setSpecifically,It can be expressed as following
Formula (1):
∪{(sn, rm, tm)|(sm, rm, tm)∈KG2}
∪{(hm, rm, sn)|(hm, rm, sm)∈KG2} (1)
Wherein, (hn, rn, tn) it is the first triple, (hm, rm, tm) it is the second triple, SnFor the first alignment entity, SmFor
Second alignment entity, the identical head entity of entity will be aligned with first replaces with described second and be aligned reality in first triple
Body obtains third triple: (sm, rn, tn), the identical tail entity replacement of entity will be aligned in first triple with first
For the second alignment entity, third triple (h is obtainedn, rn, sm).Reality will be aligned with described second in second triple
The identical head entity of body replaces with the first alignment entity, obtains the 4th triple (sn, rm, tm), by second triple
In with described second be aligned the identical tail entity of entity and replace with described first and be aligned entity, obtain the 4th triple (hm, rm,
sn)。
Firstly, calculated relationship setShown in the calculation formula of set of relationship such as formula (2).
Wherein, (hn, rn, tn) it is the first triple, (hm, rm, tm) it is the second triple, rnFor the first alignment relation, belong to
In the first triple, rmFor the second alignment relation, belong to the second triple.It will be aligned in first triple with described first
Identical first relationship of relationship replaces with second alignment relation, obtains the 5th triple (hn, rm, tn);By the described 2nd 3
The second relationship identical with second alignment relation replaces with first alignment relation in tuple, obtains the 6th triple
(hm, rn, tm)。
Based on above-mentioned entity sets and set of relationship and the first knowledge mapping and the second knowledge mapping, then can get just
Sample setShown in formula (3) specific as follows:
Step 110, instantiation regular collection, the instantiation rule are established according to first triple and the second triple
Then set include: correspondence relationship information between the multiple first triple and multiple second triples it
Between correspondence relationship information;
In some optional embodiments of the application, instantiation regular collection GR, form r are obtainedn< hn, tn>OrIt is located atThe left side
Be known as premise triple, be located atThe right is known as conclusion triple;Using rule digging tool AMIE+, respectively with knowledge
Map KG1With KG2In triple as input and be arranged PCA confidence level filtering threshold therein be 1.Output obtains rule
Set R1, R2;Respectively to regular collection R1, R2Instantiation operation is done, that is, uses knowledge mapping KG1With KG2In specific entity replacement
Variable in regular collection in every rule obtains instantiation regular collection GR;
Wherein, KG1For the first knowledge mapping, KG2For the second knowledge mapping, all triples of the first knowledge mapping are inputted
Into AMIE+1 tool, these following rules are obtained:
(a, birth country, b)=" (a, birthplace, b)
(a, father, b) && (b, wife, c)=" (a, mother, c)
。。。。
Instantiation is exactly then to obtain following specific rule with the variable in specific entity Substitution Rules, these have
The set of the rule of body is denoted as instantiation regular collection:
(Xiao Ming, birth country, China)=" (Xiao Ming, birthplace, China)
(Xiao Ming, father are small rigid) (small rigid, wife, little Hua)=" (Xiao Ming, mother, little Hua)
。。。。
Wherein, all triples of the first knowledge mapping and the second knowledge mapping are input in AMIE+1 tool, example
Change in regular collection GR, premise triple and conclusion triple have corresponding relationship.
Step 112, the first of the first instance is determined based on the positive sample set and the instantiation regular collection
The value of second object vector of the value of object vector and the second instance;
Step 114, the value of value and second object vector based on the first object vector, to first ternary
Group and second triple carry out entity alignment.
Optionally, determine that alignment relation can be in the following manner based on first triple and second triple
It is realized: obtaining the third relationship in first triple;It calculates in the third relationship and second triple
Editing distance between the character string of 4th relationship;Judge whether the editing distance is 0, if so, by the third relationship with
4th relationship is aligned, and the alignment relation is obtained.
Specifically, the relationship pair that can be aligned in the first knowledge mapping and the second knowledge mapping can be first found, such as: (father
Parent, father) editing distance be 0, (father, father) is then alignment relation, and father comes from the first knowledge mapping, and father is from the
Two knowledge mappings.Alignment relation can also be (mother tongue, first language).
Optionally, the first mesh of the first instance is determined based on the positive sample set and the instantiation regular collection
The value for marking the value of vector and the second object vector of the second instance can be realized in the following manner:
Initialization step, by the entity to be aligned in the positive sample set in each triple assign initial first to
Relationship to be aligned in each triple in the positive sample set is assigned the value of initial secondary vector by the value of amount;If
Fixed first variable is 0, and the second variable is 0;
Specifically, triple can be converted to vector expression, initial value is assigned at random, such as: for entity " Xiao Ming " tax
One real-valued vectors " 0.56614321 " relationship " father " is assigned to " 0.9854423 ".
First variable update step, first variable add 1;
Arest neighbors triple obtaining step, the value based on the primary vector obtain more with each entity to be aligned
A first arest neighbors neighbours' triple, the value based on the secondary vector obtain multiple the second of each relationship to be aligned most
Neighbour neighbours' triple;
Optionally, the value based on the primary vector obtains adjacent with multiple first arest neighbors of each entity to be aligned
Occupying triple can be realized in the following manner: the primary vector of the acquisition entity to be aligned and the positive sample set
In other entities primary vector first distance;By the ascending sequence of the first distance, the first default name will be ordered as
Triple where other secondary corresponding described entities, as the first arest neighbors neighbours' triple;Based on described second
Multiple second arest neighbors neighbours triples that the value of vector obtains each relationship to be aligned can carry out in the following manner
It realizes: obtaining second of the secondary vector of other relationships in the secondary vector and the positive sample set of the relationship to be aligned
Distance;By the ascending sequence of the second distance, will be ordered as where other corresponding described relationships of the second default ranking
Triple, as the second arest neighbors neighbours' triple.
Optionally, the value based on the primary vector obtains adjacent with multiple first arest neighbors of each entity to be aligned
Before occupying triple, the method also needs to execute following steps: based on the entity to be aligned in the positive sample set
The sum of total, the described relationship to be aligned determines the described first default ranking and the described second default ranking with parameter preset.
It before arest neighbors triple obtaining step, also needs to define hyper parameter ∈ ∈ (0,1), be calculated according to formula (4) real
Body arest neighbors neighbours' number peValue, wherein N be entity sum;According to formula (5) calculated relationship arest neighbors neighbours' number pr's
Value, wherein M is the sum of relationship;
Assuming that the result p finally calculatede=10, pr=5.
The effect of the arest neighbors triple obtaining step is that relationship and entity all calculate an arest neighbors neighborhood.Citing
Illustrate: the arest neighbors neighborhood of computational entity " Xiao Ming " (vector 0.56614321), specific calculate is exactly to utilize to span
The vector of Xiao Ming is calculated at a distance from the vector of other entities from formula.It is that Xiao Ming's arest neighbors is adjacent apart from the smallest 10 entities
Occupy set.(taking 10 here is because of pe=10).Similarly the arest neighbors neighborhood of calculated relationship " father " is the same way,
But due to pr=5, so only calculating 5.
Second variable update step, second variable add 1;
Negative sample generation step is sampled the positive sample set, obtains multiple sampling triples, according to described
One arest neighbors neighbours' triple is that each sampling triple generates multiple first negative sample triples, to the instantiation rule set
Conjunction is sampled, and obtains multiple sampling prescriptions, is that the generation of each sampling prescription is more according to the second arest neighbors neighbours' triple
A negative sample example rule;
The effect of negative sample generation step is exactly to generate negative sample.Be divided into forIn triple generate and negative sample and be
The rule instantiated in regular collection GR generates negative sample.
Optionally, InIn random q triple of sampling without peplacement, be each triple v negative sample triple of generation,
Specific generation method replaces head entity to randomly choose an entity in the arest neighbors neighborhood of triple head entity, or three
Entity replacement tail entity is randomly choosed in the arest neighbors neighborhood of tuple tail entity;Random sampling without peplacement w in GR
Example rule, and v negative sample example rule is generated for each rule, specific generation method is in example rule conclusion triple
A relationship, which is randomly choosed, in the arest neighbors neighborhood of relationship replaces the relationship.
The method of triple generation negative sample: (Xiao Ming, father are small rigid) assumes the arest neighbors neighborhood of entity " Xiao Ming "
In have entity " big bright ", just with big bright replacement Xiao Ming.Obtain negative sample triple (big bright, father, small rigid).Or it is small just most
Have in neighbour's neighborhood entity " big rigid ", it is small just good with just replacing greatly.Negative sample triple is denoted as
The method that instantiation rule generates negative sample:
(Xiao Ming, birth country, China)=" (Xiao Ming, birthplace, China) this one-to-one rule: assuming that relationship is " out
There is relationship " capital " in the arest neighbors neighborhood of Radix Rehmanniae ", just obtains negative sample rule with area replacement birthplace: (Xiao Ming, out
Raw country, China)=" (Xiao Ming, capital, China).
(Xiao Ming, father are small rigid) (small rigid, wife, little Hua)=" (Xiao Ming, mother, little Hua) this two pair one rule
Then: assuming that there is relationship " relative by marriage " in the arest neighbors neighborhood of relationship " mother ", just replacing mother with relative by marriage and obtain negative sample rule
Then: (Xiao Ming, father are small rigid) (small rigid, wife, little Hua)=" (Xiao Ming, relative by marriage, little Hua) negative sample rule is denoted as GR '.
Score step, calculates corresponding first scoring of the positive sample set, the multiple first negative sample triple pair
The second scoring for answering, the corresponding third of the instantiation regular collection are scored, the multiple negative sample example rule corresponding the
Four scorings;
Initial target function determines step, is scored based on first scoring with described second and determines first object function
Value is scored with the described 4th based on third scoring and determines the value of the second objective function;
Optionally, in formula (6), hn, rn, tnFor corresponding positive sample set, multiple first negative sample triples, the reality
The vector of entity and relationship in exampleization regular collection and multiple negative sample example rules in triple indicates;In formula (7),
T1, T2 are the corresponding premise triple of example rule, T3For the corresponding conclusion triple of example rule;
F (GR)=f (T1)·f(T3)-f(T1)+1Or f (T1)·f(T2)·f(T3)-f(T1)·f(T2)+1 (7)
Wherein, f (T) is and hn, rn, tnCorresponding scores.
F (T1) and f (T2) is scores corresponding with the premise triple of example rule, f (T3) it is example rule
The corresponding scores of conclusion triple.
First object function is calculated according to formula (8) and calculates the second objective function according to formula (9);
Wherein, in formula (8), μ1、γ1With γ2Can be constant set by user, f (T) be positive in sample set three
The corresponding score of tuple, f (T ') are the corresponding score of the first negative sample triple,Be positive sample set,It is negative for first
The set of sample triple.Also, f (T ') is the first scoring, and f (T ') is the second scoring, OTFor first object function.
Wherein, in formula (9), μ1、γ1With γ2It can be constant set by user, f (R*) it is in instantiation regular collection
The corresponding score of triple, f (R '*) sample instance that is negative rule in the corresponding score of triple, GR be instantiation rule set
Close, GR ' be negative sample instance rule in triple set.Also, f (R*) it is that third scores, f (R '*) it is the 4th scoring, OR
For the second objective function.
Initial target function determines that the effect of step is the loss function for calculating triple and rule.
Catalogue scalar functions determine step, according to the value of the value of the first object function and second objective function, with
And default weight determines third objective function;
Oe=OT+wOR (10)
Wherein, w is constant set by user, OeFor third objective function.
Step is minimized, the third objective function is minimized, when obtaining third objective function minimum, first ternary
The value of 4th vector of the entity to be aligned in the value of the third vector of the entity to be aligned in group, with second triple;
Circulation terminates to determine step, judges that second variable whether less than the first preset threshold, executes if so, returning
Above-mentioned negative sample generation step, if it is not, then judging that first variable whether less than the second preset threshold, if being less than, returns
Above-mentioned arest neighbors triple obtaining step is executed, if being not less than, following object vector value is executed and determines step;
Object vector value determines step, respectively using the value of the value of the third vector and the 4th vector as described the
The value of one object vector, the value with second object vector.
Optionally, the value of value and second object vector based on the first object vector, to first ternary
Group, second triple carry out entity alignment can be realized in the following manner: calculate the first object vector with
The vector distance of second object vector, judges whether the vector distance is less than default vector distance, obtains judging result,
If judging result is designated as, by the first object vector the first triple corresponding with second object vector
It is aligned with the entity in the second triple, wherein default vector distance can be defined by the user.
Optionally, the vector distance for calculating the first object vector and second object vector can be by with lower section
Formula is realized: calculating the m-cosine distance of the first object vector Yu second object vector.
Specifically, the COS distance between computational entity vector, and define threshold gamma3If distance is less than γ3As it is aligned
Entity.
By iterating above, each entity can obtain a final vector: such as:
Mother: 0.5684235
Mother: 0.5689446
Then the COS distance for calculating the two vectors is utilized, it is assumed that be 0.0001.It was found that it is less than γ3.Then this two
A entity can be aligned.
This application discloses a kind of new two stage entity alignment techniques, combines method based on similarity and be based on
The advantages of method of expression.Introducing relationship exchanging policy enhances expression model by alignment relation.Establish combine triple with
The hybrid representation model of logic rules introduces a kind of objective function towards alignment to solve entity alignment problem for rule.
The application combines traditional entity alignment techniques based on similarity and the entity alignment techniques based on expression study.It takes
The strategy of relationship exchange indicates model using the relationship enhancing being aligned.It introduces and combines the expression model of logic rules to solve reality
Body alignment problem, and propose that a hybrid optimization function optimization indicates model.An entity-oriented pair is defined for logic rules
Neat objective function.
The two stages entity pair of relationship alignment and hybrid representation study this application discloses a kind of combination based on similarity
Neat method, wherein the first stage is aligned relationship using the method based on similarity of character string, obtains an alignment relation
Set combines the relationship alignment based on similarity with knowledge mapping expression.Second stage utilizes the table in conjunction with logic rules
The vector of representation model learning object indicates, establishes the hybrid representation model for combining triple and logic rules, obtains reality
The vector of body indicates.Then, we can judge whether they are reciprocity real by the distance between computational entity vector expression
Body can be aligned.Traditional entity alignment based on similarity is aligned with the entity based on expression and is combined, is combined
Based on the higher feature of similarity based method precision and the wider feature of method application scenarios based on expression, improve naturally
The precision of entity alignment.Meanwhile logic rules are introduced in indicating model, the predictive ability for indicating model is enhanced, is obtained
More believable entity vector indicates.
Secondly, in the embodiment of the present application, using acquisition the first knowledge mapping and the second knowledge mapping to be aligned, and
It is aligned seed, wherein include multiple first triples in first knowledge mapping, include multiple in second knowledge mapping
Second triple, the alignment seed include that the first alignment entity being aligned is aligned entity, first alignment with second
Entity belongs to first triple, and the second alignment entity belongs to second triple;Based on first triple
Alignment relation is determined with second triple, and the alignment relation includes the first alignment relation, described with the second alignment relation
First alignment relation belongs to first triple, and second alignment relation belongs to second triple;By described first
With first the identical head entity of entity is aligned in triple replaces with described second and be aligned entity, obtain third triple;By institute
It states in the second triple to be aligned the identical tail entity of entity with described second and replace with described first and is aligned entity, obtain the four or three
First relationship identical with first alignment relation in first triple is replaced with described second and is aligned pass by tuple
System, obtains the 5th triple;Second relationship identical with second alignment relation in second triple is replaced with into institute
The first alignment relation is stated, the 6th triple is obtained;Calculate first triple, second triple, the third ternary
Group, the 4th triple, the 5th triple, the union of the 6th triple, obtain positive sample set;According to described
First triple and the second triple establish instantiation regular collection, and the instantiation regular collection includes: the multiple described
The correspondence relationship information between correspondence relationship information and multiple second triples between first triple;Based on institute
State positive sample set and the instantiation regular collection determine the first instance first object vector value and described the
The value of second object vector of two entities;The value of value and second object vector based on the first object vector, to institute
The mode that the first triple and second triple carry out entity alignment is stated, by by traditional entity based on similarity
Alignment is aligned with the entity based on expression to be combined, and is combined based on the higher feature of similarity based method precision and based on expression
The wider feature of method application scenarios improves the precision of entity alignment.Meanwhile logic rules are introduced in indicating model,
The predictive ability for indicating model is enhanced, obtaining more believable entity vector indicates, has reached and has improved the accurate of entity alignment
The technical effect of degree, and then the information content solved in the knowledge mapping that entity alignment thereof in the prior art is related to is less,
The lower technical problem of the accuracy of entity alignment.
According to the embodiment of the present application, a kind of alignment schemes are additionally provided, as shown in Fig. 2, method includes the following steps:
Step S202 is closed based on the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, alignment
System determines positive sample set and instantiation regular collection;
Optionally it is determined that the method also needs to execute following steps: obtaining before positive sample set and instantiation regular collection
Take the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein include in first knowledge mapping
Multiple first triples include multiple second triples in second knowledge mapping, and the alignment seed is including being aligned
The first alignment entity be aligned entity with second, the first alignment entity belongs to first triple, and described second is aligned
Entity belongs to second triple;Alignment relation is determined based on first triple and second triple, it is described right
Homogeneous relation includes the first alignment relation, and with the second alignment relation, first alignment relation belongs to first triple, described
Second alignment relation belongs to second triple;
Optionally it is determined that positive sample set can be realized in the following manner: by first triple with
The identical entity of one alignment entity replaces with the second alignment entity, obtains third triple;It will be in second triple
The identical entity of entity is aligned with described second replaces with described first and be aligned entity, the 4th triple is obtained, by described first
The first relationship identical with first alignment relation replaces with second alignment relation in triple, obtains the 5th ternary
Group;Second relationship identical with second alignment relation in second triple is replaced with into first alignment relation,
Obtain the 6th triple;Calculate first triple, second triple, the third triple, the 4th ternary
Group, the 5th triple, the union of the 6th triple, obtain positive sample set;
Determine that instantiation regular collection can be realized in the following manner: according to first triple and the two or three
Tuple establishes instantiation regular collection, and the instantiation regular collection can be with are as follows: between the multiple first triple
Correspondence relationship information between correspondence relationship information and multiple second triples;
Step S204 is known the first knowledge mapping with second with the instantiation regular collection based on the positive sample set
Know map and carries out entity alignment.
Based on the positive sample set and the instantiation regular collection by the first knowledge mapping and the second knowledge mapping into
The alignment of row entity can be realized in the following manner:
The first object vector of the first instance is determined based on the positive sample set and the instantiation regular collection
Value and the second instance the second object vector value;Value and second mesh based on the first object vector
The value for marking vector carries out entity alignment to first triple and second triple.
It should be noted that the correlation that the preferred embodiment of embodiment illustrated in fig. 2 may refer to embodiment illustrated in fig. 1 is retouched
It states, details are not described herein again.
According to the embodiment of the present application, additionally provide it is a kind of for implementing the alignment means of above-mentioned alignment schemes, such as Fig. 3 institute
Show, which includes: to obtain module 32, the first determining module 34, replacement module 36, computing module 38, establish module 310, the
Two determining modules 312, alignment module 314;Wherein:
Module 32 is obtained, for obtaining the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed,
In, include multiple first triples in first knowledge mapping, include multiple second triples in second knowledge mapping,
The alignment seed includes that the first alignment entity being aligned is aligned entity with second, and the first alignment entity belongs to described
First triple, the second alignment entity belong to second triple;
First determining module 34, for determining alignment relation based on first triple and second triple, institute
Stating alignment relation includes the first alignment relation, and with the second alignment relation, first alignment relation belongs to first triple,
Second alignment relation belongs to second triple;
Replacement module 36 replaces with described for will be aligned the identical entity of entity in first triple with first
Two alignment entities, obtain third triple;The identical entity replacement of entity will be aligned in second triple with described second
For the first alignment entity, the 4th triple is obtained, it will be identical with first alignment relation in first triple
First relationship replaces with second alignment relation, obtains the 5th triple;By in second triple with described second pair
Identical second relationship of homogeneous relation replaces with first alignment relation, obtains the 6th triple;
Computing module 38, for calculating first triple, second triple, the third triple, described
4th triple, the 5th triple, the union of the 6th triple, obtain positive sample set;
Module 310 is established, it is described for establishing instantiation regular collection according to first triple and the second triple
Instantiation regular collection includes: the correspondence relationship information and multiple described second between the multiple first triple
Correspondence relationship information between triple;
Second determining module 312, for determining described the based on the positive sample set and the instantiation regular collection
The value of second object vector of the value and second instance of the first object vector of one entity;
Alignment module 314, for the value of value and second object vector based on the first object vector, to described
First triple and second triple carry out entity alignment.
Specifically, the first determining module 34 is used to obtain the third relationship in first triple;Calculate the third
Editing distance between relationship and the character string of the 4th relationship in second triple;Judge whether the editing distance is 0,
If so, the third relationship is aligned with the 4th relationship, the alignment relation is obtained.
Optionally, the second determining module 312 is for executing following steps: initialization step, will be in the positive sample set
Entity to be aligned in each triple assigns the value of initial primary vector, by each triple in the positive sample set
In relationship to be aligned assign the value of initial secondary vector;The first variable is set as 0, the second variable is 0;First variable update
Step, first variable add 1;Arest neighbors triple obtaining step, value based on the primary vector obtain with it is each described
Multiple first arest neighbors neighbours' triples of entity to be aligned, the value based on the secondary vector obtain each pass to be aligned
Multiple second arest neighbors neighbours' triples of system;
Second variable update step, second variable add 1;Negative sample generation step carries out the positive sample set
Sampling, obtains multiple sampling triples, is that the generation of each sampling triple is multiple according to the first arest neighbors neighbours' triple
First negative sample triple is sampled the instantiation regular collection, obtains multiple sampling prescriptions, most according to described second
Neighbour neighbours' triple is that each sampling prescription generates multiple negative sample example rules;Score step, calculates the positive sample collection
Close corresponding first scoring, corresponding second scoring of the multiple first negative sample triple, the instantiation regular collection pair
Third scoring, corresponding 4th scoring of the multiple negative sample example rule answered;Initial target function determines step, is based on institute
It states the first scoring and second scoring determines the value of first object function, being scored based on the third, it is true to score with the described 4th
The value of fixed second objective function;Catalogue scalar functions determine step, according to the value of the first object function and second target
The value of function and default weight determine third objective function;Step is minimized, the third objective function is minimized, obtains
Of entity to be aligned in the value of the third vector of entity to be aligned in first triple, with second triple
The value of four vectors;Circulation terminates to determine step, judges second variable whether less than the first preset threshold, if so, returning
Step S110 is executed, if it is not, then judging that first variable whether less than the second preset threshold, if being less than, returns and executes step
Rapid S106 executes following steps S122 if being not less than;Object vector value determines step, respectively by the value of the third vector
Value with the value of the 4th vector as the first object vector, the value with second object vector.
Specifically, alignment module 314 be used to calculate the first object vector and second object vector to span
From, judge whether the vector distance is less than default vector distance, obtain judging result, if judging result be designated as be, will
Entity in the first object vector the first triple corresponding with second object vector and the second triple into
Row alignment.
Optionally, described device is also used to obtain its in the primary vector and the positive sample set of the entity to be aligned
The first distance of the primary vector of his entity;By the ascending sequence of the first distance, the first default ranking will be ordered as
Triple where other corresponding described entities, as the first arest neighbors neighbours' triple;Described device is also used to obtain
Take the second distance of the secondary vector of other relationships in the secondary vector and the positive sample set of the relationship to be aligned;It will
The ascending sequence of second distance will be ordered as the ternary where other corresponding described relationships of the second default ranking
Group, as the second arest neighbors neighbours' triple.
Optionally, described device is also used to based on the total, described of the entity to be aligned in the positive sample set
The sum of relationship to be aligned determines the described first default ranking and the described second default ranking with parameter preset.
Specifically, alignment module 314 be used to calculate the cosine of the first object vector and second object vector to
Span from.
According to the other side of the embodiment of the present application, a kind of storage medium is additionally provided, storage medium includes storage
Program, optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps: obtaining
First knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein include more in first knowledge mapping
A first triple includes multiple second triples in second knowledge mapping, and the alignment seed includes being aligned
First alignment entity is aligned entity with second, and the first alignment entity belongs to first triple, and second alignment is real
Body belongs to second triple;Alignment relation, the alignment are determined based on first triple and second triple
Relationship includes the first alignment relation, and the second alignment relation, and first alignment relation belongs to first triple, and described the
Two alignment relations belong to second triple;The identical entity of entity will be aligned in first triple with first to replace with
The second alignment entity, obtains third triple;The identical reality of entity will be aligned with described second in second triple
Body replace with it is described first alignment entity, obtain the 4th triple, by first triple with first alignment relation
Identical first relationship replaces with second alignment relation, obtains the 5th triple;By in second triple with it is described
Identical second relationship of second alignment relation replaces with first alignment relation, obtains the 6th triple;Calculate described first
Triple, second triple, the third triple, the 4th triple, the 5th triple, the described 6th 3
The union of tuple obtains positive sample set;Instantiation regular collection, institute are established according to first triple and the second triple
Stating instantiation regular collection includes: correspondence relationship information between the multiple first triple and multiple described the
Correspondence relationship information between two triples;Described first is determined based on the positive sample set and the instantiation regular collection
The value of second object vector of the value and second instance of the first object vector of entity;Based on the first object to
The value of the value of amount and second object vector carries out entity alignment to first triple and second triple.
According to the other side of the embodiment of the present application, a kind of processor is additionally provided, processor is used to run program,
In, program can be with the program code of following steps in the alignment schemes of executing application when running:
Obtain the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein first knowledge
Include multiple first triples in map, includes multiple second triples in second knowledge mapping, the alignment kind attached bag
It includes the first alignment entity being aligned and is aligned entity with second, the first alignment entity belongs to first triple, institute
It states the second alignment entity and belongs to second triple;Pass is aligned with second triple determination based on first triple
System, the alignment relation include the first alignment relation, and with the second alignment relation, first alignment relation belongs to the described 1st
Tuple, second alignment relation belong to second triple;It is identical by entity is aligned with first in first triple
Entity replace with it is described second alignment entity, obtain third triple;It will be aligned in second triple with described second
The identical entity of entity replace with it is described first alignment entity, obtain the 4th triple, by first triple with it is described
Identical first relationship of first alignment relation replaces with second alignment relation, obtains the 5th triple;By the described 2nd 3
The second relationship identical with second alignment relation replaces with first alignment relation in tuple, obtains the 6th triple;
Calculate first triple, second triple, the third triple, the 4th triple, the 5th ternary
The union of group, the 6th triple, obtains positive sample set;Example is established according to first triple and the second triple
Change regular collection, the instantiation regular collection includes: the correspondence relationship information between the multiple first triple, with
And the correspondence relationship information between multiple second triples;Based on the positive sample set and the instantiation regular collection
Determine the value of the value of the first object vector of the first instance and the second object vector of the second instance;Based on institute
State the value of first object vector and the value of second object vector, to first triple and second triple into
The alignment of row entity.
It should be noted that the correlation that the preferred embodiment of embodiment illustrated in fig. 3 may refer to embodiment illustrated in fig. 1 is retouched
It states, details are not described herein again.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
In above-described embodiment of the application, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of unit, can be one kind
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of unit or module,
It can be electrical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple units
On.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product
To be stored in a computer readable storage medium.Based on this understanding, the technical solution of the application substantially or
Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products
Out, which is stored in a storage medium, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of step of each embodiment method of the application
Suddenly.And storage medium above-mentioned includes: USB flash disk, read-only memory (ROM, Read-0nly Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
The above is only the preferred embodiments of the application, it is noted that those skilled in the art are come
It says, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications also should be regarded as
The protection scope of the application.
Claims (10)
1. a kind of alignment schemes characterized by comprising
Obtain the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein first knowledge mapping
In include multiple first triples, include multiple second triples in second knowledge mapping, the alignment seed is including
The first alignment entity through being aligned is aligned entity with second, and described first, which is aligned entity, belongs to first triple, and described the
Two alignment entities belong to second triple;
Determine that alignment relation, the alignment relation include that the first alignment is closed based on first triple and second triple
System, with the second alignment relation, first alignment relation belongs to first triple, and second alignment relation belongs to described
Second triple;
It the identical entity of entity will be aligned in first triple with first replaces with described second and be aligned entity, obtain third
Triple;It the identical entity of entity will be aligned in second triple with described second replaces with described first and be aligned entity,
The 4th triple is obtained, the first relationship identical with first alignment relation in first triple is replaced with described
Two alignment relations obtain the 5th triple;By the second relationship identical with second alignment relation in second triple
First alignment relation is replaced with, the 6th triple is obtained;
Calculate first triple, second triple, the third triple, the 4th triple, the described 5th
The union of triple, the 6th triple, obtains positive sample set;
Instantiation regular collection is established according to first triple and the second triple, the instantiation regular collection includes:
The corresponding relationship between correspondence relationship information and multiple second triples between the multiple first triple
Information;
The value of the first object vector of the first instance is determined based on the positive sample set and the instantiation regular collection,
And the value of the second object vector of the second instance;
The value of value based on the first object vector and second object vector, to first triple and described the
Two triples carry out entity alignment.
2. the method according to claim 1, wherein true based on first triple and second triple
Determining alignment relation includes:
Obtain the third relationship in first triple;
Calculate the editing distance between the third relationship and the character string of the 4th relationship in second triple;
Judge whether the editing distance is 0, if so, the third relationship is aligned with the 4th relationship, obtains
The alignment relation.
3. according to the method described in claim 2, it is characterized in that, based on the positive sample set and the instantiation rule set
Conjunction determines that the value of the value of the first object vector of the first instance and the second object vector of the second instance includes:
Initialization step assigns the entity to be aligned in the positive sample set in each triple to initial primary vector
Relationship to be aligned in each triple in the positive sample set, is assigned the value of initial secondary vector by value;Setting the
One variable is 0, and the second variable is 0;
First variable update step, first variable add 1;
Arest neighbors triple obtaining step, value based on the primary vector obtain multiple the with each entity to be aligned
One arest neighbors neighbours' triple, the value based on the secondary vector obtain multiple second arest neighbors of each relationship to be aligned
Neighbours' triple;
Second variable update step, second variable add 1;
Negative sample generation step is sampled the positive sample set, obtains multiple sampling triples, most according to described first
Neighbour neighbours' triple is the multiple first negative sample triples of each sampling triple generation, to the instantiation regular collection into
Line sampling obtains multiple sampling prescriptions, is that each sampling prescription generates multiple bear according to the second arest neighbors neighbours' triple
Sample instance rule;
Score step, calculate the positive sample set it is corresponding first scoring, the multiple first negative sample triple it is corresponding
Second scoring, the corresponding third scoring of the instantiation regular collection, the multiple negative sample example rule the corresponding 4th are commented
Point;
Initial target function determines step, is scored based on first scoring with described second and determines the value of first object function,
It is scored based on third scoring with the described 4th and determines the value of the second objective function;
Catalogue scalar functions determine step, according to the value of the value of the first object function and second objective function, and it is pre-
If weight determines third objective function;
Step is minimized, the third objective function is minimized, obtains the third of the entity to be aligned in first triple
The value of 4th vector of the entity to be aligned in the value of vector, with second triple;
Circulation terminates to determine step, judges second variable whether less than the first preset threshold, if so, returning to step
S110, if it is not, then judge that first variable whether less than the second preset threshold, if being less than, returns to step S106, if
It is not less than, then executes following steps S122;
Object vector value determines step, respectively using the value of the third vector and the value of the 4th vector as first mesh
Mark the value of vector, the value with second object vector.
4. according to the method described in claim 3, it is characterized in that, value and second mesh based on the first object vector
The value for marking vector, carrying out entity alignment to first triple, second triple includes:
The vector distance for calculating the first object vector Yu second object vector, judges whether the vector distance is less than
Default vector distance obtains judging result, if judging result be designated as be, by the first object vector and second mesh
Corresponding first triple of mark vector is aligned with the entity in the second triple.
5. according to the method described in claim 4, it is characterized in that, value based on the primary vector obtain with it is each it is described to
Alignment entity multiple first arest neighbors neighbours' triples include:
Obtain the first of the primary vector of the entity to be aligned and the primary vector of other entities in the positive sample set away from
From;
By the ascending sequence of the first distance, will be ordered as where other corresponding described entities of the first default ranking
Triple, as the first arest neighbors neighbours' triple;
Multiple second arest neighbors neighbours' triples that value based on the secondary vector obtains each relationship to be aligned include:
Obtain second of the secondary vector of other relationships in the secondary vector and the positive sample set of the relationship to be aligned
Distance;
By the ascending sequence of the second distance, will be ordered as where other corresponding described relationships of the second default ranking
Triple, as the second arest neighbors neighbours' triple.
6. according to the method described in claim 5, it is characterized in that, value based on the primary vector obtain with it is each it is described to
It is aligned before multiple first arest neighbors neighbours' triples of entity, the method also includes:
The sum of total, the described relationship to be aligned based on the entity to be aligned in the positive sample set, with default ginseng
Number determines the first default ranking and the described second default ranking.
7. according to the method described in claim 3, it is characterized in that, calculate the first object vector and second target to
The vector distance of amount includes:
Calculate the m-cosine distance of the first object vector Yu second object vector.
8. a kind of alignment means characterized by comprising
Module is obtained, for obtaining the first knowledge mapping and the second knowledge mapping to be aligned, and alignment seed, wherein institute
Stating includes multiple first triples in the first knowledge mapping, includes multiple second triples in second knowledge mapping, described
Alignment seed includes that the first alignment entity being aligned is aligned entity with second, and the first alignment entity belongs to described first
Triple, the second alignment entity belong to second triple;
First determining module, for determining alignment relation, the alignment based on first triple and second triple
Relationship includes the first alignment relation, and the second alignment relation, and first alignment relation belongs to first triple, and described the
Two alignment relations belong to second triple;
Replacement module replaces with described second for will be aligned the identical entity of entity in first triple with first and is aligned
Entity obtains third triple;To be aligned in second triple with described second the identical entity of entity replace with it is described
First alignment entity, obtains the 4th triple, and in first triple identical with first alignment relation first is closed
System replaces with second alignment relation, obtains the 5th triple;By in second triple with second alignment relation
Identical second relationship replaces with first alignment relation, obtains the 6th triple;
Computing module, for calculating first triple, second triple, the third triple, the described 4th 3
Tuple, the 5th triple, the union of the 6th triple, obtain positive sample set;
Module is established, for establishing instantiation regular collection, the instantiation according to first triple and the second triple
Regular collection includes: the correspondence relationship information and multiple second triples between the multiple first triple
Between correspondence relationship information;
Second determining module, for determining the first instance based on the positive sample set and the instantiation regular collection
The value of second object vector of the value of first object vector and the second instance;
Alignment module, for the value of value and second object vector based on the first object vector, to the described 1st
Tuple and second triple carry out entity alignment.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When control the storage medium where equipment perform claim require any one of 1 to 7 described in alignment schemes.
10. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run
Benefit require any one of 1 to 7 described in alignment schemes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910797439.4A CN110516078A (en) | 2019-08-27 | 2019-08-27 | Alignment schemes and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910797439.4A CN110516078A (en) | 2019-08-27 | 2019-08-27 | Alignment schemes and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110516078A true CN110516078A (en) | 2019-11-29 |
Family
ID=68627291
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910797439.4A Pending CN110516078A (en) | 2019-08-27 | 2019-08-27 | Alignment schemes and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110516078A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112445876A (en) * | 2020-11-25 | 2021-03-05 | 中国科学院自动化研究所 | Entity alignment method and system fusing structure, attribute and relationship information |
CN114676267A (en) * | 2022-04-01 | 2022-06-28 | 北京明略软件系统有限公司 | Method and device for entity alignment and electronic equipment |
WO2022222226A1 (en) * | 2021-04-19 | 2022-10-27 | 平安科技(深圳)有限公司 | Structured-information-based relation alignment method and apparatus, and device and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391512A (en) * | 2016-05-17 | 2017-11-24 | 北京邮电大学 | The method and apparatus of knowledge mapping prediction |
CN107480191A (en) * | 2017-07-12 | 2017-12-15 | 清华大学 | A kind of entity alignment model of iteration |
-
2019
- 2019-08-27 CN CN201910797439.4A patent/CN110516078A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107391512A (en) * | 2016-05-17 | 2017-11-24 | 北京邮电大学 | The method and apparatus of knowledge mapping prediction |
CN107480191A (en) * | 2017-07-12 | 2017-12-15 | 清华大学 | A kind of entity alignment model of iteration |
Non-Patent Citations (2)
Title |
---|
TINGTING JIANG ET AL.: "Two-Stage Entity Alignment: Combining Hybrid Knowledge Graph Embedding with Similarity-Based Relation Alignment", 《THE 16TH PACIFIC RIM INTERNATIONAL CONFERENCE ON ARTIFICIAL INTELLIGENCE》 * |
ZEQUN SUN ET AL.: "Bootstrapping Entity Alignment with Knowledge Graph Embedding", 《TWENTY-SEVENTH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112445876A (en) * | 2020-11-25 | 2021-03-05 | 中国科学院自动化研究所 | Entity alignment method and system fusing structure, attribute and relationship information |
CN112445876B (en) * | 2020-11-25 | 2023-12-26 | 中国科学院自动化研究所 | Entity alignment method and system for fusing structure, attribute and relationship information |
WO2022222226A1 (en) * | 2021-04-19 | 2022-10-27 | 平安科技(深圳)有限公司 | Structured-information-based relation alignment method and apparatus, and device and medium |
CN114676267A (en) * | 2022-04-01 | 2022-06-28 | 北京明略软件系统有限公司 | Method and device for entity alignment and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111488474B (en) | Fine-grained freehand sketch image retrieval method based on attention enhancement | |
CN103559504B (en) | Image target category identification method and device | |
CN110516078A (en) | Alignment schemes and device | |
CN109739939A (en) | The data fusion method and device of knowledge mapping | |
CN110472681A (en) | The neural metwork training scheme and image procossing scheme of knowledge based distillation | |
CN108664999A (en) | A kind of training method and its device, computer server of disaggregated model | |
CN114841257B (en) | Small sample target detection method based on self-supervision comparison constraint | |
CN110046262A (en) | A kind of Context Reasoning method based on law expert's knowledge base | |
CN109033129A (en) | Multi-source Information Fusion knowledge mapping based on adaptive weighting indicates learning method | |
CN106528648B (en) | In conjunction with the distributed RDF keyword proximity search method of Redis memory database | |
CN104679868B (en) | A kind of missing data complementing method based on incidence relation between data | |
CN107003834A (en) | Pedestrian detection apparatus and method | |
CN110442725A (en) | Entity relation extraction method and device | |
CN110263332A (en) | A kind of natural language Relation extraction method neural network based | |
CN112308115A (en) | Multi-label image deep learning classification method and equipment | |
CN112580636A (en) | Image aesthetic quality evaluation method based on cross-modal collaborative reasoning | |
CN114254093A (en) | Multi-space knowledge enhanced knowledge graph question-answering method and system | |
CN108052683B (en) | Knowledge graph representation learning method based on cosine measurement rule | |
CN116030025A (en) | Hepatocellular carcinoma prediction method based on modal sensing distillation network | |
Ni et al. | Automated medical diagnosis by ranking clusters across the symptom-disease network | |
CN111241326A (en) | Image visual relation referring and positioning method based on attention pyramid network | |
CN111125318A (en) | Method for improving knowledge graph relation prediction performance based on sememe-semantic item information | |
CN107451617A (en) | One kind figure transduction semisupervised classification method | |
CN112232147B (en) | Method, device and system for self-adaptive acquisition of super-parameters of face model | |
CN116737956A (en) | Entity alignment method and device for multi-mode knowledge graph |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191129 |
|
RJ01 | Rejection of invention patent application after publication |