Patent ID: 11861311
Assignee: BEIJING WODONG TIANJUN INFORMATION TECHNOLOGY CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 15:
16. A non-transitory computer readable medium storing computer executable code, wherein the computer executable code, when executed at a processor of a computing device, is configured to:
provide a first number of entities, a second number of relations, and a plurality of documents, each of the plurality of documents comprising at least one sentence;
convert each of the at least one sentence into a third number of sentence embeddings;
form primary capsules for a capsule neural network, wherein each of the primary capsules is one of the third number of sentence embeddings;
use a set transformer to learn the entities and the relations contained in the provided documents from the primary capsules, so as to obtain entity capsules and relation capsules, an i-th entity and a j-th entity from the entity capsules and an m-th relation from the relation capsules form a head entity-tail entity-relation triple;
project the i-th entity in an entity space into a m-th relation space to form an i-th projection, project the j-th entity in the entity space into the m-th relation space to form a j-th projection, and determine the m-th relation exists for the i-th entity and the j-th entity if a sum of the i-th projection and the m-relation substantially equals to the j-th projection; and
construct the knowledge graph using the determined m-th relation,
wherein the computer executable code is configured to convert each of the at least one sentence into the third number of sentence embeddings by:
encoding tokens in the at least one sentence into a plurality of one-hot vectors, each of the plurality of one-hot vectors corresponding to one of the tokens in the at least one sentence, wherein the tokens comprises words and punctuations;
embedding each of the plurality of one-hot vectors into a word embedding;
performing LSTM on the word embeddings to obtain a plurality of feature vectors, each feature vector corresponding to one of the tokens in the at least one sentence; and
performing a self-structure attention on the plurality of feature vectors to obtain the third number of sentence embeddings,
wherein the set transformer comprises an encoder and decoder, the encoder is configured to encode the primary capsules to obtain encoded primary capsules, and the decoder is configured to use the encoded primary capsules, entity seed embeddings and relation seed embeddings to calculate and obtain the entity capsules and the relation capsules, and wherein a number of the entity seed embeddings is equal to a number of the entity capsules, and a number of the relation seed embeddings is equal to a number of the relation capsules.