You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experienced the same problem. I solved this issue in the following way:
In the evaluation part, more exactly in function: postprocess_qa_predictions, add the next conditions to the if statement (in order to don't consider out-of-scope answers): offset_mapping[start_index] == [] and offset_mapping[end_index] == []
Check below the before and after of the proposed solution.
Before:
if (
start_index >= len(offset_mapping)
or end_index >= len(offset_mapping)
or offset_mapping[start_index] is None
or offset_mapping[end_index] is None
):
After:
if (
start_index >= len(offset_mapping)
or end_index >= len(offset_mapping)
or offset_mapping[start_index] is None
or offset_mapping[end_index] is None
or offset_mapping[start_index] == []
or offset_mapping[end_index] == []
):
Hello, I am running this notebook Question Answering on SQUAD using Colab: https://colab.research.google.com/github/huggingface/notebooks/blob/master/examples/question_answering.ipynb
I got the IndexError in this step, could you please have a look how to fix it? Thanks!
final_predictions = postprocess_qa_predictions(datasets["validation"], validation_features, raw_predictions.predictions)
This is the output:
The text was updated successfully, but these errors were encountered: