-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[ML] fix NLP question_answering task when best answer is only one token #88347
[ML] fix NLP question_answering task when best answer is only one token #88347
Conversation
Pinging @elastic/ml-core (Team:ML) |
Hi @benwtrent, I've created a changelog YAML for you. |
@elasticmachine update branch |
@@ -212,7 +212,7 @@ static void topScores( | |||
if (startNormalized[i] == 0) { | |||
continue; | |||
} | |||
for (int j = i + 1; j < (maxAnswerLength + i) && j < tokenSize; j++) { | |||
for (int j = i; j < (maxAnswerLength + i) && j < tokenSize; j++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 227 still has i + 1
. Is that correct? If it is then it would be good to add a comment explaining why a different start point is used in the two places.
…sticsearch into bugfix/ml-q_and_a-nlp-task
@elasticmachine update branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There are scenarios when question_answering find the best start/end token and they are the same token. An example of this is:
context: "My name is Ben and I live in London"
question: "Where do I live?"
The correct answer here is
London
and its a single token. Without this fix, we will returnin London
with a lower probability.