While evaluating accuracy, IndexError: tuple index out of range
Shailendra77 opened this issue · 1 comments
When I am evaluating accuracy using below command available in the readme.md
python non_rg_metrics.py $BASE/transform_gen/roto-gold-val-beam5_gens.h5-tuples.txt $BASE/transform_gen/roto_stage1_$IDENTIFIER-beam5_gens.h5-tuples.txt
I was not able to find roto-gold-val-beam5_gens.h5-tuples.txt
So, based on #2 issue I have replace it with https://github.com/ratishsp/data2text-1/blob/master/roto-gold-val.h5-tuples.txt
But after getting the file I am again facing following issue.
Traceback (most recent call last):
File "non_rg_metrics.py", line 133, in
calc_precrec(sys.argv[1], sys.argv[2])
File "non_rg_metrics.py", line 81, in calc_precrec
gold_triples = get_triples(goldfi)
File "non_rg_metrics.py", line 71, in get_triples
all_triples.append(dedup_triples(curr))
File "non_rg_metrics.py", line 60, in dedup_triples
if trip_match(triplist[i], triplist[j]):
File "non_rg_metrics.py", line 51, in trip_match
return int_value(t1[1]) == int_value(t2[1]) and t1[2] == t2[2] and same_ent(t1[0], t2[0])
IndexError: tuple index out of range
I guess it is because of data length not matching.
Do I need to generate the file myself if yes then how? Please help me to resolve the issue.
Hi Shailendra,
I haven't seen an error before in these lines of code. Maybe printing the values of t1, t2 could help?