-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Aggregation strategy does not respect original utterance #18738
Comments
HI @ierezell , It does make sense what you asking for, but it's probably not going to happen since it would be a backward incompatibilty.
This means that during decoding anything can happen to the string and there is no reason for it to be like the original string. What we could do, is use the offsets instead to lookup in the original string what was actually in there, but that would break existing pipelines relying on this code to actually use decode.
There are a lot of quirks in the pipelines like this which are not huge changes, but that we still can't do because it would mean breaking user code. |
Hello @Narsil, I understood the underlying problem as I checked the code before opening the issue and saw the "tokenizer problem". It's not a "huge" problem as anyone can still reconstruct the "original" spans with starts and stops as they're "correct". For the solutions :
I totally understand that you need to keep a stable API, and I understand the underlying problem. I just wanted to flag that innocent people like me can misuse the returned data. Thanks for the information and help :) Have a great day |
Thanks for understanding, I'll let core maintainers conclude on this. For the documentation, would this be better/enough ? |
System Info
transformers
version: 4.21.1Who can help?
@Narsil
@LysandreJik
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Steps to reproduce :
AggregationStrategy.SIMPLE
:Input :
"Hi, can you book me flight ticket ? Also, will there be some snacks available on the plane ? Many thanks."
Note that the
start
andend
of the Aggregated Output are good ! But the "word" is not.This sentence with the index is well extracted as
input[27:33]="ticket"
+input[33:34] = " "
+input[34:35]="?"
="ticket ?"
Expected behavior
Having the returned
word
span matches exactly the original utterance as we could use indexes and text span in the rest of our code.Thanks in advance,
Have a great day :)
The text was updated successfully, but these errors were encountered: