BACKGROUND OF THE DISCLOSURE

1. Field of the Disclosure

The present disclosure relates to the field of natural language processing and knowledge graphs, and more particularly relates to a method and device for processing a knowledge graph as well as a non-transitory computer-readable medium.

2. Description of the Related Art

With the rapid development of modern society, people's lives have entered the era of information explosion. A large number of new entities and pieces of information appear every day. Nowadays, the Internet is the most convenient platform for acquiring information, and the demand of screening and induction of valid information is becoming more and more urgent. How to obtain valuable information from a huge amount of data has become a difficult problem. Knowledge graphs emerge as the times require.

In general, a knowledge graph represents proper names such as people's names, place names, book titles, team names and the like and things as entities, and the internal links between the entities as relations, so as to express a great amount of knowledge in a database as triples. Each of the triples may be denoted as (h, r, t) in which h is a head entity, r is a relation, and t is a tail entity. For example, regarding a piece of knowledge that Beijing is the capital of the People's Republic of China (PRC), it may be described as a triple, i.e., (Beijing, Capital-Of, PRC) in a knowledge graph.

Here it should be noted that for more information about the knowledge graph, it is also possible to see en.wikipedia.org/wiki/Knowledge_Graph, for instance.

As the study on the knowledge graph goes on, the knowledge graph may well assist in natural language processing and semantic analysis. However, with the accumulation of knowledge and the increase of the amount of data of the knowledge graph, the structure of the knowledge graph is becoming more and more complicated. On the other hand, remarkable progress has been made in the research about the knowledge graph in recent years. By mapping the entities and their relations in the knowledge graph into low-dimensional continuous vector spaces, it is possible to solve the problem of sparsity and low efficiency generated when carrying out the representation learning of knowledge graphs before.

However, recently there has been a problem in the vector representations of the entities and their relations in the knowledge graph, namely, conventional algorithms attain the vector representations of the entities and their relations from the known topological structure of the knowledge graph without utilizing other information of the entities so that the results acquired are not accurate and comprehensive.

SUMMARY OF THE DISCLOSURE

In light of the above, the present disclosure provides a method and device for processing a knowledge graph by which it is possible to give more accurate and comprehensive vector representations of the entities and relations in the knowledge graph.

According to a first aspect of the present disclosure, a knowledge graph processing method is provided which includes steps of obtaining an entity set from a knowledge graph waiting for processing, the entity set containing a first entity, a second entity, and relation information between the first entity and the second entity; acquiring text information and image information related to the first entity and the second entity from a database; generating a first structural information vector of the first entity and a second structural information vector of the second entity based on structural information of the knowledge graph, and creating a first text information vector of the first entity, a first image information vector of the first entity, a second text information vector of the second entity, and a second image information vector of the second entity based on the text information and the image information acquired; and building a joint loss function based on the first structural information vector, the first text information vector, the first image information vector, the second structural information vector, the second text information vector, and the second image information vector, and carrying out optimization with respect to the joint loss function so as to attain a first target vector of the first entity, a second target vector of the second entity, and a target relation vector of the relation information between the first entity and the second entity when the joint loss function is optimized.

According to a second aspect of the present disclosure, a knowledge graph processing device is provided which includes an entity set obtainment part configured to obtain an entity set from a knowledge graph waiting for processing, the entity set containing a first entity, a second entity, and relation information between the first entity and the second entity; an information acquirement part configured to acquire text information and image information related to the first entity and the second entity from a database; a vector generation part configured to generate a first structural information vector of the first entity and a second structural information vector of the second entity based on structural information of the knowledge graph, and create a first text information vector of the first entity, a first image information vector of the first entity, a second text information vector of the second entity, and a second image information vector of the second entity based on the text information and the image information acquired; and a processing part configured to build a joint loss function based on the first structural information vector, the first text information vector, the first image information vector, the second structural information vector, the second text information vector, and the second image information vector, and carry out optimization with respect to the joint loss function so as to attain a first target vector of the first entity, a second target vector of the second entity, and a target relation vector of the relation information between the first entity and the second entity when the joint loss function is optimized.

According to a third aspect of the present disclosure, a non-transitory computer-readable medium is provided which has computer-executable instructions for execution by a processing system, in which, the computer-executable instructions, when executed, cause the processing system to carry out the knowledge graph processing method described above.

Therefore, it is obvious that the vector representations of the entities and their relations in a knowledge graph may be calculated not only from the known topological structure of the knowledge graph. It is also possible to acquire the text information and the image information related to the entities from a database, and generate text information vectors and image information vectors on the basis of the text information and the image information pertaining to the entities, so as to create final vector representations of the entities and their relations on the grounds of the structural information vectors obtained by using the known structural information of the knowledge graph as well as the text information vectors and the image information vectors relating to the entities. In this way, by utilizing much more information concerning the entities in the knowledge graph to produce the vector representations of the entities and their relations, it is possible to provide more accurate and comprehensive vector representations of the entities and their relations.

