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

Possible error in the question_answering notebook ? #72

Open
Sam131112 opened this issue Aug 14, 2021 · 0 comments
Open

Possible error in the question_answering notebook ? #72

Sam131112 opened this issue Aug 14, 2021 · 0 comments

Comments

@Sam131112
Copy link

Sam131112 commented Aug 14, 2021

In the question answering notebook after the cell max_answer_length = 30 this the next cell code

.......
start_indexes` = np.argsort(start_logits)[-1 : -n_best_size - 1 : -1].tolist()`
end_indexes = np.argsort(end_logits)[-1 : -n_best_size - 1 : -1].tolist()`
valid_answers = []`
for start_index in start_indexes:
    for end_index in end_indexes:
        # Don't consider out-of-scope answers, either because the indices are out of bounds or correspond
        # to part of the input_ids that are not in the context.
        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
        ):
  
            continue
........

Here start_indexes can never be more than sequence length becasue the argmax is over an array of 384 sequences i.e the max sequence length . So how does start_index >= len(offset_mapping) & end_index >= len(offset_mapping) make sense here ?

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

1 participant