Transformer-based model knowledge graph link prediction
A system, product, and method are provided for improving knowledge graph (KG) link prediction using transformer-based artificial neural networks. A first topic model is leveraged against a first dataset derived from a KG containing a plurality of first triples. The first triples include first entities and first edges connecting the first entities to represent relationships between the first connected entities. A first similarity function is applied to the first connected entities of the first triples to provide respective first similarity scores. A first subset of one of more first triples is selected from the plurality of first triples based upon the first similarity scores. An artificial neural network is trained using the selected first subset of one or more first triples.
1 . A computer system comprising:
a processor operatively coupled to memory; and
an artificial intelligence (AI) platform in communication with the processor and the memory, the AI platform comprising:
a topic model manager configured to:
leverage a first topic model against a first dataset, the first dataset derived from an open knowledge graph (open KG) comprising a plurality of first triples, each of the plurality of first triples comprising first entities and first edges connecting the first entities to represent relationships between the first connected entities,
the leverage of the first topic model comprising:
applying a first similarity function to the first connected entities of the plurality of first triples to provide respective first similarity scores; and
down sampling, using the first topic model, the plurality of first triples into a first subset of training triples based on the first similarity scores, wherein the first subset comprises training triples having first similarity scores satisfying a first threshold;
a machine learning manager (MLM) configured to train a transformer based artificial neural network (ANN) using the first subset of training triples, wherein the training of the transformer based ANN includes:
leveraging, based on a cosine similarity, the first topic model to evaluate and classify the training triples;
ranking, based on the leveraging, the training triples;
restricting, based on the ranking, the training triples to generate a restricted subset of training triples for training the ANN;
training, by the MLM based on the restricting, the ANN with the restricted subset of training triples; and
performing, using the trained ANN, one or more KG tasks, the one or more KG tasks comprising at least one of triple classification, link prediction, relation prediction, or a combination thereof; and
an orchestration layer configured to thread together the topic model manager and the MLM to deploy the trained ANN.
2 . The computer system of claim 1 , wherein the first similarity function comprises a cosine similarity function.
3 . The computer system of claim 1 , wherein:
the AI platform is configured to receive a query including a known entity and a relation, the query omitting an unknown entity which possesses the relation with respect to the known entity;
the topic model manager is further configured to:
leverage a second topic model against a second dataset comprising a plurality of second triples, each of the plurality of second triples comprising second entities and second edges connecting the second entities to represent relationships between the second connected entities, the leverage of the second topic model including to apply a second similarity function, which may be the same as or different than the first similarity function, to the second connected entities of the second triples to provide respective second similarity scores; and
select a second subset of triples from the plurality of second triples based upon the second similarity scores; and
the MLM manager is further configured to:
leverage the trained ANN to assess, for each of the second entities of the second subset corresponding to the unknown entity of the query, a respective confidence score; and
output at least one of the second entities of the second subset based upon the confidence score.
4 . The computer system of claim 3 , wherein the second similarity function comprises a cosine similarity function.
5 . The computer system of claim 3 , wherein the second dataset is derived from the open KG and is different than the first dataset.
6 . The computer system of claim 1 , wherein the ANN comprises a knowledge graph bi-directional encoder representations from transformer (KG-BERT) model.
7 . The computer system of claim 1 , wherein the computer system is not configured to carry out canonicalization of the first entities of the open KG, and wherein the computer system is configured to operate unsupervised.
8 . A computer program product comprising:
a computer readable storage device; and
program code embodied with the computer readable storage device, the program code executable by a processor to:
leverage a first topic model against a first dataset, the first dataset derived from an open knowledge graph (open KG) comprising a plurality of first triples, each of the plurality of first triples comprising first entities and first edges connecting the first entities to represent relationships between the first connected entities;
apply a first similarity function to the first connected entities of the plurality of first triples to provide respective first similarity scores;
down sample, using the first topic model, the plurality of first triples into a first subset of training triples based on the first similarity scores, wherein the first subset comprises training triples having first similarity scores satisfying a first threshold;
leverage, based on a cosine similarity, the first topic model to evaluate and classify the training triples;
rank, based on the leveraging, the training triples;
restrict, based on the ranking, the training triples to generate a restricted subset of training triples for training a transformer-based artificial neural network (ANN);
train, based on the restricting, the ANN with the restricted subset of training triples, wherein an application program interface (API) is operatively coupled to an orchestration layer, the orchestration layer functions as an abstraction layer to thread together the ranking and the training;
deploy the trained ANN; and
perform, using the trained ANN, one or more KG tasks, the one or more KG tasks comprising at least one of triple classification, link prediction, relation prediction, or a combination thereof.
9 . The computer program product of claim 8 , wherein the first similarity function comprises a cosine similarity function.
10 . The computer program product of claim 8 , wherein the program code is further executable by the processor to:
receive a query including a known entity and a relation, the query omitting an unknown entity which possesses the relation with respect to the known entity;
leverage a second topic model against a second dataset comprising a plurality of second triples, each of the plurality of second triples comprising second entities and second edges connecting the second entities to represent relationships between second connected entities, the leverage of the second topic model including to apply a second similarity function, which may be the same as or different than the first similarity function, to the second connected entities of the plurality of second triples to provide respective second similarity scores; and
select a second subset of triples from the plurality of second triples based upon the second similarity scores;
leverage the trained ANN to assess, for each of the second entities of the second subset corresponding to the unknown entity of the query, a respective confidence score; and
output at least one of the second entities of the second subset based upon the confidence score.
11 . The computer program product of claim 10 , wherein the second similarity function comprises a cosine similarity function.
12 . The computer program product of claim 10 , wherein the second dataset is derived from the open KG and is different than the first dataset.
13 . The computer program product of claim 8 , wherein the ANN comprises a knowledge graph bi-directional encoder representations from transformer (KG-BERT) model.
14 . The computer program product of claim 8 , wherein the computer program product does not comprise program code executable by the processor to carry out canonicalization of the first entities of the KG, and wherein the computer program product is configured to operate unsupervised.
15 . A method comprising:
leveraging a first topic model against a first dataset, the first dataset derived from an open knowledge graph (open KG) comprising a plurality of first triples, the plurality of first triples comprising first entities and first edges connecting the first entities to represent relationships between the first connected entities;
applying a first similarity function to the first connected entities of the plurality of first triples to provide respective first similarity scores;
down sampling, using the first topic model, the plurality of first triples into a first subset of training triples based on the first similarity scores, the first subset comprises training triples having first similarity scores satisfying a first threshold; and
leveraging, based on a cosine similarity, the first topic model to evaluate and classify the training triples;
ranking, based on the leveraging, the training triples;
restricting, based on the ranking, the training triples to generate a restricted subset of training triples for training a transformer-based artificial neural network (ANN);
training, based on the restricting, the ANN with the restricted subset of training triples, wherein an application program interface (API) is operatively coupled to an orchestration layer, the orchestration layer functioning as an abstraction layer to thread together the ranking and the training;
deploying the trained ANN; and
performing, using the trained ANN, one or more KG tasks, the one or more KG tasks comprising at least one of triple classification, link prediction, relation prediction, or a combination thereof.
16 . The method of claim 15 , wherein the first similarity function comprises a cosine similarity function.
17 . The method of claim 15 , further comprising:
receiving a query including a known entity and a relation, the query omitting an unknown entity which possesses the relation with respect to the known entity;
leveraging a second topic model against a second dataset comprising a plurality of second triples, each of the plurality of second triples comprising second entities and second edges connecting the second entities to represent relationships between the second connected entities, the leveraging of the second topic model including to apply a second similarity function, which may be the same as or different than the first similarity function, to the second connected entities of the second triples to provide respective second similarity scores; and
selecting a second subset of triples from the plurality of second triples based upon the second similarity scores;
leveraging the trained ANN to assess, for each of the second entities of the second subset corresponding to the unknown entity of the query, a respective confidence score; and
outputting at least one of the second entities of the second subset based upon the confidence score.
18 . The method of claim 17 , wherein the second similarity function comprises a cosine similarity function.
19 . The method of claim 17 , wherein the second dataset is derived from the open KG and is different than the first dataset.
20 . The method of claim 15 , wherein the ANN comprises a knowledge graph bi-directional encoder representations from transformer (KG-BERT) model.