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

exclude spans that are out of valid window #128

Merged
merged 6 commits into from
Apr 11, 2022

Conversation

ArneBinder
Copy link
Owner

@ArneBinder ArneBinder commented Apr 3, 2022

When doing inference with a TransformerTokenClassificationTaskModule that was trained with windowing and an overlap, it will also produce spans from the output of the model that is just the additional context, i.e. the part that overlaps. However, this is not recommended since the model was not trained to produce correct predictions for this part (just the non-overlapping part was taken into account to use every part of the input only "once" for training).

This PR excludes spans that are completely out of the valid window (the not overlapping part). However, we still take predicted spans into account, that are only partly in the valid window because they would get lost otherwise. But this has to be taken into account for further post-processing steps since it may produce the same span multiple times (i.e. from the end of one window and from the beginning of the next one). Any de-duplication is not handled here.

@ArneBinder ArneBinder requested a review from ChristophAlt April 3, 2022 15:12
@ArneBinder ArneBinder changed the title exclude spans that are out of window exclude spans that are out of valid window Apr 3, 2022
… test to contain a span that is only partly in valid window
@ArneBinder ArneBinder added the bug Something isn't working label Apr 3, 2022
@ChristophAlt ChristophAlt merged commit 5128214 into main Apr 11, 2022
@ChristophAlt ChristophAlt deleted the fix/exclude_out_of_window_spans branch April 17, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

token classification with windowing should not contain predictions from pure context
2 participants