Giter Club home page Giter Club logo

cronkgqa's People

Contributors

apoorvumang avatar theartpiece avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cronkgqa's Issues

Complex pretrained embeddings for embedkgqa_complex ?

hi,I have another question,I trained embedkgqa_complex,but when I to eval it , the following error occurred:
Traceback (most recent call last):
File "./train_qa_model.py", line 551, in
qa_model.load_state_dict(torch.load(filename))
File "/opt/current-env/anaconda3/envs/tf_2.x/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1223, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for QA_model_EmbedKGQA_complex:
Missing key(s) in state_dict: "entity_embedding.weight", "time_embedding.weight".
Unexpected key(s) in state_dict: "tkbc_model.embeddings.0.weight", "tkbc_model.embeddings.1.weight", "tkbc_model.embeddings.2.weight", "entity_time_embedding.weight", "answer_type_embedding.weight", "combine_all_entities_func_forReal.weight", "combine_all_entities_func_forReal.bias", "combine_all_entities_func_forCmplx.weight", "combine_all_entities_func_forCmplx.bias", "linear2.weight", "linear2.bias", "bn2.weight", "bn2.bias", "bn2.running_mean", "bn2.running_var", "bn2.num_batches_tracked".

Originally posted by @AdienQ in #8 (comment)

Question hops

Hi,

Very interesting work and a helpful dataset! Just one quick question: Does the question contain multi-hop questions? For example, "who was the President of the USA after world war II?", the important question entity is "the President of the USA" (Q11696). In this question, answers are direct neighbours (or 1hop neighbours) of "the President of the USA". Does your dataset contain multi-hop questions from the important question entity? Many thanks.

Best regards
Sirui

pretrained model

Hello, I'd like to ask why I get exactly the same result with distilbert-base-uncased and roberta-base?

How did you get the entity/time embedding?

Hi!
You mentioned in your paper that you used tkbc's paper method to get entity/time embedding,if I want use your method in other dataset,How can I get the perfect pretrain entity/time embedding? Is the model which get the best score?

about embedkgqa

hi,embedkgqa model = cronkgqa,but which model is the real embedkgqa?

'pip install -r requirements.txt" show a warning of incompatibilily

The following is the warning

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

allennlp 0.8.3-unreleased requires spacy<2.1,>=2.0, but you'll have spacy 3.0.5 which is incompatible.

KeyError: 'head'

KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/jupyter/miniforge3/envs/env8/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/jupyter/miniforge3/envs/env8/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/jupyter/miniforge3/envs/env8/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/jupyter/workspace/CronKGQA-main/qa_datasets.py", line 372, in getitem
head = data['head'][index]
KeyError: 'head'

I cannot find some files(embedkgqa_dual_frozen_lm_fix_order_ce.ckpt)

Hello sir. When I run the notebook, some errors happened.
The question I want to ask is 'tcomplex_ 17dec.ckpt' and 'tkbc_17dec.ckpt' the same.
The 'tcomplex_17dec.ckpt' is in the folder 'models'. While 'tkbc_17dec.ckpt' is required in the notebook.

FileNotFoundError                         Traceback (most recent call last)
/home/v_lihongliang/CronKGQA/cronkgqa_testing.ipynb Cell 6 in <cell line: 8>()
      [3](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2) filename = 'models/{dataset_name}/qa_models/{model_file}.ckpt'.format(
      [4](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3)     dataset_name=dataset_name,
      [5](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=4)     model_file='embedkgqa_dual_frozen_lm_fix_order_ce'
      [6](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=5) )
      [7](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=6) print('Loading model from', filename)
----> [8](/CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=7) qa_model.load_state_dict(torch.load(filename))
      [9](CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=8) print('Loaded qa model from ', filename)
     [10](/CronKGQA/cronkgqa_testing.ipynb#W5sdnNjb2RlLXJlbW90ZQ%3D%3D?line=9) qa_model = qa_model.cuda()

File ~/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/torch/serialization.py:699, in load(f, map_location, pickle_module, **pickle_load_args)
    696 if 'encoding' not in pickle_load_args.keys():
    697     pickle_load_args['encoding'] = 'utf-8'
--> 699 with _open_file_like(f, 'rb') as opened_file:
    700     if _is_zipfile(opened_file):
    701         # The zipfile reader is going to advance the current file position.
    702         # If we want to actually tail call to torch.jit.load, we need to
    703         # reset back to the original position.
    704         orig_position = opened_file.tell()

File ~/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/torch/serialization.py:230, in _open_file_like(name_or_buffer, mode)
    228 def _open_file_like(name_or_buffer, mode):
    229     if _is_path(name_or_buffer):
...
File ~/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/torch/serialization.py:211, in _open_file.__init__(self, name, mode)
    210 def __init__(self, name, mode):
--> 211     super(_open_file, self).__init__(open(name, mode))

FileNotFoundError: [Errno 2] No such file or directory: 'models/wikidata_big/qa_models/embedkgqa_dual_frozen_lm_fix_order_ce.ckpt'

Some questions in the dataset are wrong with {tail2}

Hi! @apoorvumang Amazing work here!

I found that some questions in the dataset with the type of "time_join" are wrong, in which there's a {tail2} in the template that is not correctly mapped. Some examples are:
"When Q300269 was the Q37303731 , who was the {tail2}"
"Who was {tail2} when Q6105302 was the Q41582582"

I wonder if there are some problems with templates like the following or something else?
"Who was the {tail2} when {head} was the {tail}"

Thanks!
Best,
Yonghao

Problems about the dataset.

Hi all! @apoorvumang @soumen-chakrabarti @theartpiece

Could you please tell me what every field means in the wikidata .pickle you kindly offered in the repo? To be more specific, what do IDs like "Q5256864" mean in the 'answers'? How should I build the correspondence between them and some possible original data?

Thanks a lot in advance and look for your reply!

ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler'

Following the directions in README carefully, I encountered this error.

/home/jae/Dropbox/USC/Fall2022/KG/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
Output exceeds the [size limit](command:workbench.action.openSettings?[). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?2f3f0869-f0a7-4cdc-a791-d967ccf96ea7)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In [1], line 9
      6 import pickle
      7 import numpy as np
----> 9 from qa_models import QA_model, QA_model_Only_Embeddings, QA_model_BERT, QA_model_EaE, QA_model_EmbedKGQA, QA_model_EaE_replace, QA_model_EmbedKGQA_complex
     10 from qa_datasets import QA_Dataset, QA_Dataset_model1, QA_Dataset_EaE, QA_Dataset_EmbedKGQA, QA_Dataset_EaE_replace
     11 from torch.utils.data import Dataset, DataLoader

File ~/Dropbox/USC/Fall2022/KG/CronKGQA/qa_models.py:6
      4 import numpy as np
      5 from tkbc.models import TComplEx
----> 6 from transformers import RobertaModel
      7 from transformers import BertModel
      8 from transformers import DistilBertModel

File ~/Dropbox/USC/Fall2022/KG/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/transformers/__init__.py:626
    614     from .optimization import (
    615         Adafactor,
    616         AdamW,
   (...)
    622         get_polynomial_decay_schedule_with_warmup,
    623     )
    625     # Trainer
--> 626     from .trainer import Trainer
...
---> 40     from torch.optim.lr_scheduler import SAVE_STATE_WARNING
     42 logger = logging.get_logger(__name__)
     45 def torch_pad_and_concatenate(tensor1, tensor2, padding_index=-100):

ImportError: cannot import name 'SAVE_STATE_WARNING' from 'torch.optim.lr_scheduler' (/home/jae/Dropbox/USC/Fall2022/KG/CronKGQA/cronkgqa_env/lib/python3.8/site-packages/torch/optim/lr_scheduler.py)

pytorch==1.12.1
transformers==4.0.0
py3.8_cuda11.3_cudnn8.3.2_0

Time before BC

Hello!
Your work is great!

But in your train file, there is one line:

Q500099 P793 Q1190554 0600 0000

which means Jastorf culture occurred from 600 BC to 0(I searched it on google)

I do not think such labels are suitable, in my opinion it should be "-600" instead of "600" since we want to keep start_time < end_time.

But adding one minus symbol seems wired too, so do you have any other better solutions for this problem?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.