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

default behavior of Bag context for out-of-bounds annotations #393

Open
bethard opened this issue Apr 15, 2015 · 2 comments
Open

default behavior of Bag context for out-of-bounds annotations #393

bethard opened this issue Apr 15, 2015 · 2 comments
Labels
🐛 Bug Something isn't working Priority-Medium

Comments

@bethard
Copy link
Contributor

bethard commented Apr 15, 2015

Original issue 395 created by ClearTK on 2013-12-08T15:15:59.000Z:

I'm a little surprised by the default behavior of the Bag context when the specified range of its context annotations goes "out-of-bounds" - i.e. past the last annotations. If the specified range goes past the last token in the JCas, then "out-of-bounds" features will be generated. Such features have names whose prefix is {{{OOB}}} followed by a digit corresponding to how far out of the range the feature is. This is pretty confusing default behavior I think. You can imagine that you might generate 50 features per bag. When you get to the end of your token annotations then you will end up with features with the values OOB1, OOB2, ... OOB49. Yikes! To me, it seems that the default behavior would be to filter out OOB features for the Bag context. When those features are desired, then it seems like they should not be indexed.

[Steve]
The Bag context has no concept of in or out of bounds. All it does is
strip off the position information generated other contexts. So if
you're seeing out-of-bounds stuff, it's from the other contexts, not
from Bag.

That said, Bag strips the position by taking the .feature field of a
ContextFeature, and that .feature field is a little bit strange for
out-of-bounds features. If you want to mess around with this, look at
the ContextFeature(String, int, int, String) constructor.

I agree that the interaction of ContextFeature, Bag and other contexts
probably isn't what you would have expected. Where the fix belongs,
I'm not 100% sure.

@bethard
Copy link
Contributor Author

bethard commented Apr 15, 2015

Comment #1 originally posted by ClearTK on 2013-12-08T15:18:14.000Z:

I was wondering if you get the same features when you use the extractWithin method. You do.

@bethard
Copy link
Contributor Author

bethard commented Apr 15, 2015

Comment #2 originally posted by ClearTK on 2014-03-15T17:41:52.000Z:

<empty>

@bethard bethard modified the milestone: 2.2 Apr 16, 2015
@reckart reckart modified the milestones: 3.0.0, ⭐️ Feature backlog Nov 4, 2022
@reckart reckart added 🐛 Bug Something isn't working and removed Type-Defect labels Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working Priority-Medium
Projects
None yet
Development

No branches or pull requests

2 participants