birch icon indicating copy to clipboard operation
birch copied to clipboard

list index out of range

Open xuezzz opened this issue 5 years ago • 2 comments

I did it exactly according to readme, but there was a error... Could you tell me how to fix it? Thanks!

`Running eval/trec_eval.9.0.4/trec_eval data/qrels/qrels.mb.txt data/predictions/predict.tmp -m map -m P.20 -m ndcg_cut.20

Traceback (most recent call last): File "src/main.py", line 92, in main()

File "src/main.py", line 32, in main train(args)

File "/home/castil/xueee/birch-master/src/model/train.py", line 53, in train best_score = eval_select(args, model, tokenizer, validate_dataset, args.model_path, best_score, epoch)

File "/home/castil/xueee/birch-master/src/model/test.py", line 9, in eval_select scores_dev = test(args, split='dev', model=model, test_dataset=validate_dataset)

File "/home/castil/xueee/birch-master/src/model/test.py", line 87, in test qrels_file=os.path.join(args.data_path, 'qrels', 'qrels.{}.txt'.format(args.collection)))

File "/home/castil/xueee/birch-master/src/model/eval.py", line 14, in evaluate map = float(lines[0].strip().split()[-1])

IndexError: list index out of range`

xuezzz avatar Dec 04 '19 12:12 xuezzz

Hi @xuezzz, thanks for your interest in our work! I imagine trec_eval not executing properly is the reason for this error. Could you please print out pout and perr in src/model/eval.py? Could you also share the format of your qrels and predict files with head -5? Thanks!

zeynepakkalyoncu avatar Dec 04 '19 13:12 zeynepakkalyoncu

Thanks for your reply quicky! I will try it later.

xuezzz avatar Dec 04 '19 13:12 xuezzz