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

Support for Multiple Features in a Single Annotation Suggestion #64

Open
lfcc1 opened this issue Dec 16, 2024 · 1 comment
Open

Support for Multiple Features in a Single Annotation Suggestion #64

lfcc1 opened this issue Dec 16, 2024 · 1 comment

Comments

@lfcc1
Copy link
Contributor

lfcc1 commented Dec 16, 2024

Is your feature request related to a problem? Please describe.

When generating an annotation suggestion, the recommenders (contrib) use the function create_span_prediction from the file "ariadne/contrib/inception_util.py" to create the prediction object. However, this function only supports adding a single feature to an annotation object in the CAS, which can be restrictive for annotation schemas that have multiple features on a single annotation layer. To this regard, I'm developing a module that is able to create suggestions with multiple features on a single annotation. Here is an example of my annotation schema:

image

Each annotation label type, Participant (green), Event (blue), Time (yellow), defines a specific set of features that should be annotated together. However, since I can only generate suggestions with one feature, I'm not able to create a recommender for this schema.

Describe the solution you'd like
I would like recommenders to have support for multiple features on a single annotation object.

Describe alternatives you've considered
The current workaround is to create separate annotation objects for each feature. However, this approach would be complex for the human annotator, as it would generate too many single annotations. Additionally, the suggestions would differ from the project annotation schema.

Additional context
As a simple experiment, I have tried to change the "create_span_prediction", by manually adding more features to the fields dictionary:

`
AnnotationType = cas.typesystem.get_type(layer)

fields = {"begin": begin, "end": end, IS_PREDICTION: True, feature: label, "Class": "Occurrence", "Tense": "Present"}

prediction = AnnotationType(**fields)

return prediction

`

I checked the HTTP response before it was sent to INCEpTION and confirmed that the new features (Class and Tense) were added to the CAS object. I have ensured that the new features exist on my INCEpTION span layer (as shown in the picture above). However, when using the recommender in INCEpTION, only the feature 'label' was taken into account when generating suggestions through the INCEpTION interface. The added features 'Class' and 'Tense' were not displayed.

Maybe there is something that needs to be done on INCEpTION side?
I would appreciate it if you could point me in the right direction.

Thank you

@reckart
Copy link
Member

reckart commented Dec 16, 2024

When you configure a recommender in INCEpTION, you configure a single layer and feature. When the recommender sends the CAS back to INCEpTION, only annotations on that layer are considered and only the value of the selected feature are extracted. An annotation suggestion inside INCEpTION always only consists of a single feature value - it cannot represent multiple features or values.

If you accept an annotation suggestion, the system will usually try to merge its value into an existing annotation. So the way you do it is to configure separate recommenders for each of your features - the annotators can then accept/reject the values they like and they should usually be merged together into a suitable existing annotation.

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

2 participants