Open Laxmaan opened 4 years ago
Hi
Since it it possible after modifications that the output_res['n_ary_relation']['metadata'] is a empty list so you cannot index into it of course. Please try wrapping this portion in try ... except .... block .
Could you replace metadata = output_res['n_ary_relation']['metadata'][0]
with metadata = batch['metadata'][0]
to solve this?
It is possible although I would suggest making the change in your fork. Right now I am not sure if the change will break anything else so I won't to leave it as it is.
Let me know if it still doesn't work
I'm running the prediction script and I'm getting a "metadata" KeyError as shown below
I went up to the
decode
function inentity_relation.py
, where I replacedoutput_dict['metadata']
withoutput_dict.get('metadata',[])
For the batches that do not have any spans.That led to this error occuring:
Returning a default value of
[]
did not seem to do the trick. How can I fix it?