CN111782826A - Knowledge graph information processing method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN111782826A
CN111782826A CN202010881365.5A CN202010881365A CN111782826A CN 111782826 A CN111782826 A CN 111782826A CN 202010881365 A CN202010881365 A CN 202010881365A CN 111782826 A CN111782826 A CN 111782826A
Authority
CN
China
Prior art keywords
vector representation
entity
target
historical
kth
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010881365.5A
Other languages
Chinese (zh)
Inventor
刘知远
韩旭
林衍凯
李鹏
孙茂松
周杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tsinghua University
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University, Tencent Technology Shenzhen Co Ltd filed Critical Tsinghua University
Priority to CN202010881365.5A priority Critical patent/CN111782826A/en
Publication of CN111782826A publication Critical patent/CN111782826A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

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

The embodiment of the application provides an information processing method, device and equipment of a knowledge graph and a storage medium, and relates to the technical field of knowledge graphs and machine learning. The method comprises the following steps: acquiring knowledge maps corresponding to a plurality of map learning tasks respectively; performing dimension expansion processing on vector representation of historical entities and vector representation of historical relations appearing in the first k-1 map learning tasks; determining the initial vector representation of the newly added entity and the initial vector representation of the newly added relation in the kth knowledge graph; adjusting the initial vector representation of the target entity and the initial vector representation of the target relationship during the execution of the kth learning task; and performing dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship. According to the technical scheme, the accuracy of knowledge graph learning can be improved.

Description

Knowledge graph information processing method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of knowledge graphs and machine learning, in particular to a method, a device, equipment and a storage medium for processing information of knowledge graphs.
Background
With the increasing of the human general knowledge, the increased knowledge is required to be added to the existing old knowledge-graph frequently, so that the knowledge-graph is continuously updated.
In the related art, the knowledge graph comprises entities and relations, and the knowledge graph is continuously learned based on old parameters of a learning model of the knowledge graph, so that the change of the old parameters with larger influence on old data samples is reduced, and the probability that the knowledge graph forgets the old data catastrophically during learning is reduced.
In the above technique, when the number of new entities and new relationships in the knowledge graph is increased greatly, the size of the feature space of the learning model is limited, so that the learning accuracy of the knowledge graph is low.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for processing knowledge graph information and a storage medium, and can improve the learning accuracy of the knowledge graph. The technical scheme is as follows:
according to an aspect of an embodiment of the present application, there is provided an information processing method of a knowledge graph, the method including:
acquiring knowledge maps corresponding to a plurality of map learning tasks respectively; the kth knowledge graph learning task is used for learning a kth knowledge graph, the kth knowledge graph comprises a plurality of entities and at least one group of relations among the entities, and k is a positive integer;
before the kth map learning task is executed, performing dimension expansion processing on vector representations of historical entities and vector representations of historical relations appearing in the first k-1 map learning tasks to obtain initial vector representations of the historical entities in the kth map learning task and initial vector representations of the historical relations in the kth map learning task;
determining initial vector representation of a newly added entity and initial vector representation of a newly added relation in the kth knowledge graph;
in the process of executing the kth learning task, adjusting the initial vector representation of a target entity and the initial vector representation of a target relationship to obtain the learned vector representation of the target entity and the learned vector representation of the target relationship; the target entity comprises the historical entity and the newly added entity, and the target relationship comprises the historical relationship and the newly added relationship;
and performing dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
According to an aspect of an embodiment of the present application, there is provided an information processing apparatus of a knowledge-graph, the apparatus including:
the map acquisition module is used for acquiring knowledge maps corresponding to the plurality of map learning tasks respectively; the kth knowledge graph learning task is used for learning a kth knowledge graph, the kth knowledge graph comprises a plurality of entities and at least one group of relations among the entities, and k is a positive integer;
the dimension expansion module is used for performing dimension expansion processing on vector representations of historical entities and vector representations of historical relations appearing in the first k-1 map learning tasks before the kth map learning task is executed to obtain initial vector representations of the historical entities in the kth map learning task and initial vector representations of the historical relations in the kth map learning task;
the vector determining module is used for determining the initial vector representation of the new entity and the initial vector representation of the new relationship in the kth knowledge graph;
a vector adjusting module, configured to adjust an initial vector representation of a target entity and an initial vector representation of a target relationship in a process of executing the kth learning task, to obtain a learned vector representation of the target entity and a learned vector representation of the target relationship; the target entity comprises the historical entity and the newly added entity, and the target relationship comprises the historical relationship and the newly added relationship;
and the dimension compression module is used for carrying out dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
According to an aspect of embodiments of the present application, there is provided a computer device including a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the information processing method of the above-described knowledge-graph.
According to an aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement an information processing method such as the above-described knowledge-graph.
According to an aspect of embodiments herein, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the information processing method of the knowledge-graph.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the vectors respectively corresponding to the entities and the relations in the kth knowledge graph are subjected to dimension expansion, and the vectors respectively corresponding to the entities and the relations are adjusted in the expanded vector space, so that more accurate post-learning vector representation of the target entities and more accurate post-learning vector representation of the target relations can be obtained, and the learning accuracy of the knowledge graph is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow diagram of a method for information processing of a knowledge-graph as provided by one embodiment of the present application;
FIG. 2 is a flow chart of a method of information processing of a knowledge-graph as provided by another embodiment of the present application;
FIG. 3 is a diagram illustrating the learning effect of knowledge graph corresponding to different spaces according to an embodiment of the present application;
FIG. 4 is a block diagram of an information processing apparatus for a knowledge-graph provided in one embodiment of the present application;
FIG. 5 is a block diagram of an information processing apparatus for a knowledge-graph as provided in another embodiment of the present application;
FIG. 6 is a block diagram of a computer device provided by one embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of methods consistent with aspects of the present application, as detailed in the appended claims.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.
Machine Learning (ML) is a multi-domain cross discipline, and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. Machine learning and deep learning generally include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
With the research and progress of artificial intelligence technology, the artificial intelligence technology is developed and applied in a plurality of fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, unmanned aerial vehicles, robots, smart medical care, smart customer service, and the like.
The scheme provided by the embodiment of the application relates to artificial intelligence natural language processing and machine learning technology, for example, the newly added knowledge is embedded into the existing knowledge map.
In some embodiments, the technical scheme provided by the application can be applied to numerous application scenarios such as semantic retrieval, knowledge question answering, text information enhancement, personalized recommendation and the like. Vector representation is carried out on the entities and the relations (similar to Word2Vec), words or words in the entities and the relations are represented as vector information, and then prediction is carried out according to the vector information of the entities and the relations. Such as using the head entity and the relationship to predict the tail entity, or using the tail entity and the relationship to predict the head entity. In the embodiment of the application, after the vector representation of the target entity and the vector representation of the target relationship are obtained, a map information recording text can be generated, and the map information recording text comprises the vector representation of the target entity and the vector representation of the target relationship. In some embodiments, target text content is obtained, and the target text content is vectorized to obtain vector representation of the target text content; performing relevance calculation on the vector representation of the target text content and the vector representation of the target entity and the vector representation of the target relation contained in the map information recording text to respectively obtain relevance between the vector representation of the target text content and the vector representation of each target entity and the vector representation of each target relation contained in the map information recording text; determining vector representations of which the association with the vector representations of the target text contents is greater than or equal to a similarity threshold in the chart information recording text as vector representations of which the association exists with the vector representations of the target text contents; and determining the target entity/target relation corresponding to the vector representation with the incidence relation with the vector representation of the target text content as the entity/relation with the incidence relation with the target text content. Optionally, the relevance calculation comprises calculating distances between the vector representations, calculating cosine similarities between the vector representations, and so on. Optionally, the specific value of the similarity threshold is set by a relevant technician according to an actual situation, and this is not limited in the embodiment of the present application.
In one example, in a semantic retrieval scenario, target search content (i.e., the target text content described above) used for semantic retrieval is vectorized to obtain a vector representation of the target search content; according to the content, the text is recorded based on the map information, and entities/relations having correlation relations with the target search content can be obtained; determining an entity/relationship which has an association relationship with the target search content as an extended associated word of the semantic retrieval; and obtaining a semantic retrieval result according to the target search content and the expanded associated words, wherein the semantic retrieval result comprises at least one piece of associated content, and each piece of associated content comprises the target search content or the expanded associated words. Because the semantic retrieval result and the target search content used for retrieval have an incidence relation, a user can conveniently and quickly inquire the information to be acquired from the semantic retrieval result.
In one example, in a knowledge question and answer scenario, vectorizing target question content (i.e., the target text content described above) of a user to obtain a vector representation of the target question content; according to the content, the text is recorded based on the map information, and an entity/relationship which has an association relationship with the target question content can be obtained; determining an entity/relationship which has an association relationship with the target question content as a response keyword of the knowledge question-answer; and combining the response keywords of the knowledge question and answer into response content meeting the grammar specification to obtain the response content corresponding to the target question content. Before vectorizing the questioning content of the user, automatically correcting the original questioning content of the user by analyzing semantic information of the original questioning content of the user (such as modifying wrongly written characters, adjusting word order, determining a standardized expression mode of common terms and the like); and vectorizing the corrected questioning content. Alternatively, the knowledge question-answering method can be applied to the fields of medical inquiry, knowledge development of children and the like.
In one example, in a personalized recommendation scene, determining keywords of browsed content browsed or concerned by a user as target keywords, wherein the target keywords comprise tags of browsed content browsed or concerned by the user, keywords in a title, keywords with high occurrence frequency in a barrage or comment, and the like; vectorizing the target keywords to obtain vector representation of the target keywords; according to the content, the text is recorded based on the map information, and entities/relations having incidence relations with the target keywords can be obtained; determining the entity/relationship having the association relationship with the target keyword as the extension keyword of the recommended operation; the browsing content including the target keyword or the extended keyword in the tag/title/bullet screen/comment is used as recommended browsing content recommended to the user, so that the probability that the browsing content recommended to the user is the content in which the user is interested is improved.
The method for processing the knowledge graph information provided by the entity can be applied to other fields, and the embodiment of the application is not particularly limited in this respect.
In the method for processing the knowledge graph provided by the embodiment of the application, the execution main body of each step can be computer equipment, that is, the application provides a method for processing the knowledge graph, which is realized by the computer equipment. The computer device refers to an electronic device with data calculation, processing and storage capabilities. The computer device may be a terminal such as a PC (personal computer), a tablet, a smartphone, a wearable device, a smart robot, or the like; or may be a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing services. The technical solution of the present application will be described below by means of several embodiments.
The technical solution of the present application will be described below by means of several embodiments.
Fig. 1 shows a flowchart of an information processing method of a knowledge-graph according to an embodiment of the present application. In the present embodiment, the method is exemplified as being applied to the computer apparatus described above. As shown in FIG. 1, the method can comprise the following steps (101-105):
step 101, acquiring knowledge maps corresponding to a plurality of map learning tasks respectively.
In some embodiments, the kth atlas learning task is for learning a kth knowledge-atlas, the kth knowledge-atlas including a plurality of entities and at least one set of relationships between the plurality of entities, k being a positive integer. The knowledge graph is a semantic network for revealing the relation between entities, and is widely applied to the fields of intelligent search, intelligent question answering, personalized recommendation and the like. A knowledge graph may be stored in units of facts, which may be represented in (head entity, relationship, tail entity) form. The atlas learning task is to embed the newly added facts into the existing knowledge atlas and vectorize the knowledge atlas. The kth knowledge graph comprises newly added facts in the kth graph learning task.
In some embodiments, the kth knowledge graph is denoted as Gk={Ek,Rk,Fk},GkRepresents the kth knowledge-graph, Ek、RkAnd FkRespectively, the set of entities, relationships, and facts of the kth knowledge-graph. Fact set FkEach fact (e) ofs,r,eo) In (e)sRepresenting a head entity, eoRepresenting the tail entity, r representing the head entity esAnd tail entity eoA relationship existing between es∈Ek,eo∈Ek,r∈Rk
And 102, before the kth map learning task is executed, performing dimension expansion processing on vector representation of historical entities and vector representation of historical relations appearing in the first k-1 map learning tasks to obtain initial vector representation of the historical entities in the kth map learning task and initial vector representation of the historical relations in the kth map learning task.
In some embodiments, the first k-1 atlas learning task is an atlas learning task that has been completed prior to the kth atlas learning task. Entities appearing in the first k-1 graph learning tasks are referred to as historical entities, and relationships appearing in the first k-1 graph learning tasks are referred to as historical relationships. The initial vector representation of the historical entity in the kth map learning task and the initial vector representation of the historical relationship in the kth map learning task are vectors based on which the kth map learning task adjusts parameters in a vector corresponding to the historical entity and a vector corresponding to the historical relationship for the first time.
In some embodiments, before the kth graph learning task is executed, a vector obtained by subjecting the vector representation of the historical entity and the vector representation of the historical relationship to dimension expansion processing is determined as an initial vector representation of the historical entity in the kth graph learning task and an initial vector representation of the historical relationship in the kth graph learning task. In one example, the vector representation of historical entities and the vector representation of historical relationships that occurred in the top k-1 graph learning tasks are 50-dimensional. After dimension expansion, 100-dimensional initial vector representation of the historical entity in the kth map learning task and 100-dimensional initial vector representation of the historical relationship in the kth map learning task are obtained. In some embodiments, the vector representations of the historical entities and the vector representations of the historical relationships occurring in the first k-1 graph learning tasks are equal in dimension. In other embodiments, the dimension of the initial vector representation of the historical entity in the kth graph learning task is equal to the dimension of the initial vector representation of the historical relationship in the kth graph learning task.
And 103, determining the initial vector representation of the new entity and the initial vector representation of the new relationship in the kth knowledge graph.
In some embodiments, a random initial vector is given to the newly added entity and the newly added relationship in the kth knowledge graph, so as to obtain an initial vector representation of the newly added entity and an initial vector representation of the newly added relationship. Optionally, the elements in the initial vector of the new entity and the new relationship are obtained through a random number model. In one example, the dimension of the initial vectors of the newly added entity and the newly added relationship is determined to be 100, that is, each initial vector includes 100 elements, and for each initial vector, the elements included therein are sequentially generated by adopting a random digital model to obtain the initial vector. Optionally, elements in the vectors with lower dimensionality are determined through a random number model, and the vectors with lower dimensionality are randomly spliced to obtain an initial vector representation of a newly added entity and an initial vector representation of a newly added relationship. In one example, the dimension of the initial vector representation of the new entity and the initial vector representation of the new addition relationship is 100, a plurality of x-dimension random vectors are obtained through a random number model, x is a common divisor of 100 (such as 2, 4, 5, 10, 12, 25 and 50), and for each new entity and the new addition relationship, random vectors are randomly selected from the x-dimension random vectors and are spliced into 100-dimension vectors, so that the initial vector representation of the new entity and the initial vector representation of the new addition relationship are obtained.
In some embodiments, the dimension represented by the initial vector of the new entity in the kth knowledge graph, the dimension represented by the initial vector of the new relationship in the kth knowledge graph, the dimension represented by the initial vector of the historical entity in the kth graph learning task, and the dimension represented by the initial vector of the historical relationship in the kth graph learning task are equal. In some embodiments, the dimension represented by the initial vector of the historical entity in the kth graph learning task and the dimension represented by the initial vector of the historical relationship in the kth graph learning task are both 100, and then the dimension represented by the initial vector of the newly added entity in the kth knowledge graph and the dimension represented by the initial vector of the newly added relationship in the kth knowledge graph are 100.
And 104, in the process of executing the kth learning task, adjusting the initial vector representation of the target entity and the initial vector representation of the target relationship to obtain the learned vector representation of the target entity and the learned vector representation of the target relationship.
The target entities comprise historical entities and newly added entities, and the target relationships comprise historical relationships and newly added relationships. In some embodiments, based on the initial vector representation of the target entity and the initial vector representation of the target relationship, the parameters (i.e., elements included in the vector) of the vector representation of the target entity and the vector representation of the target relationship are continuously adjusted until the k-th learning task satisfies the condition, and the adjustment of the vector representation of the target entity and the vector representation of the target relationship is completed, so that the learned vector representation of the target entity and the learned vector representation of the target relationship can be obtained.
And 105, performing dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
In some embodiments, the learned vector representation of the target entity and the learned vector of the target relationship are higher in dimensionality, requiring matching of large storage space and processing resources for storage and processing operations. By performing the dimension reduction compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship, the storage space and the processing resources of the indication map can be saved. In some embodiments, the vector representation of the target entity and the vector representation of the target relationship are obtained by linearly transforming the learned vector representation of the target entity and the learned backward quantity representation of the target relationship, respectively.
In summary, in the technical scheme provided in the embodiment of the present application, the vectors corresponding to the entities and the relationships in the kth knowledge graph respectively are subjected to dimension expansion, and the vectors corresponding to the entities and the relationships respectively are adjusted in the expanded vector space, so that more accurate post-learning vector representation of the target entity and more accurate post-learning vector representation of the target relationship can be obtained, and accuracy of knowledge graph learning is improved.
In addition, the embodiment of the application performs dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relation, which are obtained in the expanded space, so that the problem that the dimension of the vector representation corresponding to the knowledge graph is too high is avoided, and the storage space of the vector representation corresponding to the knowledge graph is saved while the learning accuracy of the knowledge graph is improved.
FIG. 2 is a flow chart of an information processing method of a knowledge-graph according to an embodiment of the present application. In the present embodiment, the method is exemplified as being applied to the computer apparatus described above. The method comprises the following steps (201-210):
step 201, acquiring knowledge maps corresponding to a plurality of map learning tasks respectively.
For the specific content of step 201, reference may be made to step 101 in the embodiment of fig. 1, which is not described herein again.
Step 202, before the kth map learning task is executed, performing dimension expansion processing on the vector representation of the historical entity and the vector representation of the historical relationship appearing in the first k-1 map learning tasks to obtain the initial vector representation of the historical entity in the kth map learning task and the initial vector representation of the historical relationship in the kth map learning task.
For part of the content of this step 202, reference may be made to step 102 in the above embodiment of fig. 1, and details are not described here.
In some embodiments, step 202 further comprises the sub-steps of:
1. splicing the vector representation of the historical entity with a first set vector to obtain an initial vector representation of the historical entity in the kth map learning task;
2. and carrying out splicing operation on the vector representation of the history relation and a second set vector to obtain the initial vector representation of the history vector in the kth map learning task.
In the implementation manner, the vector representation of the historical entity is spliced with the first setting vector to obtain the initial vector representation of the historical entity in the kth map learning task, the vector representation of the historical relationship is spliced with the second setting vector to obtain the initial vector representation of the historical vector in the kth map learning task, and the dimensionality of the historical entity and the corresponding vector of the historical relationship in the kth map learning task is expanded. Optionally, the first setting vector and the second setting vector are both zero vectors. For example, the vector representation of the historical entity/relationship is 50-dimensional, the first setting vector/the second setting vector is a zero vector of 50-dimensional, and the zero vector of 50-dimensional is spliced to the vector representation of the historical entity/relationship of 50-dimensional, so as to obtain an initial vector representation of the historical entity/relationship of 100-dimensional in the kth graph learning task. Optionally, the first setting vector and the second setting vector are random vectors, and the method for determining the random vectors may refer to the content of determining the initial vector representation of the new entity and the initial vector representation of the new relationship in step 103 in the embodiment of fig. 1, which is not described herein again.
Step 203, determining the initial vector representation of the new entity and the initial vector representation of the new relationship in the kth knowledge graph.
The specific content of step 203 may refer to step 103 in the embodiment of fig. 1, which is not described herein again.
And 204, acquiring a fact set corresponding to the kth knowledge graph and a fact set corresponding to the first k-1 knowledge graphs.
Wherein the fact set includes at least one positive fact and at least one negative fact. Positive facts refer to triples of two entities that have a relationship, and negative facts refer to triples of two entities that do not have a relationship. In some embodiments, a negative fact is a fact that results from replacing the head/tail entity in a positive fact. In some embodiments, the fact set of the kth knowledge-graph includes all possible combinations of entities and relationships included in the kth knowledge-graph. The fact set corresponding to the kth knowledge-graph can be expressed as:
Figure BDA0002654219020000101
wherein the content of the first and second substances,
Figure BDA0002654219020000102
representing a set of facts corresponding to the kth knowledge-graph, EkRepresenting kth knowledge-graph correspondencesSet of entities of RkAnd expressing a corresponding relation set of the kth knowledge graph.
In other embodiments, the fact set of the top k-1 knowledge-graphs includes all possible combinations of entities and relationships included in the top k-1 knowledge-graphs. The fact set corresponding to the first k-1 knowledge-graphs can be expressed as:
Figure BDA0002654219020000111
wherein the content of the first and second substances,
Figure BDA0002654219020000112
representing the corresponding fact sets of the first k-1 knowledge-graphs, E1,k-1Representing the entity sets corresponding to the first k-1 knowledge graphs, R1,k-1And representing the corresponding relation set of the first k-1 knowledge graphs. In one example, if the top k-1 knowledge graphs include entity 1, entity 2, entity 3, entity 4, relationship 1, and relationship 2, then the fact set corresponding to the top k-1 knowledge graphs includes the following 12 facts: fact 1 ═ entity 1, (relation 1, entity 2), fact 2 ═ entity 1, relation 1, entity 3, ((entity 1, relation 1, entity 4), fact 4 ═ entity 2, relation 1, entity 3), fact 5 ═ entity 2, relation 1, entity 4, fact 6 ═ entity 3, relation 1, entity 4, fact 7 ═ entity 1, relation 2, entity 2, fact 8 ═ entity 1, relation 2, entity 3, fact 9 ═ entity 1, relation 2, entity 4, fact 10 ═ entity 2, relation 2, entity 3, fact 11 ═ entity 2, relation 2, entity 4, fact 12 ═ entity 3, relation 2, entity 4.
Step 205, training the embedded model by using the fact set corresponding to the kth knowledge graph, and determining a first loss value corresponding to the embedded model.
Wherein, the initial value of the first loss value is determined based on the initial vector representation of the newly added entity and the newly added relation. In some embodiments, the embedded model is trained for multiple times, and for each training, a score function is used to score the vector representation obtained in the training for the newly added entity and the newly added relationship to obtain a value of the score function corresponding to the training, and the score function is obtained based on the value corresponding to the trainingThe values of the score function calculate corresponding first loss values. The value of the scoring function may be expressed as
Figure BDA0002654219020000113
Wherein the content of the first and second substances,
Figure BDA0002654219020000114
the vector corresponding to the head entity subjected to dimension expansion, the vector corresponding to the relation subjected to dimension expansion and the vector corresponding to the tail entity subjected to dimension expansion are respectively obtained. The higher the value of the score function, the greater the probability that the corresponding fact is a positive fact. In some embodiments, the values of the scoring function are mapped to [0, 1 ] by a sigmoid function (sigmoid function)]Probability value p (e) within intervals,r,eo)=σ(s(es,r,eo) Based on the probability value p (e)s,r,eo) The corresponding first loss value is calculated.
In some embodiments, the first loss value may be calculated with reference to the following equation one:
the formula I is as follows:
Figure BDA0002654219020000115
wherein the content of the first and second substances,
Figure BDA0002654219020000116
denotes a first loss value, TnewIs the set of facts corresponding to the kth knowledge-graph,
Figure BDA0002654219020000121
and the probability value of the fact in the fact set corresponding to the k-th knowledge graph is represented as the positive fact.
And step 206, training the embedded model by adopting the fact sets corresponding to the first k-1 knowledge graphs, and determining a second loss value corresponding to the embedded model.
Wherein the initial value of the second loss value is determined based on the historical entity and the initial vector representation of the historical relationship. In some embodiments, the embedded model needs to be trained for multiple times, and for each training, a score function is used to score the vector representation obtained in the training of the historical entity and the historical relationship, so as to obtain a score function value corresponding to the training, and then a corresponding second loss value is calculated based on the score function value corresponding to the training.
In some embodiments, step 206 further comprises the sub-steps of:
1. sampling from fact sets corresponding to the first k-1 knowledge graphs to obtain at least one fact, and obtaining a historical fact set;
2. and training the embedded model by adopting the historical fact set, and determining a second loss value corresponding to the embedded model.
In the implementation mode, as the fact sets corresponding to the first k-1 knowledge graphs contain more historical entities and historical relations, part of facts are selected from the fact sets corresponding to the first k-1 knowledge graphs through sampling to obtain the historical fact sets, the historical fact sets are adopted to train the embedded model, and the corresponding second loss values are calculated based on the historical entities and the vectors corresponding to the historical relations in the historical fact sets. In some embodiments, the second loss value may be calculated with reference to the following equation two:
the formula II is as follows:
Figure BDA0002654219020000122
wherein the content of the first and second substances,
Figure BDA0002654219020000123
represents a second loss value, ToldRepresenting facts included in a set of historical facts,
Figure BDA0002654219020000124
representing probability values representing facts in the fact set corresponding to the kth knowledge graph as positive facts,
Figure BDA0002654219020000125
representing probability values for facts included in the historical fact set that are positive facts. MeterThe loss function used to calculate the second loss value is a KL divergence function that can be driven into optimization
Figure BDA0002654219020000126
When new knowledge is learned, the probability distribution of old knowledge is still maintained to a great extent, so that the new knowledge is learned and the old knowledge is maintained.
The step 205 and the step 206 may be executed simultaneously, or the step 206 may be executed first and then the step 205 is executed, or the step 205 may be executed first and then the step 206 is executed, which is not specifically limited in this embodiment of the present application.
Step 207, determining a first integrated loss value according to the first loss value and the second loss value.
And obtaining a corresponding first comprehensive loss value according to the first loss value and the second loss value obtained in the step. In some embodiments, the calculation of the first composite loss value may refer to the following equation three:
the formula III is as follows:
Figure BDA0002654219020000131
wherein the content of the first and second substances,
Figure BDA0002654219020000132
which represents the first value of the integrated loss,
Figure BDA0002654219020000133
which represents the value of the first loss to be,
Figure BDA0002654219020000134
represents a second loss value, α1To adjust the factor, α1Is constant α1May be 0.2, 0.5, 0.8, 1.0, 1.5, 2, etc., α1The specific numerical value of (a) may be set by a person skilled in the relevant art according to practical situations, and the embodiment of the present application is not particularly limited thereto.
And 208, adjusting parameters of the embedded model based on the first comprehensive loss value to obtain the trained embedded model.
In some embodiments, for each training of the embedded model, adjusting a parameter of the embedded model based on a first composite loss value obtained from the training; and obtaining a first comprehensive loss value obtained by next training based on the embedded model after the parameters are adjusted, adjusting the parameters of the embedded model again according to the first comprehensive loss value obtained by the next training, and circularly training the embedded model according to the first comprehensive loss value to enable the first comprehensive loss value to show a descending trend until the first comprehensive loss value meets the condition to obtain the embedded model after the training.
In some embodiments, the condition satisfied by the first composite loss value includes: the first combined loss value is less than or equal to a first combined loss threshold; or the first comprehensive loss value is less than or equal to the first comprehensive loss threshold value a times continuously, wherein a is a positive integer; or the first comprehensive loss value is not reduced for b times continuously; or in c consecutive training times, the absolute value of the difference between the first comprehensive loss value obtained by each training and the first comprehensive loss value obtained by the last training time is smaller than the drop threshold. The values of a, b, and c are positive integers, and the specific values of a, b, and c, the first total loss threshold, and the drop threshold are set by a relevant technician according to an actual situation, which is not specifically limited in the embodiment of the present application.
Step 209 determines the learned vector representation of the target entity and the learned vector representation of the target relationship through the trained embedded model.
In some embodiments, after the training of the embedded model is completed, the learned vector representation of the target entity and the learned vector representation of the target relationship are obtained from the parameters of the embedded model after the training is completed.
Step 210, multiplying the learned vector representation of the target entity by the first linear transformation matrix to obtain a vector representation of the target entity; and multiplying the learned vector representation of the target relationship with the second linear transformation matrix to obtain the vector representation of the target relationship.
In some embodiments, after obtaining the learned vector of the target entity and the learned vector of the target relationship, multiplying the learned vector representation of the target entity by the first linear transformation matrix to obtain a vector of the learned vector of the target entity after dimension compression, and multiplying the learned vector representation of the target relationship by the second linear transformation matrix to obtain a vector of the learned vector of the target entity after dimension compression. Calculating a corresponding first comprehensive loss value based on a vector correspondingly obtained by compressing the target entity in the secondary dimension and a vector correspondingly obtained by compressing the target relation in the secondary dimension; and adjusting parameters of the first linear transformation matrix and the second linear transformation matrix based on the corresponding first comprehensive loss value, and circulating according to the parameters until the first comprehensive loss value meets the condition. For the calculation of the first combined loss value, reference may be made to the above description, which is not described herein again.
In some embodiments, the vector representation of the target entity and the target relationship is computed by linear transformation in a hyperbolic space, which is a space with a gaussian curvature that is constant negative everywhere, and whose curvature is negative. Replacing the first linear transformation matrix Mx with MB(x) It is defined by the following formula four:
the formula four is as follows:
Figure BDA0002654219020000141
wherein exp0(. o) and log0(. cndot.) is defined as equation five and equation six, respectively:
the formula five is as follows:
Figure BDA0002654219020000142
formula six:
Figure BDA0002654219020000143
wherein
Figure BDA0002654219020000144
Is an addition to Moibius.
The second linear transformation matrix is similar to the first linear transformation matrix, and will not be described herein.
In summary, in the technical scheme provided by the embodiment of the application, new knowledge can be learned by using the historical entity and the k-time atlas learning task with participation of the historical relationship, and old knowledge can be maintained, so that the overall accuracy of the knowledge atlas is maintained while the knowledge atlas is expanded, catastrophic forgetting in the learning process of the knowledge atlas is avoided, and the learning accuracy of the knowledge atlas is improved.
In some embodiments, the present application further comprises the following steps:
1. determining a first distance value between the newly added entities based on the temporary vector representation of the newly added entities;
2. determining a second distance value between the historical entities based on the temporary vector representation of the historical entities;
3. calculating a first distance loss value according to the first distance value and the second distance value;
4. and adjusting parameters of the embedded model based on the first comprehensive loss value and the first distance loss value to obtain the trained embedded model.
In the implementation manner, based on the temporary vector representation of the newly added entities and the fact vector representation of the historical entities, a first distance value between the newly added entities and a second distance value between the historical entities are respectively calculated, a first distance loss value is calculated according to the first distance value and the second distance value, and the distances between the newly added entities and between the historical entities are kept unchanged as much as possible in the process of parameter adjustment and dimension compression of the vector through the first distance loss value. Wherein, the first distance value refers to the relative distance between the newly added entities, and the second distance value refers to the relative distance between the historical entities.
In some embodiments, the corresponding first distance loss value after the dimension expansion may be calculated by referring to the following formula seven:
the formula seven:
Figure BDA0002654219020000151
wherein the content of the first and second substances,
Figure BDA0002654219020000152
representing the corresponding first distance loss value after the dimension expansion,
Figure BDA0002654219020000153
a value representing the second distance is indicated,
Figure BDA0002654219020000154
representing a first distance value.
In some embodiments, the corresponding first distance loss value after dimension compression may be calculated with reference to the following equation eight:
the formula eight:
Figure BDA0002654219020000155
wherein the content of the first and second substances,
Figure BDA0002654219020000156
representing the corresponding first distance loss value after the dimension compression,
Figure BDA0002654219020000157
representing the distance values between the entity vectors before compression,
Figure BDA0002654219020000158
representing the distance values between the entity vectors after compression.
Below, in order to
Figure BDA0002654219020000159
For example, a manner of calculating a distance value between vectors corresponding to entities will be described.
Figure BDA00026542190200001510
The calculation formula of (c) can refer to the following formula nine:
the formula is nine:
Figure BDA0002654219020000161
Figure BDA0002654219020000162
Figure BDA0002654219020000163
and
Figure BDA0002654219020000164
the calculation formula is similar to the above, and is not described herein again.
In some embodiments, the first distance value and the second distance value are calculated in a hyperbolic space. The structure of the form of | | | x-y | | | referred to in the above formula is replaced by dB(x, y), which is defined by the following equation ten:
formula ten:
Figure BDA0002654219020000165
in the implementation mode, in the process of adjusting the vectors corresponding to the entities, the relative distance between the vectors corresponding to the entities is kept as far as possible, so that the relationship between the entities is kept as far as possible, and the accuracy of knowledge graph learning is improved.
The first table shows the statistical results of experimental data among various knowledge graph learning methods:
watch 1
Figure BDA0002654219020000166
Figure BDA0002654219020000171
As shown in table one, compared with other models, the knowledge graph learning method provided by the application has a higher hit rate; according to the information processing method of the knowledge graph, the hit rate is higher when the knowledge graph learning is carried out in the hyperbolic space than in the European space. As shown in fig. 3, when the knowledge graph is learned in the hyperbolic space, the corresponding ten-hit rate is obviously higher than that in the european space. Therefore, the study of the conventional knowledge map in the hyperbolic space is obviously superior to the study of the knowledge map in the European space.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 4, a block diagram of an information processing apparatus of a knowledge-graph according to an embodiment of the present application is shown. The apparatus has a function of implementing an example of the above-described information processing method of the knowledge graph, and the function may be implemented by hardware or by hardware executing corresponding software. The device may be the computer device described above, or may be provided on a computer device. The apparatus 400 may include: a map acquisition module 410, a dimension expansion module 420, a vector determination module 430, a vector adjustment module 440, and a dimension compression module 450.
The map acquisition module 410 is configured to acquire knowledge maps corresponding to a plurality of map learning tasks, respectively; the kth knowledge graph learning task is used for learning a kth knowledge graph, the kth knowledge graph comprises a plurality of entities and at least one group of relations among the entities, and k is a positive integer.
The dimension expansion module 420 is configured to perform dimension expansion processing on the vector representation of the historical entity and the vector representation of the historical relationship occurring in the first k-1 graph learning tasks before the kth graph learning task is executed, so as to obtain an initial vector representation of the historical entity in the kth graph learning task and an initial vector representation of the historical relationship in the kth graph learning task.
The vector determining module 430 is configured to determine an initial vector representation of a new entity and an initial vector representation of a new relationship in the kth knowledge graph.
The vector adjusting module 440 is configured to adjust an initial vector representation of a target entity and an initial vector representation of a target relationship in a process of executing the kth learning task, so as to obtain a learned vector representation of the target entity and a learned vector representation of the target relationship; the target entity comprises the historical entity and the newly added entity, and the target relationship comprises the historical relationship and the newly added relationship.
The dimension compression module 450 is configured to perform dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
In summary, in the technical scheme provided in the embodiment of the present application, the vectors corresponding to the entities and the relationships in the kth knowledge graph respectively are subjected to dimension expansion, and the vectors corresponding to the entities and the relationships respectively are adjusted in the expanded vector space, so that more accurate post-learning vector representation of the target entity and more accurate post-learning vector representation of the target relationship can be obtained, and accuracy of knowledge graph learning is improved.
In some embodiments, the dimension expansion module 420 is to:
splicing the vector representation of the historical entity with a first set vector to obtain an initial vector representation of the historical entity in the kth map learning task;
and carrying out splicing operation on the vector representation of the history relation and a second set vector to obtain an initial vector representation of the history vector in the kth atlas learning task.
In some embodiments, the first setting vector and the second setting vector are both zero vectors.
In some embodiments, the dimension compression module 450 is configured to:
multiplying the learned vector representation of the target entity by a first linear transformation matrix to obtain a vector representation of the target entity;
and multiplying the learned vector representation of the target relationship with a second linear transformation matrix to obtain the vector representation of the target relationship.
In some embodiments, the vector representation of the target entity and the target relationship is computed in a hyperbolic space using a linear transformation.
In some embodiments, the vector adjustment module 440 includes: fact acquisition sub-module 441, loss determination sub-module 442, parameter adjustment sub-module 443, and vector determination sub-module 444.
The fact obtaining submodule 441 is configured to obtain a fact set corresponding to the kth knowledge graph and a fact set corresponding to the first k-1 knowledge graphs; wherein the set of facts includes at least one positive fact and at least one negative fact.
The loss determining sub-module 442 is configured to train an embedded model by using the fact set corresponding to the kth knowledge graph, and determine a first loss value corresponding to the embedded model; wherein the initial value of the first loss value is determined based on the initial vector representation of the new entity and the new relationship.
The loss determining sub-module 442 is further configured to train the embedded model by using the fact sets corresponding to the first k-1 knowledge maps, and determine a second loss value corresponding to the embedded model; wherein an initial value of the second loss value is determined based on the historical entity and the initial vector representation of the historical relationship.
The loss determining sub-module 442 is further configured to determine a first combined loss value according to the first loss value and the second loss value.
The parameter adjusting submodule 443 is configured to adjust a parameter of the embedded model based on the first combined loss value, so as to obtain the trained embedded model.
The vector determination submodule 444 is configured to determine a learned vector representation of the target entity and a learned vector representation of the target relationship through the trained embedded model.
In some embodiments, as shown in fig. 5, the apparatus 400 further comprises: a distance determination module 460 and a loss determination module 470.
The distance determining module 460 is configured to determine a first distance value between the added entities based on the temporary vector representation of the added entities.
The distance determining module 460 is further configured to determine a second distance value between the historical entities based on the temporary vector representation of the historical entities.
The loss determining module 470 is configured to calculate a first distance loss value according to the first distance value and the second distance value.
The parameter adjustment sub-module 443, configured to: and adjusting parameters of the embedded model based on the first comprehensive loss value and the first distance loss value to obtain the trained embedded model.
In some embodiments, the first distance value and the second distance value are calculated in a hyperbolic space.
In some embodiments, the loss determination sub-module 442 is configured to:
sampling from fact sets corresponding to the first k-1 knowledge graphs to obtain at least one fact, and obtaining a historical fact set;
and training the embedded model by adopting the historical fact set, and determining a second loss value corresponding to the embedded model.
It should be noted that, when the apparatus provided in the foregoing embodiment implements the functions thereof, only the division of the functional modules is illustrated, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the internal structure of the apparatus may be divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
Referring to fig. 6, a block diagram of a computer device according to an embodiment of the present application is shown. The computer device is used for implementing the information processing method of the knowledge graph provided in the above embodiment. Specifically, the method comprises the following steps:
the computer apparatus 600 includes a CPU (Central Processing Unit) 601, a system Memory 604 including a RAM (Random Access Memory) 602 and a ROM (Read-Only Memory) 603, and a system bus 605 connecting the system Memory 604 and the Central Processing Unit 601. The computer device 600 also includes a basic I/O (Input/Output) system 606 to facilitate information transfer between various elements within the computer, and a mass storage device 607 for storing an operating system 613, application programs 614, and other program modules 615.
The basic input/output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse, keyboard, etc. for a user to input information. Wherein the display 608 and the input device 609 are connected to the central processing unit 601 through an input output controller 610 connected to the system bus 605. The basic input/output system 606 may also include an input/output controller 610 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input/output controller 610 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605. The mass storage device 607 and its associated computer-readable media provide non-volatile storage for the computer device 600. That is, the mass storage device 607 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact disk Read-Only Memory) drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash Memory or other solid state Memory technology, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 604 and mass storage device 607 described above may be collectively referred to as memory.
According to various embodiments of the present application, the computer device 600 may also operate as a remote computer connected to a network via a network, such as the Internet. That is, the computer device 600 may be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 611.
In some embodiments, there is also provided a computer-readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which when executed by a processor, implements the above-described method of information processing of a knowledge-graph.
Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State drive), or optical disk. The Random Access Memory may include a ReRAM (resistive Random Access Memory) and a DRAM (Dynamic Random Access Memory).
In some embodiments, there is also provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and executes the computer instructions to cause the computer device to execute the information processing method of the knowledge-graph.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, the step numbers described herein only exemplarily show one possible execution sequence among the steps, and in some other embodiments, the steps may also be executed out of the numbering sequence, for example, two steps with different numbers are executed simultaneously, or two steps with different numbers are executed in a reverse order to the order shown in the figure, which is not limited by the embodiment of the present application.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like that are made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. An information processing method of a knowledge graph, the method comprising:
acquiring knowledge maps corresponding to a plurality of map learning tasks respectively; the kth knowledge graph learning task is used for learning a kth knowledge graph, the kth knowledge graph comprises a plurality of entities and at least one group of relations among the entities, and k is a positive integer;
before the kth map learning task is executed, performing dimension expansion processing on vector representations of historical entities and vector representations of historical relations appearing in the first k-1 map learning tasks to obtain initial vector representations of the historical entities in the kth map learning task and initial vector representations of the historical relations in the kth map learning task;
determining initial vector representation of a newly added entity and initial vector representation of a newly added relation in the kth knowledge graph;
in the process of executing the kth learning task, adjusting the initial vector representation of a target entity and the initial vector representation of a target relationship to obtain the learned vector representation of the target entity and the learned vector representation of the target relationship; the target entity comprises the historical entity and the newly added entity, and the target relationship comprises the historical relationship and the newly added relationship;
and performing dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
2. The method according to claim 1, wherein the performing a dimension expansion process on the vector representation of the historical entity and the vector representation of the historical relationship occurring in the first k-1 graph learning tasks to obtain an initial vector representation of the historical entity in the kth graph learning task and an initial vector representation of the historical relationship in the kth graph learning task comprises:
splicing the vector representation of the historical entity with a first set vector to obtain an initial vector representation of the historical entity in the kth map learning task;
and carrying out splicing operation on the vector representation of the history relation and a second set vector to obtain an initial vector representation of the history vector in the kth atlas learning task.
3. The method of claim 2, wherein the first setting vector and the second setting vector are both zero vectors.
4. The method of claim 1, wherein performing a dimension compression process on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship comprises:
multiplying the learned vector representation of the target entity by a first linear transformation matrix to obtain a vector representation of the target entity;
and multiplying the learned vector representation of the target relationship with a second linear transformation matrix to obtain the vector representation of the target relationship.
5. The method of claim 4, wherein the vector representation of the target entity and the target relationship is computed using a linear transformation in hyperbolic space.
6. The method according to any one of claims 1 to 5, wherein the adjusting the initial vector representation of the target entity and the initial vector representation of the target relationship during the execution of the kth learning task to obtain the learned vector representation of the target entity and the learned vector representation of the target relationship comprises:
acquiring a fact set corresponding to the kth knowledge graph and a fact set corresponding to the first k-1 knowledge graphs; wherein the set of facts includes at least one positive fact and at least one negative fact;
training an embedded model by adopting a fact set corresponding to the kth knowledge graph, and determining a first loss value corresponding to the embedded model; wherein the initial value of the first loss value is determined based on the initial vector representation of the new entity and the new relationship;
training the embedded model by adopting the fact sets corresponding to the first k-1 knowledge graphs, and determining a second loss value corresponding to the embedded model; wherein an initial value of the second loss value is determined based on the historical entity and the initial vector representation of the historical relationship;
determining a first comprehensive loss value according to the first loss value and the second loss value;
adjusting parameters of the embedded model based on the first comprehensive loss value to obtain a trained embedded model;
determining a learned vector representation of the target entity and a learned vector representation of the target relationship through the trained embedded model.
7. The method of claim 6, further comprising:
determining a first distance value between the newly added entities based on the provisional vector representation of the newly added entities;
determining second distance values between the historical entities based on the temporary vector representations of the historical entities;
calculating a first distance loss value according to the first distance value and the second distance value;
adjusting parameters of the embedded model based on the first comprehensive loss value to obtain the trained embedded model, including:
and adjusting parameters of the embedded model based on the first comprehensive loss value and the first distance loss value to obtain the trained embedded model.
8. The method of claim 7, wherein the first distance value and the second distance value are calculated in a hyperbolic space.
9. The method of claim 6, wherein the training the embedded model with the fact sets corresponding to the first k-1 knowledge-graphs to determine the second loss value corresponding to the embedded model comprises:
sampling from fact sets corresponding to the first k-1 knowledge graphs to obtain at least one fact, and obtaining a historical fact set;
and training the embedded model by adopting the historical fact set, and determining a second loss value corresponding to the embedded model.
10. An apparatus for processing knowledge-graph information, the apparatus comprising:
the map acquisition module is used for acquiring knowledge maps corresponding to the plurality of map learning tasks respectively; the kth knowledge graph learning task is used for learning a kth knowledge graph, the kth knowledge graph comprises a plurality of entities and at least one group of relations among the entities, and k is a positive integer;
the dimension expansion module is used for performing dimension expansion processing on vector representations of historical entities and vector representations of historical relations appearing in the first k-1 map learning tasks before the kth map learning task is executed to obtain initial vector representations of the historical entities in the kth map learning task and initial vector representations of the historical relations in the kth map learning task;
the vector determining module is used for determining the initial vector representation of the new entity and the initial vector representation of the new relationship in the kth knowledge graph;
a vector adjusting module, configured to adjust an initial vector representation of a target entity and an initial vector representation of a target relationship in a process of executing the kth learning task, to obtain a learned vector representation of the target entity and a learned vector representation of the target relationship; the target entity comprises the historical entity and the newly added entity, and the target relationship comprises the historical relationship and the newly added relationship;
and the dimension compression module is used for carrying out dimension compression processing on the learned vector representation of the target entity and the learned vector representation of the target relationship to obtain the vector representation of the target entity and the vector representation of the target relationship.
11. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the method of information processing of a knowledge-graph as claimed in any one of claims 1 to 9.
12. A computer-readable storage medium, having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the method of information processing of a knowledge-graph as claimed in any one of claims 1 to 9.
CN202010881365.5A 2020-08-27 2020-08-27 Knowledge graph information processing method, device, equipment and storage medium Pending CN111782826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010881365.5A CN111782826A (en) 2020-08-27 2020-08-27 Knowledge graph information processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010881365.5A CN111782826A (en) 2020-08-27 2020-08-27 Knowledge graph information processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111782826A true CN111782826A (en) 2020-10-16

Family

ID=72761818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010881365.5A Pending CN111782826A (en) 2020-08-27 2020-08-27 Knowledge graph information processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111782826A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287126A (en) * 2020-12-24 2021-01-29 中国人民解放军国防科技大学 Entity alignment method and device suitable for multi-mode knowledge graph
CN112328645A (en) * 2020-11-26 2021-02-05 上海松鼠课堂人工智能科技有限公司 Method and system for determining interests and hobbies of users based on knowledge graph
CN112925723A (en) * 2021-04-02 2021-06-08 上海复深蓝软件股份有限公司 Test service recommendation method and device, computer equipment and storage medium
CN113241147A (en) * 2021-04-28 2021-08-10 厦门艾地运动科技有限公司 Fitness plan generation method and device and electronic equipment
CN113656589A (en) * 2021-04-19 2021-11-16 腾讯科技(深圳)有限公司 Object attribute determination method and device, computer equipment and storage medium
CN114154569A (en) * 2021-11-25 2022-03-08 上海帜讯信息技术股份有限公司 Noise data identification method, device, terminal and storage medium
CN114880473A (en) * 2022-04-29 2022-08-09 支付宝(杭州)信息技术有限公司 Label classification method and device, storage medium and electronic equipment

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328645A (en) * 2020-11-26 2021-02-05 上海松鼠课堂人工智能科技有限公司 Method and system for determining interests and hobbies of users based on knowledge graph
CN112287126A (en) * 2020-12-24 2021-01-29 中国人民解放军国防科技大学 Entity alignment method and device suitable for multi-mode knowledge graph
CN112925723A (en) * 2021-04-02 2021-06-08 上海复深蓝软件股份有限公司 Test service recommendation method and device, computer equipment and storage medium
CN113656589A (en) * 2021-04-19 2021-11-16 腾讯科技(深圳)有限公司 Object attribute determination method and device, computer equipment and storage medium
CN113656589B (en) * 2021-04-19 2023-07-04 腾讯科技(深圳)有限公司 Object attribute determining method, device, computer equipment and storage medium
CN113241147A (en) * 2021-04-28 2021-08-10 厦门艾地运动科技有限公司 Fitness plan generation method and device and electronic equipment
CN113241147B (en) * 2021-04-28 2023-03-28 厦门艾地运动科技有限公司 Fitness plan generation method and device and electronic equipment
CN114154569A (en) * 2021-11-25 2022-03-08 上海帜讯信息技术股份有限公司 Noise data identification method, device, terminal and storage medium
CN114154569B (en) * 2021-11-25 2024-02-02 上海帜讯信息技术股份有限公司 Noise data identification method, device, terminal and storage medium
CN114880473A (en) * 2022-04-29 2022-08-09 支付宝(杭州)信息技术有限公司 Label classification method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN111782826A (en) Knowledge graph information processing method, device, equipment and storage medium
CN111538908B (en) Search ranking method and device, computer equipment and storage medium
CN109863487B (en) Non-fact question-answering system and method and storage medium
CN114565104A (en) Language model pre-training method, result recommendation method and related device
CN111738001B (en) Training method of synonym recognition model, synonym determination method and equipment
CN111708873A (en) Intelligent question answering method and device, computer equipment and storage medium
CN111898374B (en) Text recognition method, device, storage medium and electronic equipment
CN113761868B (en) Text processing method, text processing device, electronic equipment and readable storage medium
CN113761153A (en) Question and answer processing method and device based on picture, readable medium and electronic equipment
CN114329029B (en) Object retrieval method, device, equipment and computer storage medium
CN111581545A (en) Method for sorting recalled documents and related equipment
US20210174161A1 (en) Method and apparatus for multi-document question answering
CN113761220A (en) Information acquisition method, device, equipment and storage medium
CN113821527A (en) Hash code generation method and device, computer equipment and storage medium
CN117473053A (en) Natural language question-answering method, device, medium and equipment based on large language model
CN110929532B (en) Data processing method, device, equipment and storage medium
CN112131261A (en) Community query method and device based on community network and computer equipment
CN112069329A (en) Text corpus processing method, device, equipment and storage medium
CN116502181A (en) Channel expansion and fusion-based cyclic capsule network multi-modal emotion recognition method
CN114416929A (en) Sample generation method, device, equipment and storage medium of entity recall model
CN110941962B (en) Answer sentence selection method and device based on graph network
CN113569018A (en) Question and answer pair mining method and device
CN111611796A (en) Hypernym determination method and device for hyponym, electronic device and storage medium
CN115344698A (en) Label processing method, label processing device, computer equipment, storage medium and program product
CN111783473B (en) Method and device for identifying best answer in medical question and answer and computer equipment

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