Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom dataset with different relations #17

Open
Taghreed7878 opened this issue Feb 20, 2023 · 1 comment
Open

Custom dataset with different relations #17

Taghreed7878 opened this issue Feb 20, 2023 · 1 comment

Comments

@Taghreed7878
Copy link

Taghreed7878 commented Feb 20, 2023

Hi,
I'm trying to train R-BERT on my dataset with different relations using your repo. I reformatted my dataset to be in your format for semeval, but when I run the train eval command I get an error because the evaluator tries to read from the result file and finds it empty.

When I looked at the eval directory before training, I found two files, I understand that the answer_keys file in used during evaluating model performance, I constructed my own answer_keys file.

About the second file, I changed the if part that contains relations for semeval to my relations. I still got the same error:
Evaluating: 100% 1178/1178 [02:04<00:00, 9.48it/s]
Bad file format on line 37675: '155333 date of birth(e1, e2)'
Iteration: 3% 249/7354 [03:24<1:37:08, 1.22it/s]
Epoch: 0% 0/10 [03:24<?, ?it/s]
Traceback (most recent call last):
File "main.py", line 117, in
main(args)
File "main.py", line 19, in main
trainer.train()
File "/content/drive/MyDrive/R-BERT/trainer.py", line 125, in train
self.evaluate("test") # There is no dev set for semeval task
File "/content/drive/MyDrive/R-BERT/trainer.py", line 192, in evaluate
result = compute_metrics(preds, out_label_ids)
File "/content/drive/MyDrive/R-BERT/utils.py", line 54, in compute_metrics
return acc_and_f1(preds, labels)
File "/content/drive/MyDrive/R-BERT/utils.py", line 65, in acc_and_f1
"f1": official_f1(),
File "/content/drive/MyDrive/R-BERT/official_eval.py", line 17, in official_f1
macro_result = list(f)[-1]
IndexError: list index out of range

@zhangliang-chn
Copy link

Hi, I encountered the same problem as you, did you solve it later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants