malllabiisc / EmbedKGQA

ACL 2020: Improving Multi-hop Question Answering over Knowledge Graphs using Knowledge Base Embeddings
Apache License 2.0
414 stars 96 forks source link

embedding from train_embedding and kge are not compatible #66

Closed violetcodes closed 3 years ago

violetcodes commented 3 years ago

Hi, I was trying to use this module for our own created open kg. to train kg embedding (complex) i used train_embedding/main.py on our own data formatted as fb237, and saved best model using torch.save() I was unable to load this trained model in KGQA/RoBERTa/main.py for training kgqa model. code was breaking on the following line.

   >>kge_checkpoint = load_checkpoint(checkpoint_file)
 ->>>kge_model = KgeModel.create_from(kge_checkpoint)

Is it necessary to use KgeModel, can't we directly use embeddings trained from train_embedding/main.py ?

dinani65 commented 3 years ago

I apologize it if my comment is not related to your question and greatly appreciate it if u can solve my doubt. When I want to generate vector representations of the CQW-subgraph-entities based on an algorithm, should I use the Freebase dataset or is there a sub set of Freebase to do it? generally, question-answering datasets are subsets of large datasets such as Freebase, so what is the approach to generate graph embeddings of the entities? Working with the whole dataset is an issue itself.

apoorvumang commented 3 years ago

@violetcodes We use embeddings trained using https://github.com/uma-pi1/kge . The KgeModel class is from that code, so you will either have to use that library for training (which I highly recommend) or change significant amount of code.

train_embedding/main.py isn't a very good implementation and it is also hard to do hyperparameter search.

violetcodes commented 3 years ago

@apoorvumang ok thanks.