Patent ID: 11861311
Assignee: JD.COM AMERICAN TECHNOLOGIES CORPORATION
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 9:
10. A method, comprising:
providing, by a computing device, 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;
converting, by the computing device, each of the at least one sentence into a third number of sentence embeddings;
forming, by the computing device, primary capsules for a capsule neural network, wherein each of the primary capsules is one of the third number of sentence embeddings;
using, by the computing device, 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;
projecting, by the computing device, the i-th entity in an entity space into an m-th relation space to form an i-th projection, projecting the j-th entity in the entity space into the m-th relation space to form a j-th projection, and determining 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
constructing the knowledge graph using the determined m-th relation,
wherein the step of converting each of the at least one sentence into a third number of sentence embeddings comprises:
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;
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.