declare-lab / RelationPrompt

This repository implements our ACL Findings 2022 research paper RelationPrompt: Leveraging Prompts to Generate Synthetic Data for Zero-Shot Relation Triplet Extraction. The goal of Zero-Shot Relation Triplet Extraction (ZeroRTE) is to extract relation triplets of the format (head entity, tail entity, relation), despite not having annotated data for the test relation labels.
MIT License
122 stars 16 forks source link

Hi! I‘m trying to run this code lately. I've got a question that why there is only pretrained model for unseen=10 seed=0.WHere should I find other models? thank you #4

Closed Drizze999 closed 2 years ago

chiayewken commented 2 years ago

Hi, sorry we did not release the weights for all the random seeds, but you can reproduce the results using the commands here: https://github.com/declare-lab/RelationPrompt#experiment-scripts

Drizze999 commented 2 years ago

I see. Then I used these commands changed for other random seeds, but there's an error keeps occurring :'Can't load config for 'outputs/wrapper/fewrel/unseen_x_seed_x/generator/model'. How can I solve this problem?

chiayewken commented 2 years ago

Hi, can you provide the commands that caused the error? For example, I tried with the following commands but there is no error on Python 3.7.12, V100 GPU.

python wrapper.py main \
  --path_train outputs/data/splits/zero_rte/fewrel/unseen_15_seed_4/train.jsonl \  
  --path_dev outputs/data/splits/zero_rte/fewrel/unseen_15_seed_4/dev.jsonl \
  --path_test outputs/data/splits/zero_rte/fewrel/unseen_15_seed_4/test.jsonl \
  --save_dir outputs/wrapper/fewrel/unseen_15_seed_4

python wrapper.py run_eval \
  --path_model outputs/wrapper/fewrel/unseen_15_seed_4/extractor_final \
  --path_test outputs/data/splits/zero_rte/fewrel/unseen_15_seed_4/test.jsonl \
  --mode multi
Drizze999 commented 2 years ago

I find out that my GPU has smaller memory than yours,so I changed batch size to the half of the original one.Then this error had been solved!Thank you so much for your reply!~

chiayewken commented 2 years ago

No problem, to maintain the same effective batch size, you can use gradient accumulation, for example in the demo.

Drizze999 commented 2 years ago

OK!I will try larger gradient accumulation.