An embodiment of the present application discloses a method, an apparatus, an electronic device, a storage medium, and a program for learning knowledge representation, and relates to natural language processing, in-depth learning, and knowledge graph technologies. One embodiment of the method includes the steps of: sampling a knowledge graph subgraph from a knowledge base; ranking the knowledge graph subgraph to acquire a ranked text; and learning and obtaining the knowledge representation of each character of the ranked text by reading out the ranked text according to the rank of the knowledge graph subgraph using a previously-trained language model. In the method of the present embodiment, the knowledge representation learning relates to learning of relationship representation with an entity of the knowledge basis, in which a semantic association with the relationship with the entity in a low-dimensional space is efficiently calculated, a data scarcity problem is solved, and the performance of obtaining, fusing, and inferring the knowledge is remarkably improved. The strong knowledge acquisition capability of the previously-trained language model and the capability of analyzing a context are used, such that the knowledge representation trained based on the previously-trained language model may more excellently represent the complex relationship in the knowledge base.
METHOD AND APPARATUS FOR LEARNING KNOWLEDGE REPRESENTATION DEVICE STORAGE MEDIUM AND PROGRAM