wangbo9719 / StAR_KGC

84 stars 10 forks source link

How to generate the new_dev.dict? #8

Closed tideng777 closed 2 years ago

tideng777 commented 2 years ago

Hi Guy, good job. I met some problem when I try to run my dataset. I wanna know How to generate the _newdev.dict?

I use "--do_eval" in link prediction, it will show an error below: Traceback (most recent call last): File "run_link_prediction.py", line 4, in main() File "/data2/lidj/projects/StAR_KGC/StAR/link_prediction/train.py", line 950, in main train(args, train_dataset, model, tokenizer, eval_dataset=dev_dataset, eval_fn=evaluate_pairwise_ranking) File "/data2/lidj/projects/StAR_KGC/StAR/kbc/utils_fn.py", line 279, in train args, eval_dataset, model, tokenizer, global_step=global_step, fileprefix="eval") File "/data2/lidj/projects/StAR_KGC/StAR/link_prediction/train.py", line 625, in evaluate_pairwise_ranking dev_dict = torch.load("./data/" + args.dataset + "/new_dev.dict") File "/data2/lidj/venv/StAR/lib/python3.6/site-packages/torch/serialization.py", line 579, in load with _open_file_like(f, 'rb') as opened_file: File "/data2/lidj/venv/StAR/lib/python3.6/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/data2/lidj/venv/StAR/lib/python3.6/site-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: './data/ctd/new_dev.dict'

However, if i didn't use "--do_eval" in link prediction, it will generate _newdev.dict at last. Do we have any method to generate the _newdev.dict before running link prediction?

Hope you reply. Thanks a lot.

wangbo9719 commented 2 years ago

You can refer to the closed issue #1 to generate the new_dev.dict for your own dataset.